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.

Is there an if statement limit?

October 27, 2010 4:42pm

Subscribe [1]
  • #1 / Oct 27, 2010 4:42pm

    clearbytes

    4 posts

    Having trouble with a simple if statement.  It works for 7 if statements in a row… but if I add an 8th it ends up producing an empty entry.

    {if product-image1 !=""}Do something{/if}
    {if product-image2 !=""}Do something{/if}
    {if product-image3 !=""}Do something{/if}
    {if product-image4 !=""}Do something{/if}
    {if product-image5 !=""}Do something{/if}
    {if product-image6 !=""}Do something{/if}
    {if product-image7 !=""}Do something{/if}
    {if product-image8 !=""}Do something{/if}

    Is there a limit to if statements?  Do you know of another way of of doing this?

    Thanks

    Simon

  • #2 / Oct 28, 2010 4:27pm

    Ingmar

    29245 posts

    What version and build of EE are you using? There should be no hard limit here. That said, what are you trying to achieve? There might be a more efficient approach.

  • #3 / Oct 29, 2010 4:01am

    clearbytes

    4 posts

    Using version 1.7

    I’m trying to say:

    If custom field is not empty output that custom field.

    I need to do this 10 times in a row (Image thumbnails).

    Thanks

    Simon

  • #4 / Oct 29, 2010 12:04pm

    Ingmar

    29245 posts

    Yes that should definitely work. Can you show us a little more of your code? Are you using any extensions?

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

ExpressionEngine News!

#eecms, #events, #releases