Rvsjoen/tutorial/Developing a Template/Part 01

From Joomla! Documentation

< User:Rvsjoen‎ | tutorial/Developing a Template
Revision as of 04:54, 16 April 2012 by Rvsjoen (Talk | contribs)

Developing a Basic Template

Alright, lets get cracking on this awesome adventure towards template independence. Creating a basic template is in reality pretty simple, all we need is two things.

  • A template manifest
  • A template index file

Creating the index file

This is where it all starts, the "root" of your template so to speak.

With your favorite editor, create the following file


 * @package     Joomla.Tutorials
 * @subpackage  Template
 * @copyright   Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
 * @license     License GNU General Public License version 2 or later; see LICENSE.txt
// No direct access to this file
defined('_JEXEC') or die;
<?php echo '<?'; ?>xml version="1.0" encoding="<?php echo $this->_charset ?>"?>
<!DOCTYPE html>
<html xmlns="" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
		<jdoc:include type="head" />
		<jdoc:include type="message" />
		<jdoc:include type="component" />

Creating the manifest

With your favorite editor, create the following file


<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="template" client="site">
        <creationDate>Once upon a time</creationDate>
        <author>John Doe</author>
        <copyright>Copyright Info</copyright>
        <license>License Info</license>
	<description>Description of the Hello World! template...</description>

Installation and Testing

Before testing your shiny new module you have to install it. In Joomla! there are two ways of doing that, either by packaging the extension into an installable zip package or by using the discovery method. Both methods are described below but I recommend using the packaged zip file as a beginner because it is more hostile towards errors especially in the XML manifest.

Installing your template

If you have used Joomla before reading this tutorial, you have noticed that extensions are installed using a compressed file containing all the things which are needed for installing and uninstalling them.

A new feature made available in Joomla! 1.6 is "discover." That means you can place the files in the correct places inside your Joomla! installation (The proper file path for this module will be in templates/helloworld within the Joomla! root), and the "Discover" option within the extension manager will install it, when selected.

Packaging an installation zip file

Create a compressed file of your extension directory using the structure shown in the file listing section of this page or download the provided installable package.

When you have this package, install it using the extension manager.

Testing your template

If you want to test this template, you first need to do a couple of things.

  1. Go to the Template Manager
  2. Set your shiny new template to the default template for Site

After performing these steps you can navigate to the frontend and view the template.

File listing

Download this part