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.

Categories

September 01, 2011 7:01am

Subscribe [2]
  • #1 / Sep 01, 2011 7:01am

    Hi.

    Is it possible to have more than 1 list of categories on a page.

    I am using this code to display my list.

    {exp:channel:categories channel="gallery" class="categories"}
    
    <a href="http://{path=gallery/show}">{category_name}</a>
    
    {/exp:channel:categories}

    When I create another category group and assign it to ‘gallery’ it displays both in one list.

    How can I separate them please?

    Thank you

  • #2 / Sep 01, 2011 7:06am

    Dave @ Exp:resso

    465 posts

    Yep instead of specifying a channel, just use the parameter category_group=“4” where 4 is the id of your category group. Then you can copy this to display a separate list for another category group. You can find the full documentation here - http://ellislab.com/expressionengine/user-guide/modules/channel/categories.html

  • #3 / Sep 01, 2011 8:58am

    Thanks Dave. I cant work out what I am doing wrong. It isnt displaying any menu now.

    I have checked and its the right ID.

    Heres what I have in my code:

    {exp:channel:categories category_group="6" class="categories"}
    
    <a href="http://{path=gallery/show}">{category_name}</a>
    
    {/exp:channel:categories}
  • #4 / Sep 01, 2011 9:27am

    Dave @ Exp:resso

    465 posts

    Try specifying the channel as well, let me know how it goes

  • #5 / Sep 01, 2011 9:38am

    Perfect thank you!!

    I know this is slightly off topic, but you seem to know everything to do with EE!!

    I have been looking at conditionals, and I must be doing something wrong.

    Can you see anything wrong with this code?

    {exp:comment:entries channel="gallery"}
    
    <li>
    {comment}
    <span class="comment_name"><a href="http://{url}">{name}</a></span> - <span class="comment_date">{comment_date format="%d %F, %Y"}</span>
    
    {if comment_total == 0}
    
    No one has posted yet!
    
    {/if}
    
    </li>
    
    {/exp:comment:entries}

    Thank you!

  • #6 / Sep 01, 2011 9:49am

    Dave @ Exp:resso

    465 posts

    Seems like you’re getting confused between the channel entries tag and the comment entries tag. The comment_total var is only available within the channel entries tag.

    You should be using {if no_results} to conditionally display a no results message 😊

    Does that help?

  • #7 / Sep 01, 2011 9:52am

    I am getting confused with everything I think 😛

    Thats worked a treat!

    Thank you 😊

  • #8 / Sep 01, 2011 9:55am

    Dave @ Exp:resso

    465 posts

    Good to hear! Just post again if you have any more q’s. Dont worry, I was far more confused than you 2 years ago!

  • #9 / Sep 01, 2011 4:15pm

    Lisa Wess

    20502 posts

    Dave again saves the day, thank you sir!

    Chris have you checked out the resources on our community page to help with learning EE?  You might find some of those to be valuable.

    And of course, if you do have other questions, please start a new thread and let us know.  Thanks!

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

ExpressionEngine News!

#eecms, #events, #releases