Skip to content

Instantly share code, notes, and snippets.

@mirshko
Created November 10, 2016 16:17
Show Gist options
  • Save mirshko/6592ef28934438116ce0d5128d53d54f to your computer and use it in GitHub Desktop.
Save mirshko/6592ef28934438116ce0d5128d53d54f to your computer and use it in GitHub Desktop.
Trying to use `request.path` to add in a class if the URL matches a variable
{% for item in my_topics %}
{% set blog_topic_url = "/blog/topic/{{item.slug}}" %}
<li class="{% if request.path == 'blog_topic_url' %}v-active {% endif %} v-tab col s2"><a href="{{ group.absolute_url }}/topic/{{item.slug}}">{{ item }}</a></li>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment