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.

order by category then by title

August 09, 2011 4:21pm

Subscribe [3]
  • #1 / Aug 09, 2011 4:21pm

    Eastwood Design

    605 posts

    Is it possible to have a channel with 5 categories and have all the entries listed in order first by categories and then in each category listed by title?

    ie:
    Cat 1 title 1
    Cat 1 title 2
    Cat 1 title 3

    Cat 2 title 1
    Cat 2 title 2
    Cat 2 title 3

    Cat 3 title 1
    Cat 3 title 2
    Cat 3 title 3

    etc.

    Moved to Community Help forum by Moderator

  • #2 / Aug 10, 2011 10:11am

    Sue Crocker

    26054 posts

    If you mean something like this, then yes

    http://eehowto.com/index.php/howto-2010/categories

    {exp:channel:category_archive channel="howto" show_empty="no"}
    
    {categories}<h3>{category_name}</h3>
    <p>Number of entries: {exp:catcount cat_id="{category_id}" status="open|closed"}<br />
    {/categories}</p>
    
    <p>{entry_titles}<a href="http://{path=howto/articles}">{title}</a>{/entry_titles}</p>
    
    <p>{/exp:channel:category_archive}

    NOTE: I’m using a small plugin to count the number of entries.

    Does that help?
    Ordinarily this would be considered a howto or a Community Help forum question, but I had the code on hand to show you.

  • #3 / Aug 10, 2011 10:20am

    Eastwood Design

    605 posts

    that may work.  Let me test it out and see.

  • #4 / Aug 11, 2011 2:02pm

    Sue Crocker

    26054 posts

    Since this is more of a how do I kind of question, I’m going to move it to the Community Help forum for additional community support. I do know it works, though. 😊

  • #5 / Sep 16, 2011 9:10am

    Eastwood Design

    605 posts

    If you mean something like this, then yes

    http://eehowto.com/index.php/howto-2010/categories

    {exp:channel:category_archive channel="howto" show_empty="no"}
    
    {categories}<h3>{category_name}</h3>
    <p>Number of entries: {exp:catcount cat_id="{category_id}" status="open|closed"}<br />
    {/categories}</p>
    
    <p>{entry_titles}<a href="http://{path=howto/articles}">{title}</a>{/entry_titles}</p>
    
    <p>{/exp:channel:category_archive}

    NOTE: I’m using a small plugin to count the number of entries.

    Does that help?
    Ordinarily this would be considered a howto or a Community Help forum question, but I had the code on hand to show you.

    What if I wanted to include more than just the entry titles in the list?

    something more like:

    CATEGORY 1 NAME
    title 1 customfield 1
    title 2 customfield 2
    title 3 customfield 3

    CATEGORY 2 NAME
    title 1 customfield 1
    title 2 customfield 2
    title 3 customfield 3

    CATEGORY 3 NAME
    title 1 customfield 1
    title 2 customfield 2
    title 3 customfield 3

  • #6 / Sep 29, 2011 11:39am

    Jonathan Morgan

    51 posts

    CATEGORY 1 NAME
    title 1 customfield 1
    title 2 customfield 2
    title 3 customfield 3

    CATEGORY 2 NAME
    title 1 customfield 1
    title 2 customfield 2
    title 3 customfield 3

    CATEGORY 3 NAME
    title 1 customfield 1
    title 2 customfield 2
    title 3 customfield 3

    I’m trying to achieve the same thing - have you figured it out yet?

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

ExpressionEngine News!

#eecms, #events, #releases