Liquid Snippets by ALSEL
📘 公式リファレンス🔧 リファレンス/フィルター初級

collection_img_url フィルター(コレクション画像の CDN URL を取得)

コレクションに設定された画像の Shopify CDN 上の URL を取得するフィルター。指定したサイズの画像 URL を返す。

用途
コレクションページやコレクション一覧で、コレクションの画像を異なるサイズで表示したいときに使う。
設置場所
Liquid テンプレート内で `{{ collection.image | collection_img_url }}` または `{{ collection.image | collection_img_url: 'large' }}` の形で使用する。
注意点
このフィルターは廃止予定であり、今後のテーマ開発では `image_url` フィルターへの置き換えが必須。デフォルトサイズは small(100 x 100 px)で、large など他のサイズを指定する場合はパラメータで明示する。
タグ:collectionimagecdndeprecated

仕様

50 行 / json
{
  "category": "media",
  "deprecated": true,
  "deprecation_reason": "The `collection_img_url` filter has been replaced by [`image_url`](/docs/api/liquid/filters/image_url).",
  "description": "",
  "parameters": [
    {
      "description": "The desired image size.",
      "name": "size",
      "positional": true,
      "required": false,
      "types": [
        "string"
      ]
    }
  ],
  "return_type": [
    {
      "type": "string",
      "name": "",
      "description": "",
      "array_value": ""
    }
  ],
  "examples": [
    {
      "name": "",
      "description": "",
      "syntax": "",
      "path": "/collections/sale-potions",
      "raw_liquid": "{{ collection.image | collection_img_url }}",
      "parameter": false,
      "display_type": "text",
      "show_data_tab": true
    },
    {
      "name": "The size parameter",
      "description": "By default, the `collection_img_url` filter returns the `small` version of the image (100 x 100 px). However, you can specify a [size](/docs/api/liquid/filters/img_url#img_url-size).\n",
      "syntax": "image | collection_img_url: string",
      "path": "/collections/sale-potions",
      "raw_liquid": "{{ collection.image | collection_img_url: 'large' }}",
      "parameter": true,
      "display_type": "text",
      "show_data_tab": true
    }
  ],
  "summary": "Returns the [CDN URL](/themes/best-practices/performance/platform#shopify-cdn) for a [collection's image](/docs/api/liquid/objects/collection#collection-image).",
  "syntax": "variable | collection_img_url",
  "name": "collection_img_url"
}

出典・ライセンス

License:
MIT

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

関連項目

📘 公式リファレンス🔧 リファレンス/フィルター初級

avatar フィルター(顧客アバター画像HTML生成)

顧客アバターが存在する場合、それを表示する HTML タグを生成するフィルター。customer オブジェクトに対して使用する。

📁 theme-liquid-docs·MIT·19
📘 公式リファレンス🔧 リファレンス/フィルター初級

default_errors フィルター(フォーム送信エラーを日本語化)

form.errors の各エラーコードに対応する既定のエラーメッセージを自動生成するフィルター。フォーム送信時の入力値不正や必須項目空白などのエラーを言語別に出力する。

📁 theme-liquid-docs·MIT·19
📘 公式リファレンス🔧 リファレンス/フィルター初級

date フィルター(日付を指定形式でフォーマット)

日付値を指定されたフォーマット文字列に従って整形する。フォーマット文字列が空の場合は元の値がそのまま返される。入力が日付に変換できない場合も元の値が返される。

📁 theme-liquid-docs·MIT·19
📘 公式リファレンス🔧 リファレンス/フィルター初級

payment_terms フィルター(Shop Pay分割払いバナーを生成)

product フォームまたは cart フォームに対して使用し、Shop Pay の分割払いオプションを表示するための HTML を生成するフィルター。顧客が購入時に分割払いプランを選択できるようにする。

📁 theme-liquid-docs·MIT·19
📘 公式リファレンス🔧 リファレンス/フィルター初級

abs フィルター(数値の絶対値を取得)

負の数を正の数に変換する。数値の絶対値(ゼロからの距離)を返すフィルター。

📁 theme-liquid-docs·MIT·30
📘 公式リファレンス🔧 リファレンス/フィルター初級

append フィルター(文字列の末尾に追加)

文字列の末尾に別の文字列を連結するフィルター。URL パスの結合やテキストの接尾辞追加に使う。

📁 theme-liquid-docs·MIT·30