This should be simple - Hide Specific Tags

Theme: Supply

Need: Hide specific Tags from my storefront.

What I think: My guess is that I should be editing the Advanced-Tag-Loop.Liquid but nothing I try has worked.

Tried So Far: I have tried this with no luck: https://community.shopify.com/c/shopify-design/exclude-advanced-tags/td-p/436708

Here is my Advanced-Tag-Loop.Liquid and any help would be MUCH appreciated!

{% comment %}
A loop to catch and filter out the different tag categories.
This is mainly for advanced tagging, but will also help us strip
out any tag categories from our tags (E.g. remove BRAND_ from BRAND_tag)
{% endcomment %}
{% if request.page_type == ‘collection’ and collection.all_tags.size > 0 %}
{% assign categories = ‘’ %}
{% for tag in collection.all_tags %}
{% if tag contains ‘’ %}
{% capture categories %}{% unless categories == blank %}{{ categories }}|{% endunless %}{{ tag | split: '
’ | first }}{% endcapture %}
{% endif %}
{% endfor %}
{% assign cat_array = categories | split: ‘|’ | uniq %}
{% endif %}

Hi @goodrecordstogo ,

For hide specific tag from storefront you need to add following code:

First you need to change on this file: SALES CHANNELS > Online Store > Themes > Actions > Edit code > Snippets > collection-sidebar.liquid

{% for tag in collection.all_tags %}
  {% assign is_advanced_tag = false %}
  {% assign cat = tag | split: '_' | first %}
  {% unless cat == 'hide' %}
    {% if cat_array contains cat %}
      {% assign is_advanced_tag = true %}
      {% if current_tags contains tag %}
        - {{ tag | remove_first: cat | remove_first: '_' }}

      {% else %}
        - {{ tag | remove_first: cat | remove_first: '_' | link_to_tag: tag }}

      {% endif %}
    {% endif %}
  {% endunless %}

  {% if is_advanced_tag == false %}
    {% assign new_cat = tag | split: '_' | first %}
    {% unless new_cat == 'hide' %}
      {% if current_tags contains tag %}
        - {{ tag }}

      {% else %}
        - {{ tag | link_to_tag: tag }}

      {% endif %}
    {% endunless %}
  {% endif %}
{% endfor %}

Which tag you need to hide from storefront you need to add this specific tag in this format : hide_(tag name)

![image-20220524-104544.png|362x215](upload://wlY85yAIs7HWuvfZx170kPNCPE1.png)

Thank you

1 Like

Awesome, thank you… let me get my tags updated and then I will try this. thank you for taking the time.