MoeDesigns.com

Affordable web solutions for the masses...

Client Sites

Member Login



Who's Online

We have 11 guests online
Home
How to convert a joomla 1.0.x template to joomla 1.5
I recently upgraded a site from Joomla 1.0.13 to Joomla 1.5. There is very little involved and it was extremely easy to figure out but from what I have seen all you need to do is change a few small things and it should work. First off, you need to remember that the Joomla 1.5 framework is different than the 1.0.x framework, so functions like "mosLoadModules()" and "mosCountModules()" will not work in 1.5. However, there are functions in 1.5 that perform the exact same tasks. Here are a few examples of the old function names with their new counterparts:

mosLoadModule(position) = <jdoc:include type="modules" name="position" />

Example:

Old:
<?php mosLoadModule(user5) ?>
New: <jdoc:include type="modules" name="user5" />


mosCountModules(position) = $this->countModules(position)

Example:


Old: <?php if ( mosCountModules ('banner') ) { ?>
New: <?php if ( $this->countModules('banner') ) : ?>


And here is a complete example that checks to see if a module is published in the banner position for the current page. If there is a module there then a div will be created and the module shown.

Old:
<?php if ( mosCountModules ('banner') ) { ?>
<div style="text-align: right; width:90%; height: 70px;">
<?php mosLoadModules( 'banner', -2 ); ?>
</div>
<?php } ?>


New:
<?php if ($this->countModules('banner') > 0) : ?>
<div style="text-align: right; width:90%; height: 70px;">
<jdoc:include type="modules" name="position" />
</div>
<?php endif; ?>




So, once you have gone through your Joomla 1.0.x template and changed all the old functions to the new ones you can now change the header text of the template to include the new Joomla 1.5 information.


Step 1: open up your browser and go to the administrative side of your Joomla 1.0.x site. Go to the Template Manager and edit the HTML of your template. Copy all the code "ctrl+A or right click->select all" then "ctrl+c or right click->copy" and paste it into a newpad file. Save the file as a backup.

Step 2: This is very important because if you have a heavily modified template you need to know what you are doing. You need to start at the top of the file and replace everything down to </head> with this code:

<?php

defined('_JEXEC') or die('Restricted access');

$url = clone(JURI::getInstance());
?>
<?php echo '<?xml version="1.0" encoding="utf-8"?'.'>'; ?>
<!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>






Once you have done this save your template and test it out! The only part you may need to change is to be sure your template css files is located at /templates/your_template/css/template.css

Enjoy!