I am hoping someone can help me figure out how to use conditionals based on the category and category group an entry belongs to.
Basically I have a channel called Advertisements and each entry is categorized by the topic (in one group) and by the type of advertisement (in a second group).
Example:
Ad Categories: automotive, clothing, communications, etc.
Ad Types: print, online, television, etc.
I’m assuming the code would look something like this:
{exp:channel:entries channel="Advertisements" limit="10" {if segment_2}category_id="{segment_2}"{/if}}
{if category_id == "31"} {!-- which is the id for "television" in ad types --}
Code for displaying videos
{if:else}
Code for displaying images
{/if}
{/exp:channel:entries}Obviously my conditional (as written) doesn’t work. I’m not trying to limit the query to video files, but rather display the right html to display videos IF the entry belongs to the “television” category.