This is among a commonly asked question that “How to insert Youtube video” or “How to add embed tag” or “How to add object tag” in virtuemart product description.

The solution is very simple. You just need to update an array $tagBlacklist. As its name is self explanatory and which means “Black Listed Tags”. So you just need to remove embed and object tag from blacklist.

Virtuemart 1.5

1. Navigate to
administrator/components/com_virtuemart/classes/phpInputFilter/class.inputfilter.php

2. Search the code

var $tagBlacklist = array('applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml');

3. Replace it with

var $tagBlacklist = array('applet', 'body', 'bgsound', 'base', 'basefont', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'script', 'style', 'title', 'xml');

Virtuemart 2.0 +

1. Navigate to
\libraries\joomla\filter\input.php

2. Search for “$tagBlacklist” and remove the black listed tag assigned to $tagBlacklist

That’s all, go ahead and try to place an youtube video, .swf, .flv or any other flash files using embed and object tags in virtuemart product description.

Related posts:

avatar

Author: 


  • http://bostonluxuryapartments.org Boston luxury apartments

    I was suggested this web site by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my problem. You’re wonderful! Thanks!

    • raisa

      I already changed the imput code, but I am not able to insert video in products description of virtuemart. I had done many things. But I haven´t achived it.

      • http://www.tips4developer.com/ Amit Verma

        I guess there is something wrong and you are missing any step , also if you can let me know the joomla version…. so that i can help you out on this

        Thanks

  • kevin

    I have installed VM 2.0.2 and there has no “classes” folder at administrator/components/com_virtuemart/.

    So can I get amend the code to show insert youtube at product page?

    • http://www.tips4developer.com Amit

      Hi Kevin

      on VM2 you can locate the file “\libraries\joomla\filter\input.php” go to line # 64 or just search for $tagBlacklist = array and remove “embed” and “object”.

  • Sydney

    Do you know how to do this in Virtuemart 2?

    • http://www.tips4developer.com Amit

      Hi Syndey

      on VM2 you can locate the file “\libraries\joomla\filter\input.php” go to line # 64 or just search for $tagBlacklist = array and remove “embed” and “object”.

  • Sfinx

    Nice tutorial, but I still have a problem. I can add video in product description, but I not in custom filed. I added custom field “editor”, added my video code… Do you have any other idea what can I do? VM version 2.0.22c, joomla 2.5

    • http://www.tips4developer.com/ Amit Verma

      Hi

      To add videos in either you can use JCE editor or can go for many available plugins to add video through joomla editor like – JW all videos.