La fonction de suggestion automatique permet d'affiner rapidement votre recherche en suggérant des correspondances possibles au fur et à mesure de la frappe.
Add an HTML title if a topic contains a certain word (Blog)
Résolue
I would like to add a title of "Featured Products" if a post contains a topic OR topics that begin with the word "Product." Because some posts have more than one topics containing the word "Product" the title appears that many times. Below is a visual representation of what is happening.
Featured Products
Featured Products
Product One Title
Product one description. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Product Two Title
Product two description. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
This is the Hubl I used. Using the filters |first or |unique do not work.
{% for topic in content.topic_list %}
{% if topic.name is string_startingwith "Product" %}
{% set string_var = '<h6 class="pb-3">Featured Products' %}
{{ string_var|first }}
{% endif %}
{% endfor %}