ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Category Heading not working for me

June 23, 2013 10:07am

Subscribe [2]
  • #1 / Jun 23, 2013 10:07am

    Terence Hall

    15 posts

    I’m trying to use category heading to show what category for each item on my index page as well search results belong.

    I’m unable to get it to work for some reason.  The code I’m using is

    {exp:channel:category_heading channel="entertainment"}
      {category_name}
    {/exp:channel:category_heading}

    Am I using it incorrectly or are there additional attributes I need to use?  Can someone provide a sample?

    Thank for your help.

  • #2 / Jun 23, 2013 12:50pm

    Boyink!

    5011 posts

    Category heading is a dynamic tag that will only appear at a category URL. 

    On an index page try the {categories} looping pair for the entries tag.

  • #3 / Jun 23, 2013 7:15pm

    Terence Hall

    15 posts

    Category heading is a dynamic tag that will only appear at a category URL. 

    On an index page try the {categories} looping pair for the entries tag.

    Thanks Boyink.

    I used the following between my channel entries tags

    {categories show="21"}
            {category_name}
    {/categories}

    But still no output.  I’m using 2.5.5.

  • #4 / Jun 23, 2013 7:43pm

    Boyink!

    5011 posts

    Do you have categories disabled in the entries tag?

  • #5 / Jun 23, 2013 10:28pm

    Terence Hall

    15 posts

    Do you have categories disabled in the entries tag?

    No…categories have not been disabled.  I’ve also tested on other pages and still nothing.

  • #6 / Jun 23, 2013 10:42pm

    Boyink!

    5011 posts

    If you take off the show parameter what happens ?

    As long as you have entries that are assigned to categories and aren’t disabling them or doing anything else tricky it should work. If not post your whole template and tell me what kind of URL it’s being loaded at.

  • #7 / Jun 25, 2013 1:56pm

    Terence Hall

    15 posts

    If you take off the show parameter what happens ?

    As long as you have entries that are assigned to categories and aren’t disabling them or doing anything else tricky it should work. If not post your whole template and tell me what kind of URL it’s being loaded at.

    I will post the template this evening.

    In case I’m going about this in the wrong way, I’ve attached an image. To the right of each thumbnail, there are categories (new books, image gallery, shutterbug).  This is what I’m trying to achieve on my index page and my search results.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases