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 not custom field data

March 30, 2010 4:49pm

Subscribe [2]
  • #1 / Mar 30, 2010 4:49pm

    hannastone

    8 posts

    Hi all,

    I have some custom fields in my template (some are image fields and url fields) but sometimes when I create a new post I don’t have say a URL to add or an image so is there way in EE that if a custom field is left blank that a “not available” bit of text shows up when people view my site? At the moment it’s just left blank.

    Thanks in advance 😊

    Hanna

  • #2 / Mar 30, 2010 4:54pm

    Ingmar

    29245 posts

    Sure, a simple conditional can do that:

    {if foo != ""}{foo}{if:else}Sorry, no foo for you!{/if}
  • #3 / Mar 30, 2010 5:03pm

    hannastone

    8 posts

    wow, I have to say EE has the best support forum ever!! Thank you Ingmar!

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

ExpressionEngine News!

#eecms, #events, #releases