I ran in to 2 problems with conditionals, the first issue i’ve not yet solved, the second issue is solved but still would like a reasoning behind it so i can understand conditionals a little better.
Problem 1:
A not equal to comparison operator combined with OR doesn’t seem to work (the same works with the equal to “==” comparison operator).
I’m trying the following code, but it doesn’t work, and I can’t find a reason why it shouldn’t work:
{if segment_2 != "url-1" OR segment_2 != "url-2"}
Do not show this content if segment_2 is either url-1 or url-2
{/if}Taking it apart like this does work, but I prefer them combined to keep it simple:
{if segment_2 != "url-1"}
Do not show this content if segment_2 is url-1
{/if}
{if segment_2 != "url-2"}
Do not show this content if segment_2 is url-2
{/if}
Problem 2:
This one is ‘solved’ but i can’t understand why the first one doesn’t work, is that a parse order issue, there isn’t any info on this on the Conditional Global Variables Docs page.
Why doesn’t this work:
{if segment_3 == "{url_title}"} CONTENT {/if}But this does:
{if "{url_title}" == segment_3} CONTENT {/if}