Those are tips to convert your Joomla 1.0 template to Joomla 1.5 template w/o turn on legacy mode.
Please report any issue/bug/error you found during conversion, so I can try my best to keep everything up to date.
I also attached a sample file contained the "rhuk_solarflare_ii" template came with Joomla 1.0 but in Joomla 1.5 version.
However, the attached converted template might distort if we got longer content title, which might not be conversion problem.
I'll pay extra attention to 1.5 template part and also provide any update here.
Thanks Ian for his MVC tutorial, and here is my template conversion tutorial.
!!! PLEASE DO NOT distribute/use this content to any other place except Joomla Official Site!!!
PHP Part
* replace
Code: Select all
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
Code: Select all
defined('_JEXEC') or die('Restricted access');
* remove $mosConfig_live_site and change to relative path
replace $mosConfig_live_site with $mainframe->getCfg( 'live_site' );
$mainframe->getCfg( 'live_site' ); is no longer available.
Reference: Link
* replace
Code: Select all
$GLOBALS['mosConfig_absolute_path']
Code: Select all
$mainframe->getCfg('absolute_path')
Code: Select all
dirname(__FILE__)
* add language specification to your header
Code: Select all
<!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; ?>" >
Code: Select all
mosShowHead();
Code: Select all
<jdoc:include type="head" />
Code: Select all
$mainframe->getTemplate();
Code: Select all
<?php echo $this->template ?>
Code: Select all
if ( $my->id ) {
initEditor();
}
Reference: Templates in Joomla! 1.5 - Part 1
http://www.joomla.org/component/option, ... ,33/p,210/
* remove since the code will be add within header function already.
Code: Select all
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
Code: Select all
// Load the mootools framework
<?php JHTML::_('behavior.mootools'); ?>
Code: Select all
<link rel="stylesheet" href="templates/system/css/general.css" type="text/css" />
Code: Select all
/* Tooltips */
.tool-tip {
float: left;
background: #ffc;
border: 1px solid #D4D5AA;
padding: 5px;
max-width: 200px;
}
.tool-title {
padding: 0;
margin: 0;
font-size: 100%;
font-weight: bold;
margin-top: -15px;
padding-top: 15px;
padding-bottom: 5px;
background: url(../../system/images/selector-arrow.png) no-repeat;
}
.tool-text {
font-size: 100%;
margin: 0;
}
Code: Select all
<jdoc:include type="message" />
Code: Select all
mosCountModules('xxx')
Code: Select all
$this->countModules('xxx')
Code: Select all
mosLoadModules('xxx', #);
Code: Select all
<jdoc:include type="modules" name="xxx" style="" />
0 = table (default)
1 = horz
-1 = raw
-2 = xhtml
-3 = rounded
Reference: http://help.joomla.org/content/view/1565/155/
* replace
Code: Select all
mosMainbody();
Code: Select all
<jdoc:include type="component" />
Code: Select all
$id = mosGetParam( $_REQUEST, 'xxx', ooo );
Code: Select all
$id = JRequest::getVar( 'xxx', ooo );
getCmd:
Fetches and returns a given filtered variable. The cmd filter only allows the characters [A-Za-z0-9.-_]. This is currently only a proxy function for getVar().
getInT, getFloat, ... etc.
Reference: http://api.joomla.org/Joomla-Framework/ ... quest.html
* replace
Code: Select all
mosPathway();
Code: Select all
<jdoc:include type="module" name="breadcrumbs" />
Code: Select all
<?php echo JURI::base(); ?>
CSS Part
* Joomla 1.5 appended the suffix "_menu" to the class for menu module, so you need change your css too.
For example, Joomla 1.0 use "moduletable", you need to add "moduletable_menu" with the same css properties to your css.
* Rename template_css.css to template.css and change the path in index.php and other files that applied.
"We also changed the naming of the master css file to template.css instead of template_css.css"
* media="print" css
You need to add the css include into the component.php file.
Reference: http://forum.joomla.org/index.php/topic ... #msg961807
XML Part
* replace
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
Code: Select all
<install type="template" version="#">
* replace
Code: Select all
mosinstall
Code: Select all
install
Code: Select all
<positions>
<position>top</position>
...
<position>user6</position>
</positions>
INI Part
If you are going to use Joomla 1.5 template new feature, changing template parameter at back-end, you need to create a "params.ini".
To config the parameters at back-end
You can remove those hard coded variable and specify those variables in the xml file and also created a ini file.
To retrieved those variables at index.php page.
Code: Select all
$this->params->get("name", "default");