0

Im working on a project where there are two divs next too each other (not worried about the styling for now) but my question is the following.

div 1 | div 2

if there's no channels fields in div 2 hide the div and make div 100%. i tried adding the if statements before the div and also tried the if results == statement, nothing changed.

Anyone who has experienced this issue and solved it.

2

Assuming 2 fields firstname and lastname...

<div class="{if lastname}half{if:else}full{/if}">
  {firstname}
</div>
{if lastname}
  <div class="half">
    {lastname}
  </div>
{/if}

Or if either field could be missing/empty...

{if firstname}
  <div class="{if lastname}half{if:else}full{/if}">
    {firstname}
  </div>
{/if}
{if lastname}
  <div class="{if firstname}half{if:else}full{/if}">
    {lastname}
  </div>
{/if}
1
  • will definitely try this out peter. – Lloyd_07 Apr 7 '16 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.