• 当ページには広告が含まれています

Horizonテーマのsections/_blocks.liquidに関して:メモ

窓辺

後日忘れて再調査しそうなので調べたことをメモとして。

前提

  • ShopifyのHorizonテーマのsectionsディレクトリ内に_blocks.liquidが存在する
  • テーマエディタのセクション一覧で探しても_blocks.liquidに該当するセクションは見つからない

回答

Wrapper Section
Generated blocks aren’t sections themselves. Therefore Shopify wraps these generated blocks in a platform-generated section by default such as when merchants choose to use
Sidekick
to generate a block in a new section.

Shopify automatically wraps the generated block in a wrapper section called _blocks.liquid. You can override and customize this wrapper section by adding your own _blocks.liquid section to your theme.

Note
The _blocks.liquid section isn’t a standard theme section. It can’t be manually rendered, meaning you can’t include it with {% section ‘_blocks’ %}, and it won’t show up in the theme editor for merchants to add to pages.

簡単に言えば、アプリ生成ブロックのラッパーとなるファイルであり、通常のセクション用ファイルではないためテーマエディタでこのセクション自体を目にすることはない模様です。

なお、_blocks.liquidがなくともラッパーが生成されますが、_blocks.liquidがあるとラッパーに関して独自のセクション共通設定を追加できます。

結び

ファイルだけ見ても用途が把握できませんでしたが、ドキュメントの内容を見れば必要性含めて理解しやすくなったと思います。

0人がこの記事を評価

役に立ったよという方は上の「記事を評価する」ボタンをクリックしてもらえると嬉しいです。

連投防止のためにCookie使用。SNSへの投稿など他サービスとの連動は一切ありません。

コメント欄


このサイトは reCAPTCHA によって保護されており、Google のプライバシーポリシー および 利用規約 に適用されます。

reCaptcha の認証期間が終了しました。ページを再読み込みしてください。