Skip to main content
1 of 2
Matt Ellis
  • 361
  • 1
  • 9

Perhaps not the most elegant solution, but this works:

{% set queryTags = craft.request.getQuery('tags') %}

{% for tag in craft.tags.relatedTo(resourceTags) %}
   <a href="{% if tags == "" %}/learning/resources?tags={{ tag.title|kebab }}{% else %}/learning/resources?tags={{ tags|replace(' ', '+') }}+{{ tag.title|kebab }}{% endif %}" class="btn btn-default{% if tag.title|kebab in queryTags %} disabled{% endif %}">{{ tag.title }}</a>
{% endfor %}

Adding disabled rather than active.

Matt Ellis
  • 361
  • 1
  • 9