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.

Status Parameter include vs exclude

September 10, 2010 1:24pm

Subscribe [2]
  • #1 / Sep 10, 2010 1:24pm

    AJP

    311 posts

    Hey Gang.

    I’ve had some recent discussions on twitter and wanted to get some clarification on usage of the status parameter.
    Please correct me if I’m wrong.
    Most of this discussion relates to the channel:entries tag, but may carry over to other tags. Please advise as needed.

    For this case, my status group as the statuses of: open, closed, draft, and featured.

    Inclusion:
    1. Status defaults to “open”.
    2. Setting a single status using the status parameter (status=“featured”) will only show entries of that specified status. It will now not include entries of a “open” status.
    3. Setting the status to multiple pipe separated statuses (status=“open|featured”) will show entries of those two statuses.

    Exclusion:
    4. Setting an exclude status (status=“not closed”) will now show all entries EXCEPT those with status of “closed”. It will show “open”,“draft”, and “featured”.
    5. Setting the status to “not” multiple pipe separated statuses (status=“not open|closed|featured”) will show all entries except those specified. It will show only those of status=“closed” in this case.

    Inclusion AND Exclusion:
    A note was brought up about using both at the same time.
    Is it possible to have a status parameter set to something like: status=“featured|not open”?
    This is depending on the answers to the previous questions. If it only includes what you specify and does not include “open” by default, then this is answered.

    Thanks!

  • #2 / Sep 10, 2010 5:46pm

    Brandon Jones

    5500 posts

    Hi AJP,

    You are correct all the way up to combining inclusion and exclusion, which is not supported. Specifying anything for the status parameter will override the default status=“open” and only show the status you specified.

    Does that help?

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

ExpressionEngine News!

#eecms, #events, #releases