I have a listing with entries that have wither parent selected and some with parent and children categories selected. In my list of entries (like a business Directory) I have state as parents and cities as children. I want to display the state and then the city in each entry.
The entries are all grouped by parent category first.
So like this:
STATE CATEGORY A HEADING - entry title, State City - entry title, State City - entry title, State City
STATE CATEGORY B HEADING - entry title, State City - entry title, State City - entry title, State City
But My code is outputting the following (no child categories, instead the parent is displayed twice)
STATE CATEGORY A HEADING - entry title, State State - entry title, State State - entry title, State State
STATE CATEGORY B HEADING - entry title, State State - entry title, State State - entry title, State State
{exp:channel:categories channel="database" parent_only="no" style="linear" show_empty="no" dynamic="off"}
<h1>{category_name}</h1>
{exp:channel:entries orderby="title" sort="asc" channel="database" category="{category_id}"}
<h3>{title}</h3>
<h5>{categories} <a href="http://{path=site/business_directory}">{category_name}</a> {/categories}</h5>
{/exp:channel:entries}
{/exp:channel:categories}
this was my solution {exp:gwcode_categories entry_id="{entry_id}” style=”linear” backspace=”0” depth=”1|2”}{cat_name} {/exp:gwcode_categories}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.