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.

If:else statement is freaking out 2.4.0

April 06, 2012 6:47pm

Subscribe [2]
  • #16 / Apr 23, 2012 4:57pm

    Dan Decker

    7338 posts

    Hi tpayton,

    It turns out that the odd results have to do with “phantom” rows for this Matrix straggling in the database. Matrix has 2 extra rows for this field in its table and they are matching the conditionals, therefore, being shown.

    Why they are left behind is a mystery, and why we aren’t able to see them in the Control Panel as well.

    However, once those rows are removed, everything should behave as you expect.

    For the time being, I left a limit on the field to get you the results you are looking for:

    {header_features limit="3"}
           {if link}<li><a href="http://{link}">{label}</a></li>
              {if:elseif page != "--- None ---"} <li><a href="http://{page}">{label}</a></li>
              {if:else}<li>{label}</li>
          {/if}
    
    <li>Page=: {page}</li>
       {/header_features}

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases