Keyword

Simple 'if elseif else' statement in custom item.php - HELP REQUIRED

  • AIS Web Team
  • AIS Web Team's Avatar Topic Author
  • Offline
  • New Member
More
4 years 11 months ago - 4 years 11 months ago #176842 by AIS Web Team
All sorted:

Working code:
    <?php if(!empty($this->item->extraFields->LeadVideo)): ?>
        <div class="hero-video">
            <div class="embed-responsive embed-responsive-16by9">
                <?php echo $this->item->extraFields->LeadVideo->value;?>
            </div>
        </div>
    
    <?php elseif(!empty($this->item->extraFields->HeaderImageurl)): ?>

    <div class="artist">
        <div class="hero picture" style="background: url(<?php echo $this->item->extraFields->HeaderImageurl->value; ?>)"></div>
    </div> 
    
     <?php else : ?>
    
    <div class="artist">
        <div class="hero picture" style="background: url(<?php echo $this->item->image; ?>)"></div>
    </div> 
    
    <?php endif; ?>
Last edit: 4 years 11 months ago by JoomlaWorks. Reason: Resolved

Please Log in or Create an account to join the conversation.

More
4 years 11 months ago #176857 by JoomlaWorks
Providing some context on what this change involved would also perhaps help others...

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum