I have a portfolio that has different categories, and some of those portfolio items have multiple categories. I am having trouble getting it to export classes based on what categories it has. If a portfolio has one category assigned to it, it works fine. If it has two or more, it breaks and doesn’t do anything.
Here is my code:
{exp:channel:entries channel="portfolio" orderby="title" sort="asc" category_group="1" disable="member_data"}
<li class="all{if {categories}{category_id}{/categories} == '6'} branding{/if}{if {categories}{category_id}{/categories} == '1'} print{/if}{if {categories}{category_id}{/categories} == '2'} web{/if}" data-id="id-{entry_id}">
<div class="portfolio_item">
<a href="http://{url_title_path=portfolio/detail}">_ {thumb}_ <h4>{title}</h4><p>_ </a><br />
</div><br />
<div class="portfolio_shadow"></div><br />
</li><br />
<br />
{/exp:channel:entries}