Actions

Difference between revisions of "Upgrading a Joomla 1.5 template to Joomla 2.5"

From Joomla! Documentation

m (Added category)
m (add cat tutorial)
Line 39: Line 39:
 
[[Category:Joomla! 1.6]]
 
[[Category:Joomla! 1.6]]
 
[[Category:Template Development]]
 
[[Category:Template Development]]
 +
[[Category:Tutorial]]

Revision as of 21:17, 30 January 2011

Contents

This page provides feedback on the process of upgrading a Joomla 1.5 template for use with Joomla 1.6 from those who have already attempted it. This is intended to be a living document that can be added to as more experience is gained and is likely to be reorganised periodically. If you have encountered a problem when upgrading a template, or if you have any information that you think will help smooth the way for others who will follow then please add your comments initially on the Talk page. We will then collate the information and incorporate it into this page.

Chris Davenport prepared slides for a presentation at the JoomlaDay UK 2010 event which explain the changes in templates for Joomla! 1.6.

Template parameters

In both Joomla! 1.5 and 1.6 template parameters are defined in templateDetails.xml.

Whereas in 1.5 parameters are defined as part of the <params> section, and each parameter is defined as a <param>, in 1.6 template parameters are contained in the <config> section and treated as a <field> nested within the <fieldset> and <fields> tags, as illustrated below.


    <config>
        <fields name="params">
            <fieldset name="basic">
                <field name="" type=" default="" label="" description="">
                    <option value="1">On</option>
                    <option value="0">Off</option>
                </field>
                <field name="" type="" default="" label="e" description="" />
            </fieldset>
        </fields>
    </config>

<fieldset name="basic"> wraps the parameters in a slider and using name="basic" labels that slider as "Basic Options" and name="advanced" labels it as "Advanced Options".

The name="" type=" default="" label="" description="" attributes still apply.

Objects and Methods

Sitename

  • <?php echo $mainframe->getCfg('sitename');?> is now $app->getCfg('sitename'); Where $app = JFactory::getApplication();

Error Codes

  • $this->error->code is replaced by $this->error->getCode();
  • $this->error->message is replaced by $this->error->getMessage();