I am using the taxonomy add-on, and within the {exp:taxonomy:nav} tag set (documentation here) I am trying to do a conditional, as follows:
{exp:taxonomy:nav tree_id="{embed:taxonomy_root}" depth="10" display_root="no" ul_css_id="mainmenu"}
< a {if node_level != "1"}class="sub"{/if} href="{node_url}">{node_title}</a>
{/exp:taxonomy:nav}I was surprised to find that didn’t work.
What does work is if I change the conditional to use a quoted variable, like so:
{exp:taxonomy:nav tree_id="{embed:taxonomy_root}" depth="10" display_root="no" ul_css_id="mainmenu"}
< a {if "{node_level}" != "1"}class="sub"{/if} href="{node_url}">{node_title}</a>
{/exp:taxonomy:nav}However, the FAQ advises against this syntax.
So, 3 questions:
1) Do conditionals get parsed differently for add-ons than for the channel module?
2) Is there some other way that I could write this to accomplish my desired effect?
2a) Otherwise, is my working code “safe” despite the advice of the FAQ?