Hello, I am working with the Symmetry Theme ‘header.liquid’ file and trying to auto hide navigation links that link to an empty collection. My problem is, when trying to target the inner tiers of the navigation, I end up being able to auto hide only the first tier of the nav. The code example below is what I have written at 3 different points of the ‘header.liquid’ file. The navigation itself is split into 3 tiers each being more specific from the last. An example would be ‘Trading Card Games < Pokemon < Booster Packs’. I am able to hide the entire ‘Trading Card Games’ section if its children collections are empty, but I am not able to hide the ‘Pokemon’ or ‘Booster Packs’ sections individually.
{% unless link.type == ‘collection_link’ and link.object.products_count == 0 %}
{% endunless %}
Any help with this would be much appreciated. I am very new to liquid so if you need more information please ask.