How to make a Joomla theme


If you’re using Joomla for your site and would like to make your own theme, the simple tutorial below may enlighten as to how a basic Joomla theme is created.

1. In the Joomla installation folder, open the templates directory.
2. Create a subfolder where you can put the new template you’re making. Name the folder as Trial.
3. Using a text editor or notepad, create an index.php file inside the Trial folder.
4. Create a templatedetails.xml file as well.
5. Create a new folder this time and name it as the CSS folder.
6. Under the CSS folder, create a template.css file.
7. Open index.php again, still using Notepad or your choice of an html editor. Paste this code inside:

<!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=”<?php echo $this->language; ?>” lang=”<?php echo $this->language; ?>” >
<head>
<jdoc:include type=”head” />
</head>
<body>
<div id=”container”>
<div id=”header”><jdoc:include type=”modules” name=”top” /> </div>
<div id=”sidebar_left”><jdoc:include type=”modules” name=”left” /></div>
<div id=”content”><jdoc:include type=”component” /></div>
<div id=”sidebar_right”class=”float”><jdoc:include type=”modules” name=”right” /></div>
<div id=”footer”><jdoc:include type=”modules” name=”footer” /></div>
</div>
</body>
</html>

8. Now open the templateDetails.xml. The templateDetails.xml file should contain this code:

<?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>tutorial_template</name>
<creationDate>02/2008</creationDate>
<author>SiteGround</author>
<authorEmail>templates@siteground.com</authorEmail>
<authorUrl>http://www.siteurl.com</authorUrl>
<copyright>SiteGround</copyright>
<license>SG TOS</license>
<version>1.0.0</version>
<description>Basic Joomla Template</description>
<files>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
<filename>css/template.css</filename>
</files>
<positions>
<position>left</position>
<position>right</position>
<position>top</position>
<position>footer</position>
</positions>
</install>

9. Lastly, add this code to the template.css file.

* {
padding: 0;
margin: 0;
}
img {
border: 0;
}
body {
font-family: Arial, Helvetica, sans-serif;
line-height: 1.3em;
margin: 0;
padding: 0;
font-size: 13px;
color: #0F0F0F;
}
a:link, a:visited {
text-decoration: underline;
font-weight: normal;
color: #000;
outline: none;
text-align: left;
}
.float {
float: left;
}
.clear {
clear: both;
}
.overall {
background-color: #fff;
}
div.center {
text-align: center;
margin: 0px auto 0 auto;
padding: 0;
width: 950px;
background: #FFFFFF;
}
#container {
width:960px;
margin: auto;
background-color: #f4f9fc;
border: 1px solid #e2e2e2;
text-align: left;
}
#header {
text-align: center;
background-color:#f4f9fc;
height: 80px;
}
#content {
width: 598px;
text-align: left;
background-color:#f4f9fc;
padding: 5px;
}
#sidebar_left {
text-align: center;
background-color:#f4f9fc;
width: 165px;
border-right: 1px solid #e2e2e2;
border-bottom: 1px solid #e2e2e2;
padding: 5px;
}
#sidebar_right {
background-color:#f4f9fc;
text-align: center;
width: 165px;
border-left: 1px solid #e2e2e2;
border-bottom: 1px solid #e2e2e2;
padding: 5px;
}
#footer {
background-color:#f4f9fc;
text-align:center;
border-top: 1px solid #e2e2e2;
border-botom: 1px solid #e2e2e2;
padding: 5px;
}

10. You now have a very basic Joomla template. Now use your imagination to improve the look of your site with a few more HTML tricks!

AndysWebTools...Easy as Pie! AndysWebTools...Easy as Pie!