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.

Showing Unctagorized Entries

June 16, 2011 10:54pm

Subscribe [1]
  • #1 / Jun 16, 2011 10:54pm

    blendimc

    150 posts

    Sorry if I’ve missed something simple, but is there a way to show entries that are not categorized without using a hard coded category=“not id1|id2|etc” parameter? I would like the client to be able to add categories, but also allow any entries not categorized to show up in a misc section. I can always just add a misc category, but I wanted to see if this was doable.

  • #2 / Jun 22, 2011 4:37pm

    Rob Allen

    3114 posts

    Depending how you have thinsg set up you could use the category_group parameter to include or exclude a whole group of categories.

    This would list all entries not in category group ID2

    {exp:channel:entries channel="mychannel" category_group="not 2"}
    Uncategorised entries
    {/exp:channel:entries}

    This would list list all entries that have been assigned a category from group ID2

    {exp:channel:entries channel="mychannel" category_group="2"}
    Categorised entries
    {/exp:channel:entries}

    You could run a conditional in your listings template to test whether a category is being called, eg

    {if segment_2 != "category"}
    
      {exp:channel:entries channel="mychannel" category_group="not 2"}
      Uncategorised entries
      {/exp:channel:entries}
    
    {/if}
    
    {if segment_2 == "category"}
    
      {exp:channel:entries channel="mychannel" category_group="2"}
      Categorised entries
      {/exp:channel:entries}
    
    {/if}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases