[英]insert reblogged articles in the right place in blog.articles array ordered by created_at
[英]How to Filter all Blog.Articles by containing specific tag in Shopify?
你好,有沒有shopify專家在那里。 我唯一的目標是根據標簽過濾或顯示所有文章。
所以這就是我到目前為止從這個論壇所擁有的
{% assign counter = 0 %}
{% for article in blogs['lookbook'].articles %}
{% if article.tags contains 'Fox Racing' and counter < 2 %}
{% assign counter = counter | plus: 1 %}
<div class="njohn_search_otherpage">
<a href="{{ article.url }}" title="{{ article.title | escape }}">
<div>{{ article.image.src | img_url: 'medium' | img_tag: article.title }}</div>
<div>{{ article.title }}</div>
</a>
</div>
{% endif %}
{% endfor %}
代碼正在運行,但只會顯示四篇文章。 但在那個示例標簽中,我已經有 10 篇文章了。
上面的代碼有一個計數器來限制顯示的文章,刪除該計數器按預期工作,通過標簽過濾所有文章。
{% for article in blogs['lookbook'].articles %}
{% if article.tags contains 'Fox Racing' %}
<div class="njohn_search_otherpage"> <a href="{{ article.url }}" title="{{ article.title | escape }}"> <div>{{ article.image.src | img_url: 'medium' | img_tag: article.title }}</div> <div>{{ article.title }}</div> </a> </div>
{% endif %}
{% endfor %}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.