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.

How to limit Categories displayed

September 21, 2012 8:08am

Subscribe [1]
  • #1 / Sep 21, 2012 8:08am

    Scott Harrington

    85 posts

    Hi, please would somebody be able to help me with limiting the display of categories from my markup below:

    Basically there are two category groups assigned to this one channel (item & brand) and I wish for the category details from the brand group to output in to the H2 and P tags, however from using the below method EE is outputting two H2s and two Ps using the info from both groups.

    How would I limit to just the details from the brand group (ID2)

    {exp:channel:entries channel="products" category="13" fixed_order="626|494|625" limit="3"}
    {if count == "1"}
    {categories}
    <h2>{category_name}</h2>
    <p><a href="http://{path=">more {category_name}</a><br />
    {/categories}<br />
    {/if}<br />
    {/exp:channel:entries}

    Any help would be greatly appreciated.

    Thanks

  • #2 / Sep 24, 2012 3:16am

    Kevin Smith

    4784 posts

    Hi Scott,

    I’m a bit confused. Is the ID to your category group “brand” 13 or 2? Your post seems to indicate both.

    Could you take a screen shot and show us the output and describe what you expected to see instead? Also, if you looking for a category heading, perhaps this is what you want instead.

  • #3 / Sep 24, 2012 4:26am

    Scott Harrington

    85 posts

    Sorry, looks as though I have made a few typos, shall try and explain further and more clearer.

    Basically I have two category groups assigned to one channel (item & brand, cat ID2 & cat ID3)

    Channel Screenshot

    Product Entry Screenshot

    I wish for the category details, from the brand ID group only, to output in to the H2 and P tags below. However, from using the below method EE is outputting two H2s and two Ps using the info from both category ID groups.

    Output Screenshot

    How would I limit to display just the details from the brand group only (ID3) and bypassing the details from item group (ID2).

    Here is the code - category 13 is the category itself ID, ie the specific brand - ID2 and ID3 are the Group IDs:

    {exp:channel:entries channel="products" category="13" fixed_order="626|494|625" limit="3"}
    {if count == "1"}
    {categories}
    <h2>{category_name}</h2>
    <p><a href="http://{path=">more {category_name}</a><br />
    {/categories}<br />
    {/if}<br />
    {/exp:channel:entries}

    I tried what you suggested but it didnt output anything.

    Any help would be greatly appreciated.

    Thanks

  • #4 / Sep 24, 2012 2:25pm

    Scott Harrington

    85 posts

    Hi, thanks but the guys at 21 Purple messaged me with the solution - was simply adding the parameter limit=“1”.

    Thanks
    Scott

  • #5 / Sep 24, 2012 5:36pm

    Kevin Smith

    4784 posts

    Ah! Well good, I’m glad to see you’ve gotten that cleared up, Scott. Thanks for posting the solution back here.

    Let us know if we can help again!

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

ExpressionEngine News!

#eecms, #events, #releases