To add YouTube video in the VirtueMart product description

Posted: March 17, 2011 in E-Commerce, Joomla, VirtueMart
Tags: , ,

There is a filter in VirtueMart, which cuts the object and the embed html tags.

In order to embed YouTube video and other Flash files in your VirtueMart product description area you should remove the object and the embed items from the following array:

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');

The new array will be:

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

The modification should be completed in the administrator/components/com_virtuemart/classes/phpInputFilter/class.inputfilter.php file.

Then you can edit the product description html code and embed the video using similar lines:

<div align="center">
<object width="445" height="364"><param name="movie" value="http://www.youtube.com/VIDEO PATH"></param><param  name="allowFullScreen" value="true"></param><param  name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/VIDEO PATH"  type="application/x-shockwave-flash" allowfullscreen="true"  allowScriptAccess="always" width="445"  height="364"></embed></object>
</div>

You should replace http://www.youtube.com/VIDEO PATH with your video file URL.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s