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.

How to: If no content in Div, then don't produce Div

April 09, 2011 1:55pm

Subscribe [2]
  • #1 / Apr 09, 2011 1:55pm

    talbina

    20 posts

    I have a Div that is part of an entry channel:

    <div class="seconddiv">
                                                
    {sourcedate2}   
    
    {if sourcedate2 !=""}
    {/if}                     
                        
    <h2><a href="http://{headlineurl2}name={entry_id}&gt&lta">{headline2}</a></a></h2><p>                            </p>
    
    <p>{if summarytext2 !=""}—{/if}{summarytext2} <br />
                               <br />
    </div>

    Right now if there is no content in the fields, the Div still renders with a line, which is basically a box with no height.

  • #2 / Apr 09, 2011 2:01pm

    talbina

    20 posts

    I resolved this, please close.

  • #3 / Apr 11, 2011 3:10am

    John Henry Donovan

    12339 posts

    Closing as requested

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

ExpressionEngine News!

#eecms, #events, #releases