Squarespace のページ設定でサムネイル画像を取得する JSON テンプレート ステートメントをいくつか作成しました。本来どおりに機能しますが、ブログ リスト、ブログ アイテム、および通常のページから取得する 3 つのセクションがあります。
現在、サイトにアクセスすると、コードは 3 つすべてを実行します。ステートメントを挿入したいのですが{or}
、そのように構成され、正しく機能します。
私をつまずかせているのは、a{.section}
や a{.main-image?}
などがあるため、これら 3 つのコード セクションを 1 つにまとめて{.section mainImage}
配置する場所がわからないことです。{or}
どうすればこれを行うことができますか?
<!--Displays Thumbnail image from first blog post in the blog list-->
{.section items.0}
{.main-image?}
<div class="color-overlay"></div>
<figure class="content-fill main-image"><img {@|image-meta}></figure>
{.end}
{.end}
<!--Displays Thumbnail image blog post-->
{.section item}
{.main-image?}
<div class="color-overlay"></div>
<figure class="content-fill main-image"><img {@|image-meta}></figure>
{.end}
{.end}
<!--Displays Thumbnail image in a Page-->
{.section collection}
{.section mainImage}
<div class="color-overlay"></div>
<figure class="content-fill main-image"><img {@|image-meta}></figure>
{.end}
{.end}
私をつまずかせているのは、a{.section}
や a{.main-image?}
などがあるため、これら 3 つのコード セクションを 1 つにまとめて{.section mainImage}
配置する場所がわからないことです。{or}