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

user オブジェクト

ブログ記事の著者情報を表すオブジェクト。著者の名前、メールアドレス、プロフィール画像、自己紹介文などを取得できる。

用途
ブログ記事ページで著者プロフィールをサイドバーやフッターに表示するとき。複数著者がいる場合、各記事の執筆者情報を出し分ける場面で使う。
設置場所
templates/article.liquid 内で `{{ article.user.name }}` や `{{ article.user.email }}` のように参照して、著者の属性にアクセスする。
注意点
user オブジェクトは article オブジェクトの下階層に存在するため、単独での参照はできず必ず `article.user` 経由でアクセスする必要がある。bio、homepage、image は未設定時に nil を返すため、表示前に `if article.user.bio` のように存在確認する。account_owner は Shopify 管理画面のアカウントオーナー判定なので、複数スタッフ運用時は著者の権限区別に役立つ。
タグ:articleauthorbloguserprofile

仕様

154 行 / json
{
  "access": {
    "global": false,
    "parents": [
      {
        "object": "article",
        "property": "user"
      }
    ],
    "template": []
  },
  "deprecated": false,
  "deprecation_reason": "",
  "description": "> Tip:\n> The information returned by the `user` object can be edited on the [**Account** page](https://www.shopify.com/admin/settings/account)\n> of the Shopify admin.",
  "properties": [
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "boolean",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "Returns `true` if the author is the account owner of the store. Returns `false` if not.",
      "name": "account_owner"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "If no bio is specified, then `nil` is returned.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The bio associated with the author's account.",
      "name": "bio"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The email associated with the author's account.",
      "name": "email"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The first name associated with the author's account.",
      "name": "first_name"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "If no personal website is specified, then `nil` is returned.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The URL for the personal website associated with the author's account.",
      "name": "homepage"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "If no image is specified, then `nil` is returned.",
      "examples": [],
      "return_type": [
        {
          "type": "image",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The image associated with the author's account.",
      "name": "image"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The last name associated with the author's account.",
      "name": "last_name"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The first and last name associated with the author's account.",
      "name": "name"
    }
  ],
  "summary": "The author of a blog article.",
  "name": "user",
  "examples": [],
  "json_data": {
    "path": "/blogs/potion-notions/how-to-tell-if-you-have-run-out-of-invisibility-potion",
    "handle": "article.user",
    "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