Skip to content

Category: Coding

Programming and scripting topics.

How to insert YouTube video in the VirtueMart product description?

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

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

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

How to add a Module Class Suffix to a module which doesn’t have one.

If a Joomla module that you have installed for some reason doesn’t have a Module Class Suffix, but you need it to style the module display just open the module folder and find the xml file mod_modulename.xml and add this line into the params tag:

<params>
<param name=”moduleclass_sfx” type=”text” default=”” label=”Module Class Suffix” description=”PARAMMODULECLASSSUFFIX” />
</params>

This should work.

How To Display Big Image In VirtueMart Product Details Page?

First open

www.yoursite.com\components\com_virtuemart\themes\default\templates\product_details\flypage.tpl.php

find the line:

<?php echo $product_image ?>

and change it with this one:

<a href=”<?php echo $mosConfig_live_site; ?>/components/com_virtuemart/shop_image/product/<?php echo $product_full_image; ?>” target=”_blank”>

<img src= ” <?php echo $mosConfig_live_site; ?>/components/com_virtuemart/shop_image/product/<?php echo $product_full_image; ?>” class=”fullvmimage” >

</a>

then style the class=”fullvmimage” somewhere in the css files

How to redirect your-site.com to www.your-site.com

Enter this code in your .htaccess file after the

RewriteEngine On line:

RewriteCond %{HTTP_HOST} ^your-site\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?blablabla\.bg[NC]
RewriteRule (.*) http://www.your-site.com/$1 [L,R=301]

Redirect 301 /home http://www.your-site.com/

How to create a 404 redirect page in Joomla

Copy the error.php file from your-site/templates/system to your template main directory.

Then just open the error.php file from your Joomla template and edit it.

If you want to redirect to a sitemap on your site  for example use this code at the top of the error.php file before everything in the file write:

<?php

defined( '_JEXEC' ) or die( 'Restricted access' );
if (($this->error->code) == '404') {
header('Location: http://www.yoursite.com/sitemap');
exit;
}

?>