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
3 weeks 5 days ago - 3 weeks 2 days 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: 3 weeks 2 days ago by Fotis. Reason: Resolved

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
3 weeks 2 days ago #176857 by Fotis
Providing some context on what this change involved would also perhaps help others...

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum