ShopifyやEコマースに関連することを話してみよう
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>
解決済! ベストソリューションを見る。
成功
@FABEA 様
記載いただいたコードを開発ストアで試してみたのですが、
質問者様と同じ状況が再現できず、
ブログ記事一覧でもトップページでも、
きちんと対応した記事内容が表示されました。
差し支えなければ、
プライベートメッセージでやりとりさせていただいて、
コラボレーターアクセスなど頂戴できれば、
何か分かるかもしれません。
ご検討ください。
(キュー田辺)
成功
@FABEA 様
記載いただいたコードを開発ストアで試してみたのですが、
質問者様と同じ状況が再現できず、
ブログ記事一覧でもトップページでも、
きちんと対応した記事内容が表示されました。
差し支えなければ、
プライベートメッセージでやりとりさせていただいて、
コラボレーターアクセスなど頂戴できれば、
何か分かるかもしれません。
ご検討ください。
(キュー田辺)
キュー田辺様
ご返信ありがとうございます。
記載しましたコードをお試しいただいたとのことでありがとうございます。
メッセージでやりとりさせていただきたいのですが、
どのよう三田連絡差し上げればよろしいでしょうか。
お忙しいところ恐れ入りますが、宜しくお願い致します。。
FABEA 三田
@FABEA 様
私たちのアイコン(Qと記載されたアイコン)をクリックいただくと、
下図のような画面が開くはずです。
「メッセージを送信する」からメッセージをいただけるとプライベートメッセージになります。
(キュー田辺)
いつもShopifyをご利用いただき、ありがとうございます。 Shopifyは、皆様の日本語での利用体験の向上に努めております。さらなる改善のために皆様のご意見をお寄せい...
By JasonH May 9, 2025Shopify アカデミーの学習パスと認定スキルバッジExpanding Your Shopify Business Internationallyを活用して、国際的にビジネ...
By Shopify Feb 7, 2025Shopify アカデミーの学習パスB2B on Shopify:立ち上げとカスタマイズで卸売販売に進出しましょう。これら3つの無料コースは、ShopifyストアでB2B機能...
By Shopify Jan 31, 2025