I need to display content based on category or result from a custom query (query module).
For example, when category_id = 5, no ads must be show on the page. But the problem is: the banner is outside of the channel:entries scope.
So i came up with a custom query:
{exp:query sql="SELECT entry_id FROM exp_category_posts WHERE entry_id='{entry_id}' AND cat_id = 5 LIMIT 1"}
{if entry_id}
{assign_variable:showads="false"}
{if:else}
{assign_variable:showads="true"}
{/if}
{/exp:query}And below:
{if showads!="false"}
show ads
{/if}But it doesn’t work/parse the var…any other solutions?
TIA.