Liquid Snippets by ALSEL
📘 公式リファレンス📦 リファレンス/オブジェクト初級

sort_option オブジェクト

コレクションページと検索結果ページで利用可能なソートオプション。顧客向けの表示名とクエリ用の値を持つ。

用途
コレクション・検索ページで利用者がソート順序を選択できるドロップダウンやラジオボタンを構築するとき。各オプションの名前と値を取得する。
設置場所
collection.sort_options または search.sort_options をループして `{{ sort_option.name }}` と `{{ sort_option.value }}` を Liquid テンプレート内で参照する。通常は templates/collection.liquid や templates/search.liquid で使用。
注意点
name プロパティはマーチャントが管理画面の言語エディターで編集可能なため、翻訳機能がある場合は動的に変わる。value は collection.sort_by と search.sort_by パラメータに指定する値であり、直接編集は不可(Shopify 側で固定)。ソート値は「title-ascending」「price-ascending」「created-descending」など決まった形式になっている。
タグ:sortcollectionsearchdropdownfilter

仕様

62 行 / json
{
  "access": {
    "global": false,
    "parents": [
      {
        "object": "collection",
        "property": "sort_options"
      },
      {
        "object": "search",
        "property": "sort_options"
      }
    ],
    "template": []
  },
  "deprecated": false,
  "deprecation_reason": "",
  "description": "",
  "properties": [
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "The name can be edited by merchants in the [language editor](https://help.shopify.com/manual/online-store/themes/customizing-themes/language/change-wording).",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The customer-facing name of the sort option.",
      "name": "name"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "This value is used when assigning the [`collection.sort_by`](/docs/api/liquid/objects/collection#collection-sort_by) and\n[`search.sort_by`](/docs/api/liquid/objects/search#search-sort_by) parameters.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The value of the sort option.",
      "name": "value"
    }
  ],
  "summary": "A sort option for a collection or search results page.",
  "name": "sort_option",
  "examples": [],
  "json_data": {
    "path": "",
    "handle": "",
    "data_from_file": "{\"name\":\"Alphabetically, A-Z\",\"value\":\"title-ascending\"}"
  },
  "return_type": []
}

出典・ライセンス

License:
MIT

このコードは Shopify 著作の MIT ライセンスソースです。 原本の著作権は Shopify が保有します。日本語訳は ALSEL によるものです。

関連項目

📘 公式リファレンス📦 リファレンス/オブジェクト初級

content_for_header オブジェクト

Shopify が必要とするスクリプト(分析・チェックアウト・言語設定など)をすべて動的に出力するオブジェクト。theme.liquid の <head> タグ内に埋め込む必須要素。

📁 theme-liquid-docs·MIT·20
📘 公式リファレンス📦 リファレンス/オブジェクト中級

metaobjects オブジェクト

ストア全体のメタオブジェクト定義にアクセスするグローバルオブジェクト。個別のメタオブジェクトはタイプとハンドルで参照でき、メタオブジェクト定義のエントリをループで反復処理できる。

📁 theme-liquid-docs·MIT·20
📘 公式リファレンス📦 リファレンス/オブジェクト初級

additional_checkout_buttons オブジェクト

PayPal Express Checkout など、オフサイト決済に対応した外部決済プロバイダーがストアに設定されているかを真偽値で返す。`content_for_additional_checkout_buttons` と組み合わせて、該当するチェックアウトボタンを条件付きで表示する。

📁 theme-liquid-docs·MIT·27
📘 公式リファレンス📦 リファレンス/オブジェクト初級

canonical_url オブジェクト

現在のページの正規 URL を取得するオブジェクト。Google などの検索エンジンに対してどのページ版が正規であるかを指定するために使用する。

📁 theme-liquid-docs·MIT·27
📘 公式リファレンス📦 リファレンス/オブジェクト初級

content_for_index オブジェクト

ホームページに表示するセクションの内容を動的に返すオブジェクト。Liquid インデックステンプレートで必ず使用する。

📁 theme-liquid-docs·MIT·27
📘 公式リファレンス📦 リファレンス/オブジェクト初級

content_for_additional_checkout_buttons オブジェクト

PayPal、Apple Pay、Google Pay など複数の決済プロバイダが有効になっているとき、その決済ボタンを HTML として出力するオブジェクト。`additional_checkout_buttons` で有無を判定したうえで、このオブジェクトで実際のボタンを表示する。

📁 theme-liquid-docs·MIT·27