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.

else if statements

May 09, 2008 1:27am

Subscribe [2]
  • #1 / May 09, 2008 1:27am

    project_digital

    37 posts

    When I use

    {if no_results}
    content
    {if:else}
    content
    {/if}

    and view the page, it’s completely white. When I take the if statements out, the page shows up again. What am I doing wrong?

  • #2 / May 09, 2008 1:29am

    Lisa Wess

    20502 posts

    if no_results is a predefined variable pair, you can’t use an if:else with it.  That said, you don’t need to, as it’s an automatic.

    So just use:

    {if no_results}
    code
    {/if}
    code

    the second code will execute only if there are results.

  • #3 / May 09, 2008 3:16pm

    matt romaine

    50 posts

    project digital - you can read some more about how it works on this thread

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

ExpressionEngine News!

#eecms, #events, #releases