EE2 question. How do I identify the categories of a calendar entry (or potentially any entry)?
Specifically, I’m displaying a monthly calendar, and I want to both limit my display of entries to certain categories as well as class entries by category.
At this point I have this mess:
{if entries}
<td class='{switch}' align='center' width="14%" >
<a href="http://{day_path=/calendar/calendar_detail}">{day_number}</a>
{entries}
{exp:channel:categories channel="Calendar" category_group="1" show="1|13|12|9|4|24" style="linear"}
<div class="cal_{category_id}"><a href="http://{title_permalink=/calendar/calendar_detail}">{title}</a></div>
{/exp:channel:categories}
{/entries}
</td>
{/if}Which does in fact limit the entries by category and class them, but 1) this seems like an awful lot of looping, and 2) this repeats each entry multiple times. I’m sure there’s a better way…
Thanks!