How can I refine the returned tag list to only include the tags related to an automated collection?

Highlighted
New Member
2 0 0

When the drop down list are populated by product tags, all of the tags related to items appear in the list rather than strictly the product's tags that are part of the automated collection.

 

I've tried using "Limit: Current_Tags" in the for loop. I also tried using the if statement: " {% if current_tags contains tag %}" within the the for loop.

 

The first has no effect on the tags that appear in the drop down list.

The Second actually prevents the lists from populating.

 

This is the code I am currently using in the site-nav.liquid: 

 

I would have expected that the drop down lists would populate with tags strictly related to the parent collection.

 

{% for tag in collections[child_list_handle].all_tags %}
        <li {% if childlink.active %}class="site-nav--active"{% endif %}>
            <a href="/collections/{{ child_list_handle }}/{{ tag | handleize }}" class="site-nav__link site-nav__child-link{% if forloop.last %} site-nav__link--last{% endif %}">{{ tag | escape }}</a>
        </li>
    {% endfor %}
</ul> 

 

 

0 Likes