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

page オブジェクト

ストアの固定ページ(aboutページ、お問い合わせページなど)の情報を取得するオブジェクト。ページの ID、タイトル、本文、作成者、メタフィールドなどにアクセスできる。

用途
ページテンプレート(page.liquid)でページの詳細情報を表示したり、コレクションページやホームページから特定のページへリンクを張ったり、ページ関連のメタフィールドデータを活用するシーン。
設置場所
templates/page.liquid または pages に関連するセクション・スニペット内で `{{ page.title }}`、`{{ page.content }}`、`{{ page.metafields }}` のように記述して参照する。
注意点
page オブジェクトは page.liquid テンプレートまたは pages オブジェクト内でのみ参照可能で、商品ページやコレクションページでは利用できない。template_suffix にカスタムテンプレート名が入るため、条件分岐でページレイアウトを切り替えるときに活用する。メタフィールドを使う場合は Shopify 管理画面で事前に定義・入力しておくことが前提。
タグ:pageobjectcontentmetafieldtemplate

仕様

176 行 / json
{
  "access": {
    "global": false,
    "parents": [
      {
        "object": "pages",
        "property": ""
      },
      {
        "object": "metafield",
        "property": "value"
      }
    ],
    "template": [
      "page"
    ]
  },
  "deprecated": false,
  "deprecation_reason": "",
  "description": "",
  "properties": [
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "number",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The ID of the page.",
      "name": "id"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The author of the page.",
      "name": "author"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The [handle](/docs/api/liquid/basics#handles) of the page.",
      "name": "handle"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The title of the page.",
      "name": "title"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "The name doesn't include the `page.` prefix, or the file extension (`.json` or `.liquid`).\n\n If a custom template isn't assigned to the page, then `nil` is returned.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The name of the [custom template](/themes/architecture/templates#alternate-templates) assigned to the page.",
      "name": "template_suffix"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The content of the page.",
      "name": "content"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The relative URL of the page.",
      "name": "url"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "> Tip:\n> To learn about how to create metafields, refer to [Create and manage metafields](/apps/metafields/manage) or visit\n> the [Shopify Help Center](https://help.shopify.com/manual/metafields).",
      "examples": [],
      "return_type": [
        {
          "type": "untyped",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The [metafields](/docs/api/liquid/objects/metafield) applied to the page.",
      "name": "metafields"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "> Tip:\n> Use the [`date` filter](/docs/api/liquid/filters/date) to format the timestamp.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "A timestamp for when the page was published.",
      "name": "published_at"
    }
  ],
  "summary": "A [page](https://help.shopify.com/manual/online-store/themes/theme-structure/pages) on a store.",
  "name": "page",
  "examples": [],
  "json_data": {
    "path": "/pages/about-us",
    "handle": "page",
    "data_from_file": ""
  },
  "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