(1 vote, average 5.00 out of 5)

Are your Joomla 1.0 templates useless for your Joomla 1.5 websites?

As the Joomla!TM core team moves support from the 1.0 platform over to 1.5 you may be asking yourself if all of the work making and customizing your Joomla! 1.0 templates has gone to waste. The answer is... “No”.

Converting to Joomla 1.5 is a thoughtful process, but it only requires a few edits to the way your components and modules are called. Before we begin with the new syntax required to convert your template to Joomla 1.5, take note that the security syntax required to ensure your files are called from within Joomla has been updated also.

These should be the first lines of code in your index file.

Your current 1.0 file will read:

<?php
  
  defined( '_VALID_MOS' ) or die( 'Direct Access to this
  location is not allowed.' );
  
  ?>


In order to convert to Joomla 1.5 the new syntax will read:

<?php 

  // direct access not allowed

  defined( '_JEXEC' ) or die( 'Restricted index access' );
  ?>
.

The second step required to prep your file for conversion requires a change in the DOCTYPE.

Currently your DOCTYPE will read:


 <!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">

While the new syntax for your Joomla 1.5 DOCTYPE will read:
<!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; ?>">

Among the improvements are better integration with international languages and the direction variable allows for international languages to change the direction of the text.

The following syntax updates are required to convert your template:

Joomla 1.0

$mainframe->getTemplate()
Update these with:

Joomla 1.5
$this->template

While in the process of converting your template over to Joomla 1.5 notice that the calls for URL's have changed also. The variable in the configuration file is no longer absolute.

Find the Joomla 1.0 calls for URL's:

$mosConfig_live_site
and replace with the new calls for Joomla 1.5:
$this->url

Update your module calls to support the Joomla 1.5 format easily by locating the

<?php mosLoadModules('banner',-2); ?> 
and changing this to
<jdoc:include type="modules" name="banner" style="xhtml" />

Finally, change the main body syntax from:

<php mosMainBody(); ?>
to the Joomla 1.5 equivalent of:
<jdoc:include type="component" />
This will finish out the index.php file.

Next, the templateDetails.xml file will need to be edited and converted to the the Joomla 1.5 syntax also. First locate the <mosinstall version="1.0" type="template">

Change this over to <install version="1.5" type="template">

Note: Don't forget to close out your tag at the end of the document. Place your module positions between the <position> tags, save and you've just completed converting your template to Joomla 1.5

If you have any questions on this tutorial, let me know so that I can continue to improve on the usefulness of this tutorial.

Subscribe
Trackback(0)
Comments (0)Add Comment

Write comment

busy

Joomla!Our Joomla! Tutorials are delivered to your mailbox once a week and provide a helpful procedure list for different tasks required to manage your site.

*indicates required

Did you know we also offer internet marketing services & training ?

 

General support for your website starting at only $100!

 

 
 
 
About

Revision Technology is a team of professional website consultants, developers and designers researching and building solutions that allow our clients to realize their ideas.

www.revision-technology.com
Contact

General inquiries: helpdesk@revision-technology.com
Support: Visit the FAQs

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
Updates

Our newsletter is excellent. Subscribe and get the latest updates.