Can I use a Joomla plugin in a template override?

  • Posts: 29
  • Thank you received: 2
13 years 3 months ago #22460

I've made a custom field to hold a video url for my products. I'd like to add simple line like

{youtube}< ? php echo $this->element->video_url; ? >{/youtube}

into the product show file but Joomla doesn't parse the plugin code since it's not in the content area.
Is there a way to do this?

Last edit: 13 years 3 months ago by BRupholdt.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #22475

Hi,

You should try like that:

<?php echo JHTML::_('content.prepare','{youtube}'.$this->element->video_url.'{/youtube}'); ?>

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

  • Posts: 29
  • Thank you received: 2
13 years 3 months ago #22518

Tried that but it just output the tag. Here's my actual code

< ? php echo JHTML::_('content.prepare','{mbox:http://youtu.be/'.$v.'|640|380|title='.$this->element->product_id.'|vthumb=http://img.youtube.com/vi/'.$v.'/1.jpg}'); ? >

and here's the ouput
{mbox:http://youtu.be/--k0WsFGom0|640|380|title=115|vthumb=http://img.youtube.com/vi/--k0WsFGom0/1.jpg}

It's building the tag perfectly but not parsing it.

(Spaces added to the php tags so it will show in the forum)

Last edit: 13 years 3 months ago by BRupholdt.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #22523

And did you publish the multimedia box plugin ? Looking at the code of the plugin I don't see why that wouldn't work.

Are you able to display it with the same tag code in a joomla article ?

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

  • Posts: 29
  • Thank you received: 2
13 years 3 months ago #22554

Yes. I use the mbox plugin on another page in the site. I build the tag dynamically there as well. I used that pages output to make sure I had the tag right on this one.

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

  • Posts: 29
  • Thank you received: 2
13 years 3 months ago #22556

I tried using rokbox instead of mbox and it works. Not sure why mbox won't parse that way but it has to be something with their plugin. I'll see if I can get a response from yoojoomla on it. Thank you for your help.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum