Joomla templates

Soldato
Joined
6 Mar 2008
Posts
10,092
Location
Stoke area
Hi all,

First time using Joomla, want to create a template for it and my graphics work isnt great though.

I am reading through http://docs.joomla.org/Tutorial:Creating_a_basic_Joomla!_template and its not making a great deal of sense, probably due to a lack of sleep.

Is it just easier to take one of the templates already installed and just play around with it? Or should I really start from scratch?

Anyone any tips?
 
When I first did one couple of years back it took me a while to get my head around, but once you do it is all pretty simple. Would defiantly be better to make one from scratch, you'll understand how it works apart from anything.

I haven't read that tutorial but basically:

- Create a new folder called My Template or equivalent in /templates.
- Create 3 files. index.php, templateDetails.xml, style.css
- In you templateDetails.xml paste somthing like the following:

Code:
<?xml version="1.0" encoding="utf-8"?> 
<install version="1.5" type="template">       

<name>My template</name>      
<version>0.5</version>   
<creationDate>July 2009</creationDate>       
<author>J Smith</author>       
<copyright>GPL</copyright>       
<authorEmail>[email protected]/authorEmail>       
<authorUrl></authorUrl>       
<description>Custom template for J Smith</description>       



<files>             
<filename>index.php</filename>             
<filename>templateDetails.xml</filename>             
<filename>js/somejsfile.js</filename>             
<filename>images/threecol-l.gif</filename>             
<filename>images/threecol-r.gif</filename>             
<filename>css/style.css</filename>            
</files>       



<positions>             
<position>user1</position>             
<position>top</position>             
<position>left</position>             
<position>banner</position>             
<position>right</position>             
<position>footer</position>       
</positions>          




<params>             
<param name="colorVariation" type="list" default="white" label="Color Variation" description="Color variation to use">                   
<option value="blue">Blue</option>                   
<option value="red">Red</option>             
</param>          
</params> 
</install>


- In you index.php you treat sort of like a standard Html file but with out any content. So, so for example, you'd create your basic header and column layout but don't put any content in. Instead you use <jdoc:include type="modules" name="user1" /> . The names are custom, you can put anything you like as long as you tell the module you want to put in there what it is called. These are used to position modules, e.g. login box, random pictue, twitter etc etc

- For your main content you use <jdoc:include type="component" /> this is were all your articles will be displayed.


Example file:

Code:
<?php // no direct access 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"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
xml:lang="<?php echo $this->language; ?>" 
lang="<?php echo $this->language; ?>" >
<head>

<jdoc:include type="head" />
<link rel="stylesheet" href="templates/system/css/system.css" type="text/css" /> 
<link rel="stylesheet" href="templates/system/css/general.css" type="text/css" /> 
<link rel="stylesheet" href="templates/<?php echo $this->template ?>/css/style.css" type="text/css" /> 


</head>


<body>
<div id="outercontainer">
<div id="container">

	<div id="header">

		<div id="logo">
		<h1>iProjects</h1>
		</div> <!-- logo -->
		<div id="login">
		
			<jdoc:include type="modules" name="login" />
		
		</div> <!-- login -->

	</div> <!-- header -->
	
	
	
	<div id="menu">
	
			<jdoc:include type="modules" name="menu" />
	
	</div> <!-- Menu -->
	
	
	<div id="breadcrumb">
	
			<jdoc:include type="modules" name="breadcrumb" />
	
	</div> <!-- breadcrumb -->
	
	
	
	<div id="body">
	
	
		<div id="column1">
		
		
		<jdoc:include type="component" />
		
		
		</div> <!-- column1 -->
	


		<div id="column2">
		
		
		<jdoc:include type="modules" name="column2" />
		
		
		</div> <!-- column2 -->
	
	
	
	
	</div> <!-- body -->




</div> <!-- container -->



	<div id="footer">
	
	<jdoc:include type="modules" name="footer" />
	
	</div> <!-- footer -->



</div>



</body>



</html>


That is a two column layout with a header, menu, breadcrumbs and footer.


- You then just use you CSS as normal to style everything.


Hope that was helpful.

Feel free to ask any questions.
 
Last edited:
:D Thankyou. When I learn't there didn't seem to be any decent guides and took me literately days to get my head around. Once I did I couldn't believe how simple it was.
I've had the same problem. Looked at some of the Joomla support and wondered if I can actually read English or not. :D I've been looking for a guide, website or PDF that explained how to work with Joomla. Think you've saved me a few hours of fruitless Googling. :p
 
right, off to try this thank you :)

the general support forums don't really explain anything and I was very close to just going back to wordpress :)
 
is the CSS file in the same directory or in a CSS folder?
Have you cleared you browser and joomla cache?

What is it called? Just noticed there is a mistake in the above. Make sure it is called the same in the index.php AND the xml file.

In my example the xml file is pointing to css/layout.css and the index is pointing towards templates/project/css/style.css. Which is wont work on your unless you've changed 'project' to your template name.

I'll edit it now.

Edit// If you want I can zip those files up and upload them. Is virtually a new set-up, just started work on it so almost no styling.
 
Last edited:
Bump. Edward01 you say here that you were putting this in your blog. Got a link to that entry? :)

I would like to make my own template for Joomla so I can start on developing a new website for work. I've read your instructions above and I'm going to give it a go with Joomla and WAMP. :cool: Wish me luck! :p
 
Back
Top Bottom