Add blog post to collection [SOLVED] page when colletion title contains blog tags

Tansy_OBryant
Tourist
12 0 1

trying to add a blog post to the collections page. But I only want blogs post that have tags that match the colletion title. 

<ul>

{% for article in blogs.news.articles limit: 5 %}

<li><a href="{{ article.url }}">{{ article.title }}</a></li>

{% if collection.title == article.tags %}

{% endif %}

{% endfor %}

</ul>

Solved the problem 

 

 

    <h2>

{% for article in blogs.news.articles limit:3 %}

  {% if article.tags contains collection.title %}

  <a href="{{ article.url }}">{{ article.title }}</a>

  {% endif %}

{% endfor %}

    </h2>

0 Likes
Growthfamily
Shopify Partner
14 0 2

Hello, 

 

Here is a new easy way to add blog post in your collection without having to touch any code: https://apps.shopify.com/blog-articles-in-collection

It's a cheap Shopify app that I have developed to easily solve this kind of problem.

 

It works well on desktop and mobile. We have 4 review 5 stars so far.

2.png1.png

 

I provide free customization if you need more than what is possible through the interface.

 

Regards!
Thibault. 

0 Likes