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.

Conditional Statement, White space issue

October 23, 2013 6:55am

Subscribe [1]
  • #1 / Oct 23, 2013 6:55am

    Adeeb Khan

    7 posts

    Hi Guys,

    I’m experiencing a really strange problem with white spacing and line breaks. I have a conditional statement which adds a space after the comma if I put the output on a separate line.

    My code is as follows:

    {if tag_count == '1'}
         <h5>Tags:</h5><p> <br />
    {/if}<br />
    <a href="http://{path=articles/by_tag}/tag/{websafe_tag}">{tag}</a><br />
    {if tag_count == tag_total_results}<br />
          <br />
    {if:else},{/if}

     
    The specific culprit are these lines here:

    <a href="http://{path=articles/by_tag}/tag/{websafe_tag}">{tag}</a>
    {if tag_count == tag_total_results}

    However, if put the if statement straight after the closing </a> on a single line all works fine:

    <a href="http://{path=articles/by_tag}/tag/{websafe_tag}">{tag}</a>{if tag_count == tag_total_results}

    I’m running Coda 2 on Mamp using ExpressionEngine 2.6.1. Is this an Apache or ExpressionEngine issue?

    Cheers

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

ExpressionEngine News!

#eecms, #events, #releases