Hello everyone,
I have a little problem with my algorithm. I’m trying to display specific articles on a specific product. I am displaying these articles based on the tags on the articles and on the products. But, when I run my code, my article title displays 3 times if I have 3 tags on my article corresponding to 3 tags on my product.
Here is my code:
{% for prodTag in product.tags %}
{% for article in blogs.guide-dachat.articles %}
{% if article.tags contains prodTag %}
<a href="{{ article.url }}">{{ article.title }}</a>
{% endif %}
{% endfor %}
{% endfor %}
Thanking you for your advice