How to make your own Joomla template

AID: 2231
  • Status: Published

6584 points

  • ByV4nP3rs13
  • TypeTutorial
  • Posted on2010-01-07 at 02:52:13
Awards
  • Community Pick
Here is a tutorial for making your own Joomla templates. Note before reading, you should have some existing knowledge of web development using HTML and CSS.

1

Design Layout


Design your template in a graphics program like Adobe PhotoShop or Corel Draw for example (use whichever is your preference).

2

Isolate Images


Save important design pictures (header, background, footer, menu, etc.) in some folder (for example: "images").

3

Create Directory for your new Joomla Template


Open Joomla templates directory and make a new folder ("mytemplate") in it.

4

Create File/Folder Structure for your new Joomla Template


In "mytemplate" folder create some new files: "index.php", "template_thumbnail.png" and "templateDetails.xml".
Then, make another two folders, "images" and "css". In images folder, paste your pictures from step 2, and in css, create a new "style.css" file.

5

The Joomla Template Details XML


Now, open templateDetails.xml file with any code editor like NotePad++ or DreamWeaver for example (as with graphic design, it doesn't matter which one you choose as that is your preference).
Then, write this code, changing the information between the tags appropriately (e.g., "TEMPLATE NAME") and then save the file.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.5//DTD template 1.0//EN"
 "http://dev.joomla.org/xml/1.5/template-install.dtd">
<install version="1.5" type="template">
  <name>TEMPLATE NAME</name>
  <creationDate>07/01/2010</creationDate>
  <author>YOUR NAME</author>
  <authorEmail>YOUR E-MAIL</authorEmail>
  <authorUrl>YOUR WEBSITE</authorUrl>
  <copyright>&nbsp;</copyright>
  <license>gnu/gpl</license>
  <version>1.0.0</version>
  <description>No description</description>
  <files>
    <filename>index.php</filename>
    <filename>templateDetails.xml</filename>
    <filename>template_thumbnail.png</filename>
    <filename>css/style.css</filename>                
  </files>
  <positions>
    <position>left-column</position>
    <position>main-column</position>
    <position>right-column</position>
  </positions>
</install>
                                    
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:

Select allOpen in new window



6

The Joomla Template Index Page


Open index.php using your text/code editor and add HTML code like the following example for your template, then save it!
<!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="en" lang="en" >
<head>
  <link rel="stylesheet" type="text/css" href="/templates/mytemplate/css/style.css" />
</head>
<body>
  <div id="header">&nbsp;</div>
  <div id="columns">
    <div id="left">
      <jdoc:include type="modules" name="left-column" />
    </div>
    <div id="main">
      <jdoc:include type="component" />
      <jdoc:include type="modules" name="main-column" />
    </div>
    <div id="right">
      <jdoc:include type="modules" name="right-column" />
    </div>
  </div>
  <div id="footer">&nbsp;</div>
</body>
</head>
                                    
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:

Select allOpen in new window



Note: <jdoc:include type="modules" name="main-column" /> means that there is the "main-column" module position that you will find in Joomla administration panel. The name of the module position must be the same in the "templateDetails.xml" and "index.php" files (e.g. main-column).

7

The Joomla Template StyleSheet


Open the style.css file and add some CSS code for your template. I will not put examples for this, but as stated earlier you should already know some CSS and so you can write some simple test styles yourself here.

8

Activate Your Template!


Open your Joomla administrator panel and go to the template manager. You will see your own template's name which you can now set to the default and try it out!


I hope this will help you to make your websites better.
Asked On
2010-01-07 at 02:52:13ID2231
Tags

joomla

,

joomla 1.5

,

template

,

html

,

css

Topic

Joomla

Views
10123

Comments

Add your Comment

Please Sign up or Log in to comment on this article.

Join Experts Exchange Today

Gain Access to all our Tech Resources

Get personalized answers

Ask unlimited questions

Access Proven Solutions

Search 3.2 million solutions

Read In-Depth How-To Guides

1000+ articles, demos, & tips

Watch Step by Step Tutorials

Learn direct from top tech pros

And Much More!

Your complete tech resource

See Plans and Pricing

30-day free trial. Register in 60 seconds.

Loading Advertisement...

Top Joomla Experts

  1. webmatrixpune

    100,791

    Master

    600 points yesterday

    Profile
    Rank: Guru
  2. joomla_php

    36,350

    0 points yesterday

    Profile
    Rank: Guru
  3. nikunjt

    25,528

    0 points yesterday

    Profile
  4. panagiotiss

    19,400

    0 points yesterday

    Profile
    Rank: Guru
  5. austega

    17,868

    900 points yesterday

    Profile
    Rank: Master
  6. ChrisStanyon

    11,768

    0 points yesterday

    Profile
    Rank: Sage
  7. COBOLdinosaur

    9,264

    0 points yesterday

    Profile
    Rank: Genius
  8. NUKIT

    9,040

    0 points yesterday

    Profile
    Rank: Guru
  9. SSupreme

    8,800

    0 points yesterday

    Profile
    Rank: Wizard
  10. StormITSolutions

    8,756

    10 points yesterday

    Profile
    Rank: Wizard
  11. jason1178

    8,000

    0 points yesterday

    Profile
    Rank: Genius
  12. rowby

    6,332

    0 points yesterday

    Profile
    Rank: Master
  13. lenamtl

    6,000

    0 points yesterday

    Profile
    Rank: Guru
  14. easynow111

    5,000

    0 points yesterday

    Profile
    Rank: Guru
  15. nap0leon

    4,500

    0 points yesterday

    Profile
    Rank: Sage
  16. Ray_Paseur

    4,468

    0 points yesterday

    Profile
    Rank: Savant
  17. DaveBaldwin

    4,300

    0 points yesterday

    Profile
    Rank: Genius
  18. nant

    4,000

    0 points yesterday

    Profile
  19. masterswebsolutions

    4,000

    0 points yesterday

    Profile
  20. NerdsOfTech

    2,800

    0 points yesterday

    Profile
    Rank: Sage
  21. xterm

    2,750

    0 points yesterday

    Profile
    Rank: Sage
  22. bobohost

    2,340

    0 points yesterday

    Profile
    Rank: Master
  23. Slick812

    2,100

    0 points yesterday

    Profile
    Rank: Sage
  24. CEHJ

    2,000

    0 points yesterday

    Profile
    Rank: Savant
  25. dcowley

    2,000

    0 points yesterday

    Profile

Hall Of Fame