We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Parent Category Name

Development and Programming

j00lz's avatar
j00lz
4 posts
13 years ago
j00lz's avatar j00lz

What’s the easiest way to get the parent category name?

{parent_id} is a available but how to get the name?

The way I’ve structured the site is that the only accessible categories are the 3rd depth in the hierarchy, no entries are categorized in the parents….

{exp:channel:category_heading}
<h1>{parent_id}</h1> {!-- I want this to be the name not a number! --}
<h2>{category_name}<h2>
    {if category_description}
        {category_description}
    {/if}
{/exp:channel:category_heading}

parent_id

Also is there a way to implement a system whereby by selecting one of the parent categories, (which have no entries assigned) entries from all the child categories are displayed ?

Thanks in advance,

j00lz

       
j00lz's avatar
j00lz
4 posts
13 years ago
j00lz's avatar j00lz

Nearly a week and no replies :(

Here’s a solution using category_parents addon

{exp:channel:category_heading channel="blog" relaxed_categories="yes"}
 {exp:category_parents:parent category="{parent_id}"}
  {cat_description}
 {/exp:category_parents:parent}
     {category_name}
{/exp:channel:category_heading}

Now, I’ve got a list of categories and I’d like to highlight the current categories parent.

Usually you’d go about matching the URL segment with the category list but I’m not sure how to do this for the parent category.

Also still can’t figure a way to allow selecting a parent category to show all child channel entries.

Any help on these would be much appreciated.

Cheers,

Julian

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.