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.

Exclude latest month entries

September 27, 2012 5:17pm

Subscribe [1]
  • #1 / Sep 27, 2012 5:17pm

    EmilyLimeRed

    44 posts

    So you know how you can set it to only display entries from the latest month using

    {exp:channel:entries channel="journal" dynamic="off" display_by="month" limit="1"}

    is it possible to then exclude that month’s entries from another regular channel entries call?

    I have it set up so that the current (latest) month’s entries appear in a box at the top, and then I want it to be that all the rest appear below in a separate box, but currently it’s showing the latest month’s entries in both locations. Is it possible to exclude the latest month’s entries from the second box?

  • #2 / Sep 28, 2012 3:00pm

    Dan Decker

    7338 posts

    Hi EmilyLimeRed,

    You would need a way to exclude the entry IDs from your second tag pair.

    Using something like Stash would let you store the entry_id in a variable and then use the “not” modifier on the second entries tag pair.

    {exp:channel:entries channel="journal" dynamic="off" display_by="month" limit="1"}
      {exp:stash:set name="exclude"}{entry_id}{/exp:stash:set}
    {/exp:channel:entries}
    
    Then
    
    {exp:channel:entries channel="journal" entry_id="not {exp:stash:get name="entry_id"}"}
      ...
    {/exp:channel:entries}

    Let me know what you think!

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases