Keyword

What is php condition for if k2 related item has any video or not?

  • Dayyal Dg.
  • Dayyal Dg.'s Avatar Topic Author
  • Offline
  • New Member
More
1 week 5 days ago #173494 by Dayyal Dg.
Dayyal Dg. created the topic: What is php condition for if k2 related item has any video or not?
Hello, I want to show a PLAY ICON on K2 related items having any video. Here are the current codes:

<?php if($this->item->params->get('itemRelatedMedia')): ?>

<<==== PHP CONDITION FOR IF THIS K2 RELATED ITEM HAS ANY VIDEO OR NOT, IF YES, THEN SHOW THE BELOW PLAY ICON ======>>
<span class="card-related-media t"><img src=" www.bioscience.com.pk/templates/bspk/images/system/video-play.svg "></span>



<?php endif; ?>

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 week 5 days ago #173501 by Fotis
Fotis replied the topic: What is php condition for if k2 related item has any video or not?
Use this:
<?php if($this->item->params->get('itemRelatedMedia') && !empty($item->video)): ?>
/* your code goes here */
<?php endif; ?>

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.

  • Dayyal Dg.
  • Dayyal Dg.'s Avatar Topic Author
  • Offline
  • New Member
More
1 week 5 days ago #173514 by Dayyal Dg.
Dayyal Dg. replied the topic: What is php condition for if k2 related item has any video or not?
Thank you so much, Fotis.

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 week 4 days ago #173518 by Fotis
Fotis replied the topic: What is php condition for if k2 related item has any video or not?
You're welcome.

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