Reputation: 1566
I need to add a class to a specific link in a link list. The link i need to target will always be the word 'shop'. I tried applying the following to the <a>
link within my link list but it doesn't seem to be working..
<a href="{{ link.url }}" class="{% if link.title contains 'shop' %}site-nav-shop {% endif %}site-nav__link">{{ link.title }}</a>
Any ideas how I can get this to work!?
Thanks in advance.
Upvotes: 0
Views: 1338
Reputation: 11682
I tested your code and got it working in my test site. A couple of things to check:
<a>...</a>
.Upvotes: 1