FROM CACHE - jp_header
このコミュニティはピアツーピアサポートに移行しました。Shopify サポートは今後、このコミュニティへのサービスを提供いたしません。これからもぜひ、他のマーチャントやパートナーとつながり、サポートし合い、経験を共有してください。 当社の行動規範に違反する行動や削除を希望するコンテンツがありましたら、引き続きご報告ください

The shared snippet for blog display doesn't work by top-page / ブログ表示の共有スニペットがトップページからだと動きません

解決済

The shared snippet for blog display doesn't work by top-page / ブログ表示の共有スニペットがトップページからだと動きません

FABEA
観光客
13 0 1

I have created a snippet for displaying a list of blogs.

The snippet works fine for displaying a list of blogs, but when I include it using the "render" tag in a blog article on the top-page, it doesn't work correctly.

While the list of blogs is displayed, when selecting any article, the same article content is shown.

If anyone knows what might be causing this issue, I would greatly appreciate your assistance.

 

(Japanese) ブログ一覧表示の為のスニペットを作成しました。

ブログの一覧表示では正常に動いていますが、トップページのブログ記事でrenderに記載すると正常に動きません。

一覧表示はできるのですが、どの記事を選択しても同じ記事が表示されていまします。

何か問題があるかお分かりになる方がいましたら教えていただければ幸いです。

 

Snippet/スニペット:article-slimlist.liquid

 

{%- if article and article != empty -%}

  <div class="col2list_text">
    {%- if show_date -%}
      <p class="col2list_heading">
        {{ article.published_at | time_tag: format: 'date' }}
      </p>
    {%- endif -%}

    {%- if show_tags -%}
      <span class="col2list_tags">{{ article.tags }}</span>
    {%- endif -%}

    <h3 class="card__heading">
      <a href="{{ article.url }}" class="full-unstyled-link">
        {{ article.title | truncate: 50 | escape }}
      </a>
    </h3>
  </div>

{%- endif -%}

 

 

 Section/セクション:featured-blog-slim.liquid

 

<div class="blog color-{{ section.settings.color_scheme }} gradient{% if section.settings.heading == blank %} no-heading{% endif %}">
  <div class="page-width section-{{ section.id }}-padding">
    {%- unless section.settings.heading == blank -%}
      <div class="title-wrapper-with-link title-wrapper--no-top-margin">
        <h2 id="SectionHeading-{{ section.id }}" class="blog__title {{ section.settings.heading_size }}">{{ section.settings.heading | escape }}</h2>

        {%- if section.settings.blog != blank and section.settings.show_view_all and section.settings.post_limit < section.settings.blog.articles_count -%}
          <a href="{{ section.settings.blog.url }}"
            class="link underlined-link large-up-hide"
          >
            {{ 'sections.featured_blog.view_all' | t }}
          </a>
        {%- endif -%}
      </div>
    {%- endunless -%}
    {%- if section.settings.blog != blank and section.settings.blog.articles_count > 0 -%}
      <ul class="list-style-none">
        {%- for article in section.settings.blog.articles limit: section.settings.post_limit -%}
          <li class="col2list articles">
            {% render 'article-slimlist',
              article: article,
              show_date: section.settings.show_date,
              show_tags: section.settings.show_tags 
            %}
          </li>
        {%- endfor -%}
      </ul>

      {%- if section.settings.show_view_all and section.settings.post_limit < section.settings.blog.articles_count -%}
        <div class="blog__view-all center small-hide medium-hide">
          <a href="{{ section.settings.blog.url }}" id="ViewAll-{{ section.id }}" class="blog__button button" aria-labelledby="ViewAll-{{ section.id }} SectionHeading-{{ section.id }}">
            {{ 'sections.featured_blog.view_all' | t }}
          </a>
        </div>
      {%- endif -%}
    {%- else -%}
      <ul class="list-style-none">
        <li class="col2list articles">
          <p class="col2list_heading">
            投稿日
          </p>
          <div class="col2list_text">
            <p class="col2list_text_excerpt">
              現在、お知らせはございません。
            </p>
          </div>
        </li>
      </ul>
    {%- endif -%}
  </div>
</div>

 

 

1 件の受理された解決策

Qcoltd
Shopify Partner
1362 533 512

成功

@FABEA 様

 

記載いただいたコードを開発ストアで試してみたのですが、

質問者様と同じ状況が再現できず、

ブログ記事一覧でもトップページでも、

きちんと対応した記事内容が表示されました。

 

差し支えなければ、

プライベートメッセージでやりとりさせていただいて、

コラボレーターアクセスなど頂戴できれば、

何か分かるかもしれません。

 

ご検討ください。

(キュー田辺)

株式会社Q (キュー)
グラフィックデザイン、アパレル事業、Web制作など色々やっている渋谷区代々木の会社です。ShopifyでのECサイトの運営・開発も行なっています。
私たちについて: https://web.q-co.jp/ テックブログ: https://techlab.q-co.jp/

元の投稿で解決策を見る

3件の返信3

Qcoltd
Shopify Partner
1362 533 512

成功

@FABEA 様

 

記載いただいたコードを開発ストアで試してみたのですが、

質問者様と同じ状況が再現できず、

ブログ記事一覧でもトップページでも、

きちんと対応した記事内容が表示されました。

 

差し支えなければ、

プライベートメッセージでやりとりさせていただいて、

コラボレーターアクセスなど頂戴できれば、

何か分かるかもしれません。

 

ご検討ください。

(キュー田辺)

株式会社Q (キュー)
グラフィックデザイン、アパレル事業、Web制作など色々やっている渋谷区代々木の会社です。ShopifyでのECサイトの運営・開発も行なっています。
私たちについて: https://web.q-co.jp/ テックブログ: https://techlab.q-co.jp/
FABEA
観光客
13 0 1

キュー田辺様

 

ご返信ありがとうございます。

記載しましたコードをお試しいただいたとのことでありがとうございます。

 

メッセージでやりとりさせていただきたいのですが、

どのよう三田連絡差し上げればよろしいでしょうか。

 

お忙しいところ恐れ入りますが、宜しくお願い致します。。

FABEA 三田

Qcoltd
Shopify Partner
1362 533 512

@FABEA 様

 

私たちのアイコン(Qと記載されたアイコン)をクリックいただくと、
下図のような画面が開くはずです。

「メッセージを送信する」からメッセージをいただけるとプライベートメッセージになります。

 

screenshot_20230829_01.png

 

(キュー田辺)

株式会社Q (キュー)
グラフィックデザイン、アパレル事業、Web制作など色々やっている渋谷区代々木の会社です。ShopifyでのECサイトの運営・開発も行なっています。
私たちについて: https://web.q-co.jp/ テックブログ: https://techlab.q-co.jp/