You are currently viewing How to Create your First joomla Template

How to Create your First joomla Template

After the installation of the Joomla into your PC, you will be able to see the Joomla site on your browser. It is strongly recommended that you should use the wamp server for the Joomla installation because the Xamp has some issues after the installation of Joomla.

Go to your root directory and to your Joomla folder, here you will see the template folder/directory just go there here you will see the different templates, you can switch between them from the admin area of the site.

Now create a new directory for your template in the template directory as I created the test template. In this Directory, you will create your required files and folders that will be needed.

In Joomla, we usually need only two files. The first one is an XML file that contains the details of the template and the other one is an index file that will show your template. These are the basic and necessary files for your Joomla template. If you want to give some design that is for an excellent looking site just create a styles file in the same folder of your template or create a subfolder in your template folder, As I created a subfolder for the CSS and images also because I also going to add images in my template.

I create the following files and folders in my test template folder

index.php (file)

templateDetails.xml (file)

images (folder)

CSS (folder)

in the CSS folder, I create a file for CSS call it template.css

in the images folder, I place 1 image only you can place as many images as you want to include into your template.

now start the editing and open your XML file first.

<?xml version="1.0" encoding="utf-8"?>

mytemplate
2011-01-28
Shah Rukh
[email protected]
http://www.tdevelopers.com
T Developers GNU/GPL 1.0
My new First Joomla Template

index.php
templateDetails.xml
images
CSS
css/template.css
breadcrumb left right top user1 user2 user3 user4 footer

The xml file just tells the system what is the version of your Joomla, and things like author, date of creation version, etc.
after these things you just tell about the files and folders that are created in your template directory, Remember thing any file you want to include into your index.php you should first declare it into your xml file.
After this, there are positions that you can call something like modules that you will include.
Now move to the index.php file

< ?php defined( '_JEXEC' ) or die( 'Restricted access' );?>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">










It’s the very simple one, first line is for the restricted group of users that may harm your code so it will away from them from your code.
after this the more simple things the syntax of every HTML start.
the main thing in this code is the

[code lang=”php”]

[/code]

It’s the syntax that will use to include every predefined like modules in it.
The first two CSS files are the system CSS files that should b included and the 3rd one is yours that may not necessary.
So that’s the end hope you learn from it.

This Post Has 2 Comments

Leave a Reply