Last active
August 29, 2015 13:56
-
-
Save rruhlen/8867844 to your computer and use it in GitHub Desktop.
how to ignore and detect a topic when looping through the topic array. Also included is an if/else statement which allows you to do both in the for loop and style each HTML it spits out differently.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if topics_count > 0 %} | |
{% for topic in topics %} | |
{% if topic.article_count > 0 %} | |
{% unless topic.id == 393291 %} | |
HTML goes here | |
{% endunless %} | |
{%endif%} | |
{% endfor %} | |
{%endif%} | |
{% if topics_count > 0 %} | |
{% for topic in topics %} | |
{% if topic.article_count > 0 %} | |
{% if topic.id == 393291 %} | |
HTML goes here | |
{% elsif topic.id == 456188 %} | |
HTML goes here | |
{% else %} | |
HTML goes here | |
{% endif %} | |
{%endif%} | |
{% endfor %} | |
{%endif%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment