I’m looking for the best way to display products by category.
They look like this.
Stringed
—guitars
—violins
—basses
Wind
—flutes
—saxophones
Percussion
—drums
—bongos
—symbols
On the main products page, I want to list the categories entries by “parent only”
Stringed
Wind
Percussion
The problem I’m having is, even when if the parent category isn’t ticked, my channel tag pair still displays the children. (I have auto category turned off)
Here’s my code. I want to include only the parent cat’s content with out using not”“.
Any suggestions?
{exp:channel:entries channel="instruments" limit="9" paginate="bottom" disable="member_data|category_fields" status="open|featured" relaxed_categories="yes" show="40|23|55|20|49|27|33"}
{if no_results}
No Results
{/if}
{if count == "1"}
<h3 class="tag">Instruments</h3>
<div class="post post-page archive">
{/if}
<div class="span3">
<div class="icons-box box"> {if instruments_image != ""}
<div class="inst-img"><a href="http://{path=instruments/details}/{url_title}"> {instruments_image}</a></div>
{/if}
<div class="archive-title">
<h2><a href="http://{path=instruments/details}/{url_title}">{title}</a> </h2>
<p> </div><br />
{exp:word_limit total="2"}{instruments_body}{/exp:word_limit} <br />
<div class="clear"></div><br />
</div><br />
</div><br />
{switch='||<br />
<div class="clearfix"></div><br />
<hr><br />
'}</p>
<p><br />
{paginate}<br />
<div class="clearfix"></div><br />
Page {current_page} of {total_pages} pages {pagination_links}<br />
{/paginate}</p>
<p> {/exp:channel:entries}