Keyword

echo video id

  • neppers
  • neppers's Avatar Topic Author
  • Offline
  • Junior Member
More
5 years 6 months ago #169446 by neppers
echo video id was created by neppers
Is it possible to echo the video id with php inside a k2-template?

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

More
5 years 6 months ago #169465 by JoomlaWorks
Replied by JoomlaWorks on topic echo video id
I can't see an easy way really because $this->item->video will always print the rendered output, as it is processed from AllVideos.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • neppers
  • neppers's Avatar Topic Author
  • Offline
  • Junior Member
More
5 years 6 months ago - 5 years 6 months ago #169477 by neppers
Replied by neppers on topic echo video id
This did it for me. Rather than trying to echo the ID in the k2 template, I cleaned the output and made a template-override for the allvideos plugin:
<?php 
$string = $output->player ;
$search = '<iframe src="https://www.youtube.com/embed/' ;
$trimmed = str_replace($search, '', $string) ;

$string = $trimmed ;
$search = '?rel=0&amp;fs=1&amp;wmode=transparent" width="400" height="300" allowfullscreen="true" frameborder="0" scrolling="no" title="JoomlaWorks AllVideos Player"></iframe>' ;
$trimmed = str_replace($search, '', $string) ;


 ?>

<div class="embed-responsive embed-responsive-16by9 mb-2">
<iframe title="Watch video" class="embed-responsive-item" src="https://www.youtube.com/embed/<?php echo $trimmed; ?>?rel=0&modestbranding=1" allowfullscreen></iframe>
</div>
Last edit: 5 years 6 months ago by neppers. Reason: Translated

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

More
5 years 6 months ago #169482 by JoomlaWorks
Replied by JoomlaWorks on topic echo video id
Much better approach :) Kudos!

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum