Skip to content

KAV Design Blog Posts

How to convert joomla 1.0 templates to 1.5 template

Open index.php of you remplate:

1. Check the top of your index.php file, it should be changed like this one or just use this code:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”<?php echo $this->language; ?>” lang=”<?php echo $this->language; ?>” dir=”<?php echo $this->direction; ?>” >

<head>
<jdoc:include type=”head” />
<link rel=”stylesheet” href=”<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css” type=”text/css” />
</head>

2. Replace all php codes relating to modules.
This is an example of an old code <?php mosLoadModules ( ‘header’, -3 ); ?>
Replace with this <jdoc:include type=”modules” name=”header” style=”xhtml” />

3. Replace the mainbody code from <?php mosMainBody(); ?> to <jdoc:include type=”component” style=”xhtml” />

4. Rename the template_css.css file in your /css folder to template.css

5. If there is stuff like this one on yout code:

<?php if (mosCountModules(‘user1’)) : ?>

Chenge ot to look like this: <?php if($this->countModules(‘user1’)) : ?>

6. Check if there are anouther external files like footer.php for example. If there are just open and remove some source code starting with MOS

This should be it 🙂

How to add additional field for an image in Joomla VirtueMart Manufacturer page?

Steps:

1. Open phpMyAdmin and add the additional field to the jos_vm_manufacturer:

ALTER TABLE `jos_vm_manufacturer` ADD `mf_image` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `mf_desc`

2. Open manufacturer.manufacturer_form.php and add additional row for the new field:

<tr>
<td width="22%" align="right"  valign="top"><br/><br/>Image:</td>
<td width="78%" ><br/><br/><?php
editorArea( 'editor2', $db->f("mf_image"), 'mf_image', '300', '150', '70', '25' )
?></td>
</tr>

3. Open ps_manufacturer.php and add the new field to the add and update functions the same way like the field mf_desc is added (just copy the line and add a new row after but for mf_image)

4. Open shop.manufacturer_page.php and do the same like in the previous step also don’t forget to add mf_image in the select statement for the database

5. If needed add the new field in the shop.manufacturer.tpl.php

6. Open shop.browse.php and add:

$browsepage_lbltext = $db->f("mf_image");
$tpl->set( 'browsepage_lblimage', $browsepage_lblimage );

After:

$browsepage_lbltext = $db->f("mf_desc");
$tpl->set( 'browsepage_lbltext', $browsepage_lbltext );

Also here don’t forget to add the mf_image into the select statement above.

7. Then edit the browse_header_manufacturer.tpl.php add a field like $browsepage_lbltext but for the image

This is it…

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.