Missing A (anchor) tag inside for..in loop

Hi All,

I’ve got a weird problem - I’m creating a simple for…in loop in a page section that lists out product variants. However, the A tag isn’t being output (it’s not in page source either). When I put the variant title in the LI element without the A tag, it appears, but I just can’t work out why the A tag isn’t rendering. This is my code:


{% if block.settings.product.variants %}
                            
        {% for variant in block.settings.product.variants %}
            - {{ variant.title }}
        {% endfor %}
    

{% endif %}

However, when I change the code to this, I get the list output:


{% if block.settings.product.variants %}
                            
        {% for variant in block.settings.product.variants %}
            - {{ variant.title }}
        {% endfor %}
    

{% endif %}

I thought it might be something to do with the class or the data attributes, but even when I just have it still doesn’t work.

Any ideas?

Thanks very much in advance,

Adam