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 there is content is in this cutom field, then prefix it or suffix it with this HTML

February 26, 2011 9:25pm

Subscribe [3]
  • #1 / Feb 26, 2011 9:25pm

    talbina

    20 posts

    For my site here, notice the empty DIVs with purple border.

    let’s say I want a line break at the end of my textinput line, not before.

    I only want this line break if there is content.

    Notice that the Default Text Formatting for

    Auto 
    

    is for a line break at the end of the content.

    I also want to add other HTML if there is content in that custom field. For example, if my textarea has content, it should start with this:

    If it doesn’t have content, then I don’t want it there.

  • #2 / Feb 27, 2011 12:04pm

    Boyink!

    5011 posts

    The usual approach to this is:

    {if custom_field !=""}—{/if}{custom_field}
  • #3 / Feb 27, 2011 5:06pm

    talbina

    20 posts

    Thank you very much.

  • #4 / Feb 28, 2011 7:52am

    Sue Crocker

    26054 posts

    Thanks for the assist, Mike.

    talbina, sounds like you’re all set.. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases