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.

Hide Entries

January 20, 2011 11:22pm

Subscribe [5]
  • #16 / Jan 27, 2011 12:35pm

    Lisa Wess

    20502 posts

    Hi, Chris,

    The template parser works through your templates in a set order, and different types of tags/conditionals are parsed in different orders.  That sounds confusing, but it becomes more habitual as you use ExpressionEngine. 

    Just as a note, using {if:else} makes it an advance conditionals.  This means that the items inside the conditionals will run THEN the conditionals run.  This can end up being somewhat hefty for processing.

    If you do this instead:

    {if logged_in}
      {exp:channel:entries channel="letters" dynamic="yes" status="no_reply|Open|Draft" disable="pagination|categories|member_data" limit="1"}
    ...Everything in-between…
     {/exp:channel:entries}
    {/if}
    
    {if logged_out}
        {exp:channel:entries channel="letters" dynamic="yes" status="no_reply|Open" disable="pagination|categories|member_data" limit="1"}
    ...Everything in-between…
     {/exp:channel:entries}
    {/if}
    {/if}

    Then the conditionals will run first, and only one set of entries tags will run.

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

ExpressionEngine News!

#eecms, #events, #releases