Skip to content

Instantly share code, notes, and snippets.

@niallthompson
Created July 8, 2015 19:26
Show Gist options
  • Save niallthompson/511ad9a22678b395bbb2 to your computer and use it in GitHub Desktop.
Save niallthompson/511ad9a22678b395bbb2 to your computer and use it in GitHub Desktop.
Reel Categories
<div class="reels">
{% set allCategories = craft.categories.group('videos') %}
{% set displayCategories = '' %}
{% for video in entry.directorVideos %}
{% for cats in video.videoCategory %}
{% set displayCategories = displayCategories ~ cats %}
{% endfor %}
{% endfor %}
<p>
{% for cat in allCategories %}
{% if cat in displayCategories %}
{% if cat.slug != categorySelected %}
<a href="{{ siteUrl }}directors/{{ entry.slug }}/{{ cat.slug }}" class="is-uppercase">Go to {{ cat }} reel</a><br>
{% endif %}
{% endif %}
{% endfor %}
</p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment