filter_value オブジェクト
コレクションページの絞り込みフィルター内の個別値を表すオブジェクト。フィルター値の URL パラメータ、表示ラベル、アクティブ状態、マッチ件数などを取得する。
仕様
202 行 / json{
"access": {
"global": false,
"parents": [
{
"object": "filter",
"property": ""
},
{
"object": "filter",
"property": "false_value"
},
{
"object": "filter",
"property": "true_value"
},
{
"object": "filter",
"property": "max_value"
},
{
"object": "filter",
"property": "min_value"
}
],
"template": []
},
"deprecated": false,
"deprecation_reason": "",
"description": "To learn about supporting filters in your theme, refer to [Support storefront filtering](/themes/navigation-search/filtering/storefront-filtering/support-storefront-filtering).",
"properties": [
{
"deprecated": false,
"deprecation_reason": "",
"description": "For example, `filter.v.option.color`.\n\nFilters of type `price_range` include an extra component depending on whether the filter value is for the filter's\n`min_value` or `max_value`. The following table outlines the URL parameter for each:\n\n| Value type | URL parameter |\n| --- | --- |\n| `min_value` | `filter.v.price.gte` |\n| `max_value` | `filter.v.price.lte` |",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The URL parameter for the parent filter of the filter value.",
"name": "param_name"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "For example, `High` will be used in the URL as `filter.v.option.strength=High`.",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The value for the URL parameter. The `value` is paired with the [`param_name`](#filter_value-param_name) property.",
"name": "value"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "boolean",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "Returns `true` if the value is currently active. Returns `false` if not.\n\nCan only return `true` for filters of type `boolean` or `list`.",
"name": "active"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "number",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The number of results related to the filter value.\n\nReturns a value only for `boolean` and `list` type filters. Returns `nil` for `price_range` type filters.",
"name": "count"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The customer-facing label for the filter value. For example, `Red` or `Rouge`.\n\nReturns a value only for `boolean` and `list` type filters. Returns `nil` for `price_range` type filters.",
"name": "label"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "> Note:\n> Any [pagination](/docs/api/liquid/tags/paginate) URL parameters are removed.",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The current page URL with the filter value parameter added.",
"name": "url_to_add"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "> Note:\n> Any [pagination](/docs/api/liquid/tags/paginate) URL parameters are also removed.",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The current page URL with the filter value parameter removed.",
"name": "url_to_remove"
},
{
"deprecated": true,
"deprecation_reason": "Deprecated in favor of the [swatch](#swatch) attribute.",
"description": "Returns a visual representation for the filter value.\nIf no visual representation is available, then `nil` is returned.",
"examples": [],
"return_type": [
{
"type": "filter_value_display",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The visual representation of the filter value.",
"name": "display"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "Returns a [swatch](/docs/api/liquid/objects/swatch) drop for the filter value.\nRequires the [filter presentation](/docs/api/liquid/objects/filter#filter-presentation) to be `swatch` and saved color or image content for the swatch. Otherwise, returns `nil`.",
"examples": [],
"return_type": [
{
"type": "swatch",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The visual representation of the filter value when a swatch is used.",
"name": "swatch"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "Returns an [image](/docs/api/liquid/objects/image) drop for the filter value.\nRequires the [filter presentation](/docs/api/liquid/objects/filter#filter-presentation) to be `image` and for an image to be available. Otherwise, returns `nil`.",
"examples": [],
"return_type": [
{
"type": "image",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The visual representation of the filter value when an image is used.",
"name": "image"
}
],
"summary": "A specific value of a filter.",
"name": "filter_value",
"examples": [],
"json_data": {
"path": "/search?q=potion&filter.v.option.strength=Low",
"handle": "search.filters.to_a[3].values[0]",
"data_from_file": ""
},
"return_type": []
}出典・ライセンス
- Repository:
- https://github.com/Shopify/theme-liquid-docs
- License:
- MIT
このコードは Shopify 著作の MIT ライセンスソースです。 原本の著作権は Shopify が保有します。日本語訳は ALSEL によるものです。
関連項目
content_for_header オブジェクト
Shopify が必要とするスクリプト(分析・チェックアウト・言語設定など)をすべて動的に出力するオブジェクト。theme.liquid の <head> タグ内に埋め込む必須要素。
metaobjects オブジェクト
ストア全体のメタオブジェクト定義にアクセスするグローバルオブジェクト。個別のメタオブジェクトはタイプとハンドルで参照でき、メタオブジェクト定義のエントリをループで反復処理できる。
additional_checkout_buttons オブジェクト
PayPal Express Checkout など、オフサイト決済に対応した外部決済プロバイダーがストアに設定されているかを真偽値で返す。`content_for_additional_checkout_buttons` と組み合わせて、該当するチェックアウトボタンを条件付きで表示する。
canonical_url オブジェクト
現在のページの正規 URL を取得するオブジェクト。Google などの検索エンジンに対してどのページ版が正規であるかを指定するために使用する。
content_for_index オブジェクト
ホームページに表示するセクションの内容を動的に返すオブジェクト。Liquid インデックステンプレートで必ず使用する。
content_for_additional_checkout_buttons オブジェクト
PayPal、Apple Pay、Google Pay など複数の決済プロバイダが有効になっているとき、その決済ボタンを HTML として出力するオブジェクト。`additional_checkout_buttons` で有無を判定したうえで、このオブジェクトで実際のボタンを表示する。