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.

Show selected category

September 18, 2010 2:47pm

Subscribe [3]
  • #1 / Sep 18, 2010 2:47pm

    James Hurst

    48 posts

    I’m sure this is going to be a ‘ahh’ moment - but after alot of digging - I can’t seem to find a simple way of displaying the selected category of an item; only lots of ways of displaying all the possible categories for a particular weblog…

    i.e when looking at a detail page (and actually in a list view) i’d like to be able to display only the categories that an entry has been assigned.

    James

  • #2 / Sep 19, 2010 4:56pm

    Brandon Jones

    5500 posts

    Hi James,

    The weblog entries categories tag pair should do just that.

    If not, please show us a stripped down template that isn’t working and let us know what version and build you’re using.

  • #3 / Sep 20, 2010 5:17am

    James Hurst

    48 posts

    Hi Brandon -

    Thanks for the link - although unless i’m missing something super obvious - i’m not sure that does answer the question -

    The code I have is:

    {exp:weblog:categories weblog="shop_detail" style="linear" show_empty="off" dynamic="off" category_group="5" backspace="1"}
                                <a href="http://{path=shop}">{category_name}</a> |
                            {/exp:weblog:categories}

    Which outputs all of the available category items within category group 5 - while I would like to only see the categories that the item has been assigned too…

    Many thanks for your help and let me know how blind i’m being!

    All the best
    James

  • #4 / Sep 20, 2010 4:23pm

    Ingmar

    29245 posts

    I looks as though your are confusing {exp:weblog:categories} with the {categories}{/categories} tag pair of {exp:weblog:entries}. Try this:

    {exp:weblog:entries ...}
       {categories}{category_name}{/categories}
    {/exp:weblog:entries}

    Makes sense?

  • #5 / Sep 21, 2010 4:54am

    James Hurst

    48 posts

    Ingmar, thank you so much - you were absolutely right - and its working a treat now - thank you so much -

    All the best
    James

  • #6 / Sep 21, 2010 3:45pm

    Ingmar

    29245 posts

    My pleasure. It certainly is easy to mix those two up, so no worries 😉 Post again as needed, please.

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

ExpressionEngine News!

#eecms, #events, #releases