03 December 2013

How to create Joomla templates - hello world

To create your own template for Joomla CMS , you need to follow some directory structure and file names. The template should have at least this 2 files : templateDetails.xml and index.php
joomla

You need to create a folder and the files inside it. Place this folder under templates folder inside the joomla folder.

To set your template , go to Extensions -> template manager.
Choose your template name from the list and click default to make effected.

The file structure of the templateDetails.xml :

<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" type="template">
<name>My First J template</name>
<description>
This is my Template
</description>
<files>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
</files>
</install>

Sample index.php file :

<html>
<head>
<jdoc:include type="head" />
</head>
<body>
<jdoc:include type="message" />
<div class="center" align="center">Welcome to my World! Lets have some fun</div>
<jdoc:include type="modules" name="debug" />
</body>
</html>

Done.

(If you found this article useful then share with your friends.)

No comments: