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 -%}
{%- if show_date -%}
{{ article.published_at | time_tag: format: 'date' }}
{%- endif -%}
{%- if show_tags -%}
{{ article.tags }}
{%- endif -%}
###
{{ article.title | truncate: 50 | escape }}
{%- endif -%}
Section/セクション:featured-blog-slim.liquid
{%- unless section.settings.heading == blank -%}
## {{ section.settings.heading | escape }}
{%- if section.settings.blog != blank and section.settings.show_view_all and section.settings.post_limit < section.settings.blog.articles_count -%}
{{ 'sections.featured_blog.view_all' | t }}
{%- endif -%}
{%- endunless -%}
{%- if section.settings.blog != blank and section.settings.blog.articles_count > 0 -%}
{%- for article in section.settings.blog.articles limit: section.settings.post_limit -%}
- {% render 'article-slimlist',
article: article,
show_date: section.settings.show_date,
show_tags: section.settings.show_tags
%}
{%- endfor -%}
{%- if section.settings.show_view_all and section.settings.post_limit < section.settings.blog.articles_count -%}
{{ 'sections.featured_blog.view_all' | t }}
{%- endif -%}
{%- else -%}
- 投稿日
現在、お知らせはございません。
{%- endif -%}
