I have content entries in a channel called resources.
Resources primary categories are whitepapers and downloads.
Secondarily, the entries are categorized by "brand"
What I want to do is grab the current category id (e.g. downloads) but then display the entries grouped by "brand"
This is my code.
{exp:channel:category_heading channel="resources"}
{!--grab main category we're viewing. E.g. we're viewing "downloads" in the "resources" channel--}
<?php $category = '{category_id}'; ?>
{/exp:channel:category_heading}
{!-- loop through the brands --}
{exp:channel:categories category_group="2" show_empty="no"}
<h2 style="float:left; clear:both; width:100%;">{category_name}</h2>
{!-- now display entries from this main category (e.g. downloads) that are also categorized under the current brands --}
{exp:channel:entries category="<?php echo $category; ?> & {category_id}" channel="resources" disable="member_data|pagination|trackbacks"}
<a href="{pdf}">{title}</a><br>
{/exp:channel:entries}
{/exp:channel:categories}
Where it says $category and category_id, only recognizing the latter. I can accurately print the $category to screen in the loop but the category= filter doesn't recognize it.
Thoughts?