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

paginate オブジェクト

paginate タグで分割したコンテンツのページネーション情報を提供するオブジェクト。現在のページ番号、ページサイズ、全ページ数、前後のページへのリンク情報を含む。

用途
コレクションページや検索結果ページで商品をページごとに分割表示するときに、ページネーションナビゲーション(「前へ」「次へ」「1 2 3...」)を構築するために使用する。
設置場所
paginate タグで囲まれた範囲内で `{{ paginate.current_page }}`、`{{ paginate.pages }}`、`{{ paginate.next.url }}`、`{{ paginate.previous.url }}` などの形で各プロパティを参照する。
注意点
items、current_page、pages、current_offset は最大 25,000 に制限される。page_size は 250 までに制限される。同一ページに複数のページネーション対象がある場合、設定またはメタフィールドから取得する配列に対しては自動的に一意の page_param(例: page_a9e329dc)が付与されて独立動作する。default_pagination フィルターを使うとナビゲーション HTML を自動生成できるため、カスタム実装より優先を検討する。
タグ:paginationobjectcollectionsearchoffset

仕様

165 行 / json
{
  "access": {
    "global": false,
    "parents": [],
    "template": []
  },
  "deprecated": false,
  "deprecation_reason": "",
  "description": "> Tip:\n> Use the [`default_pagination` filter](/docs/api/liquid/filters/default_pagination) to output pagination links.",
  "properties": [
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "Limited to 250.",
      "examples": [],
      "return_type": [
        {
          "type": "number",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The number of items displayed per page.",
      "name": "page_size"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "For example, if you show 5 items per page and are on page 3, then the value of `paginate.current_offset` is 10.\n\nLimited to 24,999 see [Pagination Limits](/themes/best-practices/performance/platform#pagination-limits) for more information.",
      "examples": [],
      "return_type": [
        {
          "type": "number",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The total number of items on pages previous to the current page.",
      "name": "current_offset"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "Limited to 25,000 see [Pagination Limits](/themes/best-practices/performance/platform#pagination-limits) for more information.",
      "examples": [],
      "return_type": [
        {
          "type": "number",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The page number of the current page.",
      "name": "current_page"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "For example, if you paginate a collection of 120 products, then the value of `paginate.items` is 120.\n\nLimited to 25,000 see [Pagination Limits](/themes/best-practices/performance/platform#pagination-limits) for more information.",
      "examples": [],
      "return_type": [
        {
          "type": "number",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The total number of items to be paginated.",
      "name": "items"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "Pagination parts are used to build pagination navigation.",
      "examples": [],
      "return_type": [
        {
          "type": "array",
          "name": "",
          "description": "",
          "array_value": "part"
        }
      ],
      "summary": "The pagination parts.",
      "name": "parts"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "part",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The pagination part to go to the next page.",
      "name": "next"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "part",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The pagination part to go to the previous page.",
      "name": "previous"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "Limited to 25,000 see [Pagination Limits](/themes/best-practices/performance/platform#pagination-limits) for more information.",
      "examples": [],
      "return_type": [
        {
          "type": "number",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The total number of pages.",
      "name": "pages"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "The default value is `page`.\n\nIf you paginate over an array defined in a setting or a metafield list type, then a unique key is appended to page to allow the paginated list to\noperate independently from other lists on the page. For example, a paginated list defined in a setting might use the key\n`page_a9e329dc`.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The URL parameter denoting the pagination.",
      "name": "page_param"
    }
  ],
  "summary": "Information about the pagination inside a set of [`paginate` tags](/docs/api/liquid/tags/paginate).",
  "name": "paginate",
  "examples": [],
  "json_data": {
    "path": "",
    "handle": "",
    "data_from_file": "{\"current_offset\":10,\"current_page\":3,\"items\":17,\"next\":{},\"page_param\":\"page\",\"page_size\":5,\"pages\":4,\"parts\":[],\"previous\":{}}"
  },
  "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