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.

Lisitng products by parent category only.

November 11, 2012 7:32pm

Subscribe [2]
  • #1 / Nov 11, 2012 7:32pm

    Mobster

    64 posts

    I’m looking for the best way to display products by category. 

    They look like this.

    Stringed
    —guitars
    —violins
    —basses

    Wind
    —flutes
    —saxophones

    Percussion
    —drums
    —bongos
    —symbols

    On the main products page, I want to list the categories entries by “parent only”

    Stringed
    Wind
    Percussion


    The problem I’m having is, even when if the parent category isn’t ticked, my channel tag pair still displays the children. (I have auto category turned off)

    Here’s my code. I want to include only the parent cat’s content with out using not”“. 

    Any suggestions? 

    {exp:channel:entries channel="instruments" limit="9"  paginate="bottom" disable="member_data|category_fields" status="open|featured" relaxed_categories="yes" show="40|23|55|20|49|27|33"}
       
    
    
         {if no_results}
    No Results
    {/if}
         {if count == "1"}
         <h3 class="tag">Instruments</h3>
         <div class="post post-page archive">
    {/if}
    <div class="span3">
        <div class="icons-box box"> {if instruments_image != ""}
            <div class="inst-img"><a href="http://{path=instruments/details}/{url_title}"> {instruments_image}</a></div>
            {/if}
            <div class="archive-title">
                <h2><a href="http://{path=instruments/details}/{url_title}">{title}</a> </h2>
    <p>        </div><br />
             {exp:word_limit total="2"}{instruments_body}{/exp:word_limit} <br />
            <div class="clear"></div><br />
        </div><br />
    </div><br />
    {switch='||<br />
    <div class="clearfix"></div><br />
    <hr><br />
    '}</p>
    
    <p><br />
        {paginate}<br />
    <div class="clearfix"></div><br />
    Page {current_page} of {total_pages} pages {pagination_links}<br />
    {/paginate}</p>
    
    <p> {/exp:channel:entries}

     

  • #2 / Nov 12, 2012 8:56am

    glenndavisgroup

    436 posts

    Hi Mobster,

    Here is an add-on that you can use to make life easier when it comes to categories:

    http://www.addonbakery.com/docs/expressionengine/categories.html

    I hope that helps.

    Mike

  • #3 / Nov 13, 2012 10:59am

    Shane Eckert

    7174 posts

    Hello Mobster,

    Thank you for posting your question.

    The show= is not a channel entries tag, so that is why you are not getting a limited view.

    You would use show= like so.

    {categories show="4|7"}

    If you want to limit the categories from the channel entries tag you can use categroy= or category_group=.

    Mike’s suggestion is a great one. Categories can get really tricky, Addon Bakery’s Add-On makes it really easy to get where you want.

    I hope this helps!

    Have a great week. Let me know if there is anything else I can help with.

    Cheers,

  • #4 / Nov 13, 2012 2:45pm

    Mobster

    64 posts

    Thanks for the response Shane.

    Yes, that was left over from an attempt to use categories and I changed it back to categroy=.  However, this still doesn’t resolve my issue. 

    I need to display the “parent only” of any given category. 

    For now, I opted to use the categories tag pair with category images and description because it offered more precise category display. 

    I would like to note, I’m not the only person confused by the category setup in EE.  There are multiple plugins and and users with issues pertaining to categories. 

    I would like to make a feature request.  A more robust usage of categories and customizations available in displaying specific category content.  EE seems to be a little limited. 

    Thanks,
    Denny

  • #5 / Nov 15, 2012 3:41pm

    Dan Decker

    7338 posts

    Hi Mobster,

    I just want to make sure you know, not all of ExpressionEngine’s category prowess is in the Channel entries tag.

    There is also the Channel Categories, Category Archive, and Category Heading tags.

    Each of them offers a different functionality you may find helpful.

    ~

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

ExpressionEngine News!

#eecms, #events, #releases