Knowledge Base

Tags within Advanced Conditionals

When using ExpressionEngine tags within Advanced Conditionals, the entire tag block must be contained within the conditional.  You cannot use Advanced Conditionals to specify different opening tags, with shared markup for the rest of the tag block.

Right:

{if segment_3 == "foo"}
    {exp
:weblog:entries weblog="default_site"}
        
<h2>{title}</h2>
    
{/exp:weblog:entries}
{if
:else}
    {exp
:weblog:entries weblog="another_weblog" category="not 6|7"}
        
<h2>{title</h2>
    
{/exp:weblog:entries}
{
/if}

Wrong:

{if segment_3 == "foo"}
    {exp
:weblog:entries weblog="default_site"}
{if
:else}
    {exp
:weblog:entries weblog="another_weblog" category="not 6|7"}
{
/if}
        
<h2>{title}</h2>
    
{/exp:weblog:entries}

 

Last Updated on Jan 13, 2009 at 15:15   ( Permalink )
Category: Templates, Other