Make a Joomla Template in 5 Easy Steps

A Beginners Guide

By Gary Reid http://clubtvk.com

Copyright © 2006 Gary Reid. All Rights Reserved. No part of this book may be used or reproduced in any manner whatsoever without written permission. Please see the license in Appendix 5 of this book. Published 2006 by Gary Reid in the United Kingdom http://garyreid.co.uk Phone +44 (0)141 530 8654 • Email gary@garyreid.co.uk Copyright Info The copyright of this work belongs to Gary Reid, who is solely responsible for the content. Please direct content feedback or permissions to gary@garyreid.co.uk. The moral right of the author has been asserted.

Contents
Chapter 1: Introduction................................................................................................................................................1 Who’s This For?........................................................................................................................................................1 What You Will Need ................................................................................................................................................2 Preamble.....................................................................................................................................................................2 Important Stuff! ........................................................................................................................................................2 Chapter 2: The Basics of a Joomla Template............................................................................................................3 The index.php file.....................................................................................................................................................3 The templateDetails.xml file ...................................................................................................................................4 The images folder .....................................................................................................................................................5 The css/template_css.css file ..................................................................................................................................5 Chapter 3: Step One - Grab the Raw Material..........................................................................................................7 Chapter 4: Step Two – Make a Home for our Template ........................................................................................9 Chapter 5: Step Three – Create Our First Layout ................................................................................................. 12 Menus ...................................................................................................................................................................... 12 Main Menu ......................................................................................................................................................... 12 Top Menu........................................................................................................................................................... 12 User Menu .......................................................................................................................................................... 13 Other Menu........................................................................................................................................................ 13 Pathway ................................................................................................................................................................... 13 Login........................................................................................................................................................................ 13 Search Box .............................................................................................................................................................. 13 Main Content.......................................................................................................................................................... 13 Banners.................................................................................................................................................................... 14 Newsflash................................................................................................................................................................ 14 Popular .................................................................................................................................................................... 14 Syndicate.................................................................................................................................................................. 14 Who’s Online.......................................................................................................................................................... 14 Poll’s......................................................................................................................................................................... 15 Related Items.......................................................................................................................................................... 15 Random Image ....................................................................................................................................................... 15 Latest News ............................................................................................................................................................ 15 Roundup of the Modules...................................................................................................................................... 15 Layout...................................................................................................................................................................... 16 The Layout Sketch................................................................................................................................................. 18 The HTML ............................................................................................................................................................. 20 Chapter 6: Step Four – Adjust The Style Sheet ..................................................................................................... 33 The Site Name........................................................................................................................................................ 33 The Top Menu ....................................................................................................................................................... 36 The Search Box ...................................................................................................................................................... 39 Login Box, Popular, Latest News........................................................................................................................ 40 The Pathway ........................................................................................................................................................... 43 The Main Body Area ............................................................................................................................................. 44 Bits and Pieces........................................................................................................................................................ 47 The Optional Section ............................................................................................................................................ 49 W3C Validation...................................................................................................................................................... 52 Chapter 7: Step Five – Package The template........................................................................................................ 53

............................................................... 84 Joomla Tags ............................................................................................................................................................................................................. 72 Step 3 Layout .......................................................... 91 ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 84 Joomla Main Body Tag......................................................................xml ................................................................................xml................................................................... 84 Joomla Pathway Tag ...............................................................................................................................................................................................................php..... 84 Joomla Footer Tag .......................................................................................................... 59 Chapter 9: Advanced Techniques ................................................................................................................. 90 Appendix 7: ClubTVK index...............................................................................................................................................................................................................................................................................................................................................................................Chapter 8: Two Column and Three Column Template......... 89 Appendix 6: ClubTVK templateDetails.................................................................................................. 85 Appendix 2: Duffer1 HTML ....................................................................................... 82 Appendix 1: Joomla Tags ................................................... 84 Joomla Site Path Tag ........................................................................................ 86 Appendix 3: Duffer1 templateDetails................................................ 84 Joomla Head Tag................................................. 67 Adding a Logo ...................................................... 85 Joomla Tags with Switches .................................................................................................................................................................................. 70 Chapter 10: The ClubTVK Template.. 72 Step 4 The Style Sheet ............................................................................... 81 Chapter 10: About Gary Reid ..................................................................................................................................... 69 Complex Joomla Tags ............................... 81 The End...................................................................................................................................................................................... 72 Step 1 Grab The Raw Material....................................................................... 84 Joomla Template Path Tag ........ 72 Step 2 Make a Home for the Template .......................................................... 87 Appendix 4: Additional Resources.................................................................................................................................................................................. 76 Step 5 Package The Template ........................................................................................................................................................................................................................................................ 84 Joomla Site Name Tag........................... 88 Appendix 5: E-Book License Agreement ............................................

two column and three columns so you should have a good working knowledge of the Joomla template system when we are done.I N T R O D U C T I O N Chapter 1: Introduction I’m Gary Reid. I’m not going to expect you to know anything about design or html. My wife just pointed out ‘what if someone writes 4 steps to make a template’. Their way is good. let’s get hacking. http://combtail. Who’s This For? This guide is for absolute beginners. 1 .com which provides free Joomla templates. because trust me layout.com which provides blog hosting. Hmm hadn’t thought of that! Anyway. let’s get onto the good stuff. but it does the job. I run a few Internet based companies and they all use Joomla. people like you and me who have no design training but need to get a design that looks good enough to unleash upon the world. I get a lot of emails through The Venture Kit asking about a ‘how to’ guide for templates so decided to sit down and write it. If you have just installed Joomla. clarity and usability are much more important. I’m no designer.utiny. http://theventurekit. So. I had to lock them up to stop them leaning over my shoulder and saying ‘actually you should do it like this’. You want it simple? Well. we’ll create three templates a single column. taken a look at the templates and thought ‘nothing quite right for me here’ then this book should help. but having locked my designers in a small darkened room I decided to go through the absolute easiest way to create a template for Joomla.com which provides web consultancy and design and http://m. but not so easy for us beginners to get a handle on. It’s not about graphics. It’s not perfect and it’s not neat and tidy. duffers. enough of this introduction stuff. in fact it’s a prerequisite to be a complete beginner to use this book. If you are a design expert put it down now! I think you will find it an enjoyable journey. you don’t need to learn any graphics for this to work. it doesn’t get much simpler than this.

Other files can be grabbed from the http://clubtvk. it’s free.com/free-ftp Preamble Before we get into the actual work I want to point out to all W3C people that we are going to use tables for layouts not DIV’s. You can grab hold of a free FTP program from here http://www.mpsoftware.dk/phpdesigner.php. So. but just cut and paste for the best results. so we couldn’t use strict. you can try and just type it in straight from the book. You will also need a HTML editor. although we use DreamWeaver here I realise this costs a few hundred dollars so I got hold of PHP Designer 2006. I have put all of the code into appendices to make it easier. Important Stuff! Throughout the book we’ll be using bits of PHP code and HTML. 2 . if you don’t already have a HTML editor go get your copy now. You’ll have access to this if you bought this e-book Hopefully cutting and pasting the PHP bits from this e-book will cut down on mistakes that can happen when trying to type this stuff in. This piece of software is just a touch more reliable to use than say notepad. The reason for this is that Joomla is XHTML Transitional anyway.8.com downloads section. Finally you will need FTP access to your Joomla install and an FTP program to upload/download files. But the details will work well with any of the 1.0. This book has been based upon Joomla version 1. Plus it’s just damn plain easier for us normal folk to use a table.I N T R O D U C T I O N What You Will Need Obviously you’ll need Joomla installed on your website. Get hold of it from here http://www.0.x versions and unless the Joomla guys go mad should work on all future versions. in other words Joomla uses tables for modules.coffeecup.

php file This file is the wire frame of your template. The index.T H E B A S I C S O F A J O O M L A T E M P L A T E Chapter 2: The Basics of a Joomla Template Before we get into actually making the template it’s probably worth getting an understanding of the template system Joomla uses. you don’t really need to understand what it does other than act as a placeholder for your modules. We will do this using some PHP code. Using index. 3 . It holds the information that allows Joomla to create the layout for your site. If you FTP into your Joomla powered site you will see a folder called ‘templates’ go into this folder and you will see another folder called ‘rhuk_solarflare_ii’ inside this folder you will find the template files.php we set the positions that Joomla can use for modules and the main body text. as shown below. but I will be giving you all of the PHP code to cut and paste into this file. If you look in your Joomla administrator section under ‘modules > site modules’ you will see each module has a position. lets examine the rhuk_solarflare_ii template that is shipped as standard with Joomla. In fact it’s quite simple. Let’s take a look at each of the important files we will work with today.

jpg</filename> <filename>images/menu_bg.png</filename> <filename>images/contenthead.0"> <name>rhuk_solarflare_ii</name> <creationDate>10/20/05</creationDate> <author>rhuk</author> <copyright>GNU/GPL</copyright> <authorEmail>rhuk@jamboworks</authorEmail> <authorUrl>http://www.png</filename> <filename>images/header_short.0.0" encoding="iso-8859-1"?> <mosinstall type="template" version="1. New headers and menu elements give this template a 'fresher' look.png</filename> <filename>images/indent3.php</filename> <filename>template_thumbnail.2</version> <description>SolarFlare II is a simple and stylish template.png</filename> <filename>images/spacer.png</filename> <filename>images/indent4.css</filename> </css> </mosinstall> It contains information about the actual template.png</filename> </files> <images> <filename>images/advertisement.png</filename> <filename>images/powered_by.xml file This file is used by Joomla when installing the template from the administrator panel.png</filename> <filename>images/arrow. version and the graphics files associated with the template.png</filename> <filename>images/title_back. author.png</filename> <filename>images/button_bg.jamboworks. The clean design of this template makes it very lightweight and fast. It looks like this: templateDetails. This is a significatn upgrade for the original SolarFlare template in that is has a completely revised layout that uses an alternate box model hack that makes it easier to modify. 4 .com</authorUrl> <version>2.png</filename> <filename>images/indent1. Also a table has been introduced in the main content area that better constricts layout causing less problems with 'problematic' components.png</filename> <filename>images/indent2.xml <?xml version="1.T H E B A S I C S O F A J O O M L A T E M P L A T E The templateDetails.</description> <files> <filename>index.png</filename> </images> <css> <filename>css/template_css.png</filename> <filename>images/subhead_bg. it’s name.

let’s get started with step one. The images folder As the name suggests this folder contains all of the images used in your template. So. These are the only files we will be looking at today and with these we can build a really unique template easily. We will be using a couple of images and this is where we will be putting them. colours and various other elements for the template. 5 . You don’t need any CSS knowledge as I will step you through the basics you will need to understand the Joomla CSS file. The vast majority of the images we will use are already in the standard template.T H E B A S I C S O F A J O O M L A T E M P L A T E If you take a look at Figure 3 below you can see how Joomla uses information in this file to tell you about the template.css file This is a cascading style sheet and is used to apply a theme to your template. The css/template_css. Figure 1 Template Details Although we won’t be using the administrator panel to install our templates I will detail how you can package your template so you can share it with friends later in the book. It sets the font. The reason a CSS file is used is to separate these factors from other parts of the documents layout.

T H E B A S I C S O F A J O O M L A T E M P L A T E 6 .

Case sensitive File and folder names are case sensitive. Once we’ve got that created we can download the files we need. Now move into the rhuk_solarflare_ii folder 4.png o rating_star_blank. 1.png o indent4. The first thing we need to do is create a folder on our PC where we can store the files.png o indent1.png 7 . Select all of the files and folders you can see and download them to the duffer1 folder we created earlier Check to make sure you have all of the files.png o pdf_button. the convention is to use all lower case letters for file and folder names and never have spaces in file or folder names.xml images o advertisement.png templateDetails. Go into the templates folder 3.S T E P O N E : G R A B T H E R A W M A T E R I A L Chapter 3: Step One .png o contenthead. to make things easier we are going to get some raw materials to work with.php template_thumbnail. FTP to your Joomla web site 2. So. you should have the following files on your PC: • • • • • index.Grab the Raw Material The worst place to start any project is with a blank page. Let’s call this folder duffer1 and create it anywhere on your PC you want.html index.

png arrow. you should have all of these files in your duffer1 folder.html So.jpg indent3.png index.css o template_css.png emailButton.png o editor_content.png printButton.css o index. Images Missing? If you don’t have some of the images listed don’t worry. we now have the raw material we need to start putting together our own template.png rating_star. Now that was easy enough wasn’t it? That’s step one complete.html powered_by.png spacer.png menu_bg. changes in Joomla meant some newer versions don’t have the same image set. The next step is to make a home for the new template on our website.png header_short.png indent2.S T E P O N E : G R A B T H E R A W M A T E R I A L o o o o o o o o o o o o o • css subhead_bg. 8 . This tutorial will work just as well no matter what standard images your version has.png button_bg.

xml file. it looks like this: 9 . Next we have to move onto editing our raw material. Important Don’t Skip This The next part of this tutorial is important.xml that we downloaded earlier in step one. editing the templateDetails. That’s the first part complete.S T E P T W O : M A K E A H O M E F O R O U R T E M P L A T E Chapter 4: Step Two – Make a Home for our Template We’ve got the raw material to start making our template but now we need somewhere to put it on our website and make sure Joomla can recognise it. so here we are face to face with our first real bit of work. we need to open PHP Designer 2006 and then open templateDetails.xml we make it visible to Joomla. Once we get there we need to create a new folder called duffer1 notice all lowercase.com and we are going to call it duffer1 The first thing we need to do is FTP to our website and go into the templates folder. Okay. As I wrote above this is necessary so that Joomla can recognise our template as being different to the original rhuk_solarflare_ii.combtail. this one: <name>rhuk_solarflare_ii</name> We need to put here exactly the same as we called the folder we made on our website above. By changing the details in templateDetails. If they are not changed you may have problems further down the line. We now have a place on our web site where we can put our new template. The first line we edit is line 3. So. We are going to create this template for http://duffer1. so we change it to: <name>duffer1</name> Next we move to line 4.

Your online duffer1 folder should look like the figure opposite.S T E P T W O : M A K E A H O M E F O R O U R T E M P L A T E <creationDate>10/20/05</creationDate> We need to change it to today’s date: <creationDate>03/15/06</creationDate> Next we move onto line 5 and change this to your name: <author>Gary Reid</author> Next we edit lines 7.com</authorUrl> <version>2. the template uses a developed version of the CSS file from the rhuk_solarflare_ii template developed by rhuk@rockettheme. That’s it. now we have made the file show our unique details.com.com </description> Notice we have credited the earlier work done by rhuk on the CSS file. 8 and 9. Next we need to make this the default template for our site.rockettheme.com</authorEmail> <authorUrl>http://combtail.rockettheme.com</authorUrl> <version>1.2</version> Change them to something like this. The next step is to upload all of the files we have in our local duffer1 folder to the duffer1 folder on our web site.com</authorEmail> <authorUrl>http://www. To do this we need to login to the Joomla administrator section and browse to: site > template manager > site templates 10 . so we can see the magic as we work on it. they look like this: <authorEmail>rhuk@rockettheme. even though we will be using very little of it we will still be using a few of his images.0</version> The next line is the description of the template so change it to something like this: <description>A template created from the duffer's tutorial. using your email and website: <authorEmail>gary@combtail.com at http://www.

That’s the easy stuff done. This means we are now using the new template. However. at this stage it just looks exactly like the rhuk_solarflare_ii template. Let’s look at that next. with our new duffer1 template showing in the list with our details: Check the radio button next to the duffer1 template and click ‘default’ this will set the template as live and the one being used by Joomla.S T E P T W O : M A K E A H O M E F O R O U R T E M P L A T E When we get there it should look like this. Now we need to do some thinking to move the design forward. uploaded it and set it as default in Joomla. 11 . But that’s going to change soon! What we’ve done so far is got some raw material to work with. created a home on our website for the new template. Your screen should now look like this: Notice the green tick under the default column and in the duffer1 row. We need to create a layout to replace the rhuk_solarflare_ii layout.

The order of each menu item within the menu can be set from the administrator area. You can decide where each link you create appears. They take information from the backend and display it in a formatted manner on your website. Modules are how the system presents itself to your visitors. we will look at each one in turn: Main Menu The main menu is as it appears the sites main menu. By default the main menu is in the left position.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T Chapter 5: Step Three – Create Our First Layout Before we dive right in I think it’s best that we understand exactly what we need to consider when putting together a Joomla template. The first things are ‘modules’. Top Menu The top menu is optional. 12 . By default it is at the top of your page. top. this means that it fits best into either the right or left positions on your web page. however if you browse to site modules in the administrator section of the site you can unpublish the whole of this menu. Each menu can be set to appear on every page or just on certain pages. The menu’s are created dynamically. so you can decide which you want to use and those you don’t want to use. but you can move it to the right position from the administrator area under site modules. this means when you create a new menu item it is automatically added to the menu and will show on every page. Menus The system comes with a powerful set of dynamic menus built from the administrator section. The menu is ‘vertical’ in nature. in this sense it is optional. horizontal in nature and it’s positioning and state can be controlled from the administrator area. other or user menu. In total there are four. You can choose to have it in the main. Most of the modules are optional.

The title of the module can be turned off and you can have the login box whilst stopping visitors from registering. Pathway The pathway shows visitors a breadcrumb path of where they are on your site in relation to the home page. The user menu has some default links but you can choose to unpublish these if you wish Other Menu The other menu is an auxiliary menu for items you don’t want to put in the main or top menu.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T User Menu The user menu is set to only appear to registered users that are logged in. be default this is the middle column. if your site doesn’t require user registrations then you can omit it. optional and vertical in appearance. by default it appears in the left column and is vertical in appearance. Login The login box is optional. It’s size and position however can be changed Main Content The main content obviously isn’t optional. This would allow you to add site users manually. The pathway is horizontal in appearance and its width can be varied. You can use this menu effectively by having it appear on certain pages with links to extra information regarding that page. By default the login box appears in the left column. 13 . this is where content you add to the site is displayed. The position and size of this area can be changed but there are minimum widths that you are probably best observing. it is worth considering that it needs to be wide enough to display potentially long paths. The content is dynamically added to this area as visitors browse through your site. Search Box By default the search box is placed in the same row as the top menu.

Who’s Online The who’s online module by default is in the right column and displays how many guests and registered users are on your site. Syndicate The syndicate module allows you to place links on your pages that people can use to get an xml feed of your site into their news reader. the module is optional and takes a standard 468x60 banner. FAQ’s etc. Newsflash On the default template the newsflash module appears next to the logo header on the right of the page. It can display items from any content category that you have created. 14 . This module automatically displays items from the category that you choose. It displays links to pages that have the most hits. The module is optional. it is optional. It is optional and by default is in the left column. You can set the owner. redirect URL and number of hits each banner can get. The system can rotate banners. such as latest news. Popular By default this section is placed next to the latest news module and above the main content area.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T Banners The banner module allows you to add advertising banners to your site. It is optional.

It is optional. Latest News By default this section is placed next to the popular module and above the main content area. such as the menu’s. 15 . Some are also aligned in such a way that they can only be displayed in a vertical or horizontal manner and this restricts where on a page they can be displayed. Random Image The random image module has been designed to go in either the left or right column and randomly displays an image from a set folder.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T Poll’s The poll module allows you to put a poll on your site so visitors can vote for things. by default it is on the frontpage in the right column. It displays links to pages in the latest news category. Roundup of the Modules That’s the standard modules that come with Joomla. Related Items Related items is a versatile module that works using data set in the meta keywords part of content pages. as you can see most are optional but some by nature are needed. it is optional. By default its not published but is best placed in the right or left column. If enabled it will show links to similar pages that have the same keywords in the meta keywords box.

S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T Layout Joomla’s layout determines where each of the above modules can be placed on your webpages. However to make life easy many of the components are grouped into position categories. You can now see all of the various modules laid out on the page. Let’s take a look at the standard page and see where the main positions are. Key to an effective layout is deciding exactly which of 16 . As you can see certain modules fit better into certain areas.

S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T the modules you need on your site. Everything else is entirely optional. The positions on the page are named and here is the above template with the position names highlighted: 17 . At the very least the site needs a menu module and the content module. A layout does not have to be three columns you can choose a two column or even one column layout. If you want to create a layout then knowing what modules your site requires is the first key step to create a layout that suits the way your site will work. You can then use these as a jigsaw to create the various areas of your webpage and so the website.

the content is unaffected but the modules available is affected: As you can see the left layout does not have the right column or the banner. plus we will be creating a two and three column site later in the book. Now it’s time to get down to business The Layout Sketch For this first template I have decided to go for a single column layout.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T The layout you choose has a direct affect on what modules you can use and where they are positioned. here is a site using two different layouts. Although this may not suit your purpose the idea is to pass on the skills you can then use to create the exact layout you need. and here it is: • • • • • • • 18 Top menu Search box User login Latest news Popular Pathway Main content . To begin my design process I have made a list of the Joomla modules I want my site to use.

S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T So. 19 . Once we have the sketch we need to build an HTML table that serves as the container for these parts. The optional block allows us some flexibility in adding certain modules if we need to later. the footer and a block just above it called optional. here is my sketch of the proposed layout: As you can see there are two extra parts to this outline. The footer is an intrinsic part of every Joomla template and needed.

all you need to do is make sure it’s at the top of the page.?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T The HTML Here we go back to PHP Designer 2006 and create our HTML table. you will see a table as shown in the graphic here. ?> <?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/te mplate_css. ?> </head> <body> At this point you really don’t need to know what any of the above does.ico\" />" . You will find this code in Appendix 1.org/1999/xhtml"> <head> <?php if ( $my->id ) { initEditor(). What you need to do is double click on HTML under new Document. ?><?php echo "<link rel=\"shortcut icon\" href=\"$GLOBALS[mosConfig_live_site]/images/favicon. This is vitally important as it sets the basic page elements for a Joomla template. Before we add any Joomla tags we need to add in the basic HTML required and build the table that will hold our layout.0 Transitional//EN" "http://www. content goes in between them and the head tag. } ?> <meta http-equiv="Content-Type" content="text/html. This will bring up a blank page for us to work with. The Joomla head tag looks like this: Joomla Head Tag <?php defined( "_VALID_MOS" ) or die( "Direct Access to this location is not allowed. charset=iso-8859-1" /> <?php mosShowHead().dtd"> <html xmlns="http://www. When we open PHP Designer 2006 we see a page of options. these tags should always be the very last things on your template page. They look like this: 20 . The first thing we need to add is the Joomla head tag.w3.org/TR/xhtml1/DTD/xhtml1-transitional." ). Next we need to add in the HTML end tags.w3.css\" type=\"text/css\"/>" .

php. This again simplifies the design process for us beginners. so we call this file index. your PHP Designer page should look like this: Before we go any further we are going to save this file. We are going to save it in the duffer1 folder on our PC and overwrite the index. Now we need to add in the table we need and we are actually going to be adding multiple tables nested inside one another. So. so lets walk through the table creation. The first table we add is the main container.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T Joomla End Tag </body> </html> So. PHP Designer 2006 makes this easy for us as it has a little GUI for adding table. we need a row for: • • • • • • • Site name Top menu user login – popular – latest news Pathway Content Optional Footer That means we need a table 1 column wide and 7 rows deep.php page that’s already in there. 21 . it will be one column wide and contain enough rows to hold the items we have in our sketch.

S T E P

T H R E E :

C R E A T E

O U R

F I R S T

L A Y O U T

In the top row of icons you will see this one it’s the icon to create and insert a table. So, make sure you have your cursor in-between the two <body> tags as shown here. Next click the table icon and a popup window will appear. That looks like this.

Adjust the rows so it equals 7, as that’s how many we need. Then click the properties tab and set the width to 700, as we want our table to be fixed width at 700 pixels, set cellpadding and cellspacing at 0 and choose centre from the alignment dropdown. It should look like this:

Now click Ok. What you should see now on your page is this:
22

S T E P

T H R E E :

C R E A T E

O U R

F I R S T

L A Y O U T

You can see we now have rows of HTML and we will be using these for holders of the Joomla tags. The first row we are going to work with is row 13 from the graphic above, it is the first row in our table and is going to hold our site name. Luckily Joomla has a tag for automatically putting the site name into our template, the tag looks like this:
Joomla Site Name Tag
<?php echo $mosConfig_sitename; ?>

We put this tag between the two <td> tags on row 13 so it looks like this:

23

S T E P

T H R E E :

C R E A T E

O U R

F I R S T

L A Y O U T

That will now echo out the sites name from Joomla onto your web page. Next we need to add the tag for the top menu and search box, as these are two separate tags we are going to add a table with two columns inside the next row so we can format the layout easier. This means we are now working with row 16 in PHP Designer 2006. Place your cursor inside the two <td> tags as shown below:

again. This time we want to add a table with 1 row and Now click on the add table icon two columns, we also want this table to be 100% wide, in other words it stretches to the full width of the main table which is 700 pixels. We do this so if we want to change the width of our main page we just need to adjust the main table width and everything else moves with it.

As you can see above we set the width to 100 and check the % box, we also set cellpadding and spacing to zero. Now we click Ok. Your page should now look like this:

24

so we need to move to row 24 and create another table. the tag looks like this: Joomla User Tag <?php mosLoadModules ( 'user1' ). popular menu and latest news menu. this is versatile because Joomla is capable of handling up to nine of these. The rows we will put our next tags in are rows 18 and 19. For this we will use the Joomla user tag. the login form. ?> If you notice the number ‘1’ after ‘user’ this can be incremented up to ‘9’ to create nine instances. so make sure your cursor is in between the two <td> tags on line 24 as below: 25 . our page now looks like this: The next row will hold three items.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T The new table has been added and can be seen occupying rows 16 to 21. What we will do is use user1 and user2 for our top menu and search box.

so it should look like this: Click the Ok button and the table is created. It will occupy lines 24 to 30 as shown below: 26 . with one row And now hit the table icon and three columns.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T again. this time we need a table 100% wide.

login box. 27 and 28. that is. To do this we just use the ‘user’ tag but we increment the numbers up to make them unique.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T Now we need to add the tags for the three items to be included in this table. So. popular and latest news. They go on lines 26. user4 and user5 as follows: 27 . we will use user3.

S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T As you can see above the three Joomla tags are now in place. main body and footer tags are different to the others. it needs to be placed into the templates/duffer1/ folder on your Joomla web site. 36. we will be working on lines 33. So. Now we are getting the hang of this lets add all of the other Joomla tags. adjust the module positions in Joomla administrator and take a look. Here’s what they look like once added: That’s all of the tags in place. notice the pathway. 28 .php in the duffer1 folder on your PC. Let’s upload it now using FTP. These are unique tags rather than using the ‘user’ tag. Line 33 is for the pathway. 39 for our optional tag and 42 for the footer tag. so save the file! Remember it should be saved as index. 36 for the main body tag. 39 and 42. We now need to upload it.

check the box next to top menu and then click the ‘edit’ graphic in the top right row of buttons. it looks like this When you do this you will see a page like the one below: 29 . let’s login to Joomla administrator and adjust the module positions.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T Done that? Great. let’s do the top menu first. We need to browse to ‘modules > site modules’ and we should see a list like this: We need to change module positions.

but don’t worry yet. The other task that needs to be carried out before we take a look is to make sure no other modules are in positions we are using. 30 . Once you’ve made those changes let’s visit the site and take a look. the optional entry we made empty for now.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T From the drop down list next to the word ‘position’ select ‘user 1’ and then click save from the top right row of buttons. Now you need to do this with each of the following: • • • • Search – user 2 Login form – user 3 and also select ‘All’ from the right hand menu items/links Popular – user 4 and also select ‘All’ from the right hand menu items/links Latest news – user 5 and also select ‘All’ from the right hand menu items/links Let’s leave user 6. What we should have is something that doesn’t look too pretty. and looks something like this: Now we need to make some adjustments before we move onto the theme and get this looking good.

As you can see from the graphic above we have added this: valign=”top” Into the td tag on lines 26. In the next section we will start to add our own colour scheme and make the site look a bit more pleasing.php file and take a look at the site it now looks like this: For now we will leave the index. if we save and upload the index. 27 and 28 this will ensure the top of the three modules in this table all align. 31 .php file and move onto the theme. we will need to come back to it so leave it open in PHP Designer 2006. so let’s make an adjustment to solve that.S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T The first thing you will notice is the popular and latest news are not aligning at the top of the table they are in.

S T E P T H R E E : C R E A T E O U R F I R S T L A Y O U T 32 .

borders. that is text set with H1 or H2 tags and chances are that this text will be used by search engines 33 . as blue seems to be the most popular colour for our template downloads. So.com/tools/colorscheme2/index-en. Now we can start making this template look good. this is called template_css. We need to decide what colour links. Even though we are not using any graphics we still need a colour scheme. The Site Name The first thing we need to look at is the site name.html For this project I am going to use a monochrome blue theme with a flash of orange. The majority we won’t be using. But there are other considerations. you can however choose your own colours to suit your site. but we will be adding some new styles to the file and editing others. We won’t be using all of them. Here is the range of colours we will be using. just those appropriate for our needs.css and is found in the css folder that is in the duffer1 folder on your PC. Open it using PHP Designer 2006 and if you scroll to the bottom of the file you should see there is around 634 lines in this file.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T Chapter 6: Step Four – Adjust The Style Sheet Here’s where the fun really starts. backgrounds etc are going to be.php open. Let’s be honest it’s ridiculously small at present. If you have difficulty choosing a colour scheme I would suggest visiting this site: Colour Scheme generator http://wellstyled. let’s get on with it. before we dive into the style sheet let’s choose a colour scheme. because for some of the changes we make we also need to make some small additions to this file. You should also still have index. Firstly search engines like header text. If you are looking at this in black and white you will need to use the colour codes after each block to get the actual colours. So. The first step for this section is to open the style sheet file.

back to index. you’ll see the site name is now a bit bigger. save and upload the new index. you should be looking at around line 634 and the last thing you should see in this file is this: span. if we didn’t do this the whole page would turn into H1. The great thing is we can do all of this with the style sheet. What we are going to do is create a style for H1 tags. We don’t want it squashed against the roof of the page. before we do that we need to wrap the site name tag with H1 tags. Back to PHP Designer 2006 and template_css. So. So.php file and take a look. It would also be good to have some space between the top of the page and the site name. but we still need to do some more work. in other words ‘big’. But. height: 1.css.article_seperator { display: block. we are going to add a comment like this: /*we will add our extra tags under here */ 34 . this tag closes the H1 formatting. So.php and change line 13. which looks like this: So that it looks like this: As you can see we have put <h1> before the Joomla tag and </h1> after it. This means the site name will be formatted as heading one text. Secondly we want to frame the menu below the site name. To achieve the rest of our desired look we need to add some new code to the style sheet.5em. rather than just have it hanging there.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T because it’s first on your page. } So we know what we’ve added. Scroll right to the bottom of the file.

css to: /templates/duffer1/css/ This will overwrite the existing file. margin-top: 20px. } Let’s go through each line just so we have some idea of what and why we are adding it. So if later on I ask you to comment something out this is what you need to do. Browse to your web site and hold down Ctrl and while holding it down hit F5.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T So add that just below the very last curly bracket }. font-weight: bold. this will hard refresh the page causing your browser to re-read the CSS file. It’s called commenting out.css then save the file and upload the new template_css. You will notice this sentence starts with /* and ends with */ this tells the browser to ignore what’s in between. cut and paste it into template_css. We are going to add our code below this. padding-bottom: 3px. border-bottom: 7px solid #0055B3. font-size: obviously this sets the size of the font font-weight: sets the font to bold margin-top: this sets a 20 pixel margin outside the font area margin-bottom: this sets a zero margin outside the font area at the bottom border-bottom: this puts a 7 pixel deep border along the bottom of the area and sets the colour of the border • padding-bottom: this sets a distance between the text and the border So. This is what we are going to add: h1{ font-size: 17px. margin-bottom: 0. your page should now look like this: • • • • • 35 .

The first thing we need to do is get rid of that white space between the menu and the bottom of the site name border. We need to change the background colour when we hover over a menu item and the text colour of the links. on the page. Firstly there is a 2 pixel gap between the border/background of each menu item and the bottom border or the site name. There’s a couple of things we want to do here. we want our menu to be aligned at the top.php. a nice gap between it and the top of the page and the border makes a good frame for the menu below it. feel free to make changes. first lets deal with index. flush with the bottom border of the site name.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T It’s starting to take shape. Because we have two columns in this table browsers will naturally place items aligned vertically in the middle. the site name looks better.css and we need to find line 328.php file and upload it to the duffer1 folder. Go to line 18 and add this in the <td> tag: valign="top" It should now look like this: Save the index. that is at /templates/duffer1/ The next step is to edit template_css. Next we are going to look at the top menu. below it. lets make a small addition to the <td> tag for this column. We must take two steps.php in PHP Designer 2006. padding. take a look below to locate it: 36 . Let’s get started! Again we need to open template_css. margin sizes. font size to whatever you want. If you are using Internet Explorer you won’t be seeing this small gap. So. We want these to touch to make it look like the hover is dropping out of that border.css and index. it’s only showing in FireFox browsers. The Top Menu The top menu is the horizontal menu right under the site name. you can change the border colour and thickness. Finally we want to add a bottom margin to give us some white space between the menu and the next items.

php first. So. The final adjustment to this menu is to create some white space below it. so you can make changes here to the font size. let’s do index.css. the one that refers to line height.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T What we need to do is ‘comment out’ line 328. font type and colours. If you want to make further changes to this menu these four blocks: • • • • ul#mainlevel-nav ul#mainlevel-nav li ul#mainlevel-nav li a ul#mainlevel-nav li a:hover Control the look of the top menu. So it looks like this: 37 . to do this use the /* at the beginning of the line and */ at the end of the line.php and template_css. To do this we need to edit both index. where we have the Joomla tag for the top menu.css and it looks like this: Change the code for the background colour to # 0055B3 so it now looks like this: Now scroll to line 78 and change the border-right colour to #0055B3 so it looks like this: Save the file and upload it to check the changes are correct. this will help frame it and the items below it on the page.css file. it should look like this once you have done it. If you want to check and make sure that has worked save and upload the template_css. Go to line 18. what we will do is wrap the tag with a <div> tag. so scroll to line 96 in template_css. Now we need to change the colour when you hover over a link and the border line between each menu item.

css file goes in duffer1/css folder. So now we need to set this class within the template style sheet. 38 .duftopmenu { margin-bottom: 50px. Save both the index. we are going to add our new class after the H1 style we added earlier.css and go right to the bottom of the file.css file should look like this. Next we need to take a look at the search box.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T As you can see we have put this before the Joomla PHP tag: <div class="duftopmenu"> And this after the Joomla PHP tag: </div> What this does is tells the browser to apply that style class to anything in-between those tags.css files and upload them to the duffer1 folder on your web site. Go to your web site and do a hard refresh (Ctrl F5) and take a look.php and template_css. so back to template_css. We are going to add this: . Remember the index.php file goes in the duffer1 folder and the template_css. } This will set a 50 pixel margin at the bottom of the menu and now the bottom of your template_css. As you can see it’s starting to take shape.

search{ float: right.css open in PHP Designer 2006.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T The Search Box Our next task is to get the search box in position and looking right. Let’s get started.php line 19 and we add the align top command to the <td> tag. What we want to do is move it up to the top. } This will move the search box to the right and add a small.php and template_css. into the duffer1 folder.css and go to the bottom of the file. Hopefully by now you are getting the hang of editing and uploading the files. margin-top: 2px. here we need to add this: . Next we edit template_css. so we edit index. 2 pixel gap at the top. about 2 pixels below the site name border. The bottom of your template_css. once again we need index. valign="top" It should look like this when you’ve done that: save the index.css file should now look like this: Save the file and upload it to /templates/duffer1/css/ 39 .php file and upload it to your web site. align it flush to the right of the page and change the border colour to match our colour scheme. First task is to get it aligned at the top.

The section now looks like this: 40 . To do this we need to edit template_css. Latest News We need to make some major changes to the style for these areas. So let’s start with the header row for each of the columns.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T Now we need to change the colour of the border used for the input box so that it matches our colour scheme. change the text colour to #0055B3.css at line 465. popular links and latest news links. Login Box. change the font size to 14 pixels and finally add our bottom border. We are going to remove this and instead have a single one pixel border at the bottom of each header. at present it uses a background image to give it a silver background. The background image behind the titles needs to go and we need to format them so they fit our clean style. Next we need to tackle the three columns that hold the login box. To do this we need to go to line 402 and let’s change the colour to #0055B3 so it looks like this: Save the file and upload. remove the left padding. we are going to comment out the ‘background’ style. You will also notice that the login form input boxes have also changed colour and are now blue to match the search box. Popular. Now if you browse to your site the box should be aligned and in your colours.

S T E P

F O U R :

A D J U S T

T H E

S T Y L E

S H E E T

If we don’t want the words upper case we comment out the ‘text-transform’ line, if you don’t want them bold comment out the ‘font-weight’ line, it’s pretty simple really. Next we need to get rid of the red hyperlinks and change their colour. To do this we need to scroll to line 336, now here you can make them any colour you want, I’m going to use our blue #0055B3. We also need to change the colour when we hover over the link, so let’s set this to the orange from our list of colours #FF8000, plus we’ll add an underline to the hover state. So this class now looks like this:

Next we need to address the image used for the bullets and the fact the lists are very close to the top of the columns. For this we need to scroll to line 300 and adjust it so it looks like this:

As you can see we have added margin-top: 10px; to line 301 in the ‘ul’ class and commented out lines 309 to 313 in the ‘li’ class. We have also changed line 303 to list-styletype ‘square’ (type needed adding to handle Internet Explorer) for the bullet type. We also
41

S T E P

F O U R :

A D J U S T

T H E

S T Y L E

S H E E T

added ‘list-style-position’ so that the bullets line up with the left edge of the title. Save the file and upload, now go and take a look. As you can see we still have the login box to deal with, especially the login button itself. So, let’s get to line 386 in the template_css.css file. This sets the attributes for the button and we’ll change it to look like this:

First we commented out lines 397 to 404, using /* and */ then changed the ‘color’ style to #0055B3 and we added these five rows to create a button with a white background and a solid blue 1 pixel border: border-top: 1px solid #0055B3; border-right: 1px solid #0055B3; border-left: 1px solid #0055B3; border-bottom: 1px solid #0055B3; background: #fff; We have also changed the margin to 2 pixels, this is so Internet Explorer (yuk) doesn’t push the button right up to the previous item. This gives us a button that looks like this: The final thing we need to do is add some white space below it. To do this we need to wrap the Joomla PHP tag with another <div> tag and create a new style at the bottom of our style sheet. So find line 26 in index.php and it will look like this:
42

S T E P

F O U R :

A D J U S T

T H E

S T Y L E

S H E E T

<td valign="top"><?php mosLoadModules ( 'user3' ); ?></td> We need to change it to look like this:

As you can see we have added this before the tag: <div class="duflogin"> And this after the tag: </div> Now go to template_css.css and scroll to the very bottom and add this: .duflogin { margin-bottom: 20px; } It should look like this:

Now save both files and upload them to your website, browse to your web page and do a hard refresh (Ctrl F5). Next we’ll take a look at the pathway. The Pathway The pathway is a breadcrumb menu that tracks a users position relative to the home page. We need to make a few changes to get this to fit into our design. First we need to edit index.php and set a <div> tag around the Joomla pathway tag.
43

We are almost finished.css and upload them to your website. at present they are still in the original red and that doesn’t fit with the colour of our site. We find this starting on line 35 and we need to change it to look like this: As you can see we have changed line 42 so that it reads ‘border-bottom’ instead of just ‘border’ and we have changed the colour to our blue.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T To do this go to line 33 and change it from: <td><?php mosPathWay(). We are going to go through the main area styles all in one go. ?></div></td> You can see we have added <div id="pathway_text"> before the Joomla tag and </div> after it. We are going to make sure we cover all the items on internal pages such as FAQ lists and dynamic section and category areas. Now we can go to template_css. save index. 44 .css and make some changes to the style that is already there for the pathway. ?></td> To this: <td><div id="pathway_text"><?php mosPathWay(). But let’s get started with page titles.php and template_css. Next we added lines 44 and 45 to change the font size and colour. That’s the pathway complete. The Main Body Area This is the area that contains all of your site contents. next we need to look at the main body area.

we will change it as follows: As you can see we have commented out the background item.css again and navigate to line 434 and change it so it looks like this: We have changed line 437 so the colour code is now orange #FF8000. You’ll find this at line 265. Next we need to adjust the ‘back’ button that appears on each section page. change it to the following: 45 . You’ll find this on line 417. Next we want to change the component heading. if you browse to the news section of your site you’ll see it still uses the grey background graphic.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T We need to dive into template_css.

We change it as follows: We also need to change the border colour that surrounds these mini table of contents to #0055B3. Next we need to edit the page navigation for news items and other dynamic content. This is under the pagenav class found on line 280 and we need to change it to this: Next we change the table of contents heading that appears with multiple page articles. change as follows: Now you can save the file and upload it to your web site. If you browse through your site you will now see that everything is now styled in your colours. we find this on line 543.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T You can see we’ve made some major changes to this button. this is on line 554 and called table. you’ve created a really 46 .contenttoc.

Bits and Pieces One thing that we haven’t covered yet is the user menu. If you go to your web sites front page and login using the login form (use your admin username and password) you will see it looks pretty ugly. The first step is to login to your Joomla administrator section and navigate to ‘modules > site modules’ then select ‘user menu’ and click edit. But much more than that you’ve learned a hell of a lot about Joomla templates. but it’s only visible when a user is logged in. it should look like this: If the user menu is above the login form hit the little blue arrow to knock it below it. When you are done it should look like this: Click save and on the resulting page make sure that the menu is positioned below the login form. So. let’s look at that next. clean design. There’s one more thing we must cover and another couple of things that would be useful to know.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T simple. So let’s start with the important stuff. We haven’t put it anywhere on our design and if we have a login box we also need the user menu. This is because we want the menu to appear below the users name and logout button when they are logged in. You need to set ‘show title’ to no and position to ‘user3’ – this puts it in the same box as our login form. something like this: 47 . And it doesn’t stop here. with no graphics.

To do this we need to go back to template_css.css and find line 567 and change it so it looks like this: As you can see we have commented out lines 568. then we comment out lines 577. finally we comment out line 584.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T We need to fix this otherwise our users are not going to have a good experience. 569 and 570. We have then changed the link colours so that they are blue and turn orange on hover. 578 and 579. 48 .

FTP into your web site and go to templates > duffer1 graphics.css file and check out your site. the optional section. to give us a place on the page to place an extra item. but also to run through how we can create a custom module that contains our own text. Once there you will see the graphic navigation buttons at the top right. Firstly. So. let’s create a custom module first.png • pdf_button.png It’s best to also delete these from the duffer1 folder on your PC as well. Before we move on to the next chapter we still have one section to deal with. Login to your Joomla administrator and navigate to modules > site modules. PDF and print images that come with the standard template. The Optional Section If you remember back to our layout we put an ‘optional’ tag at the bottom of the page just above the footer. When you do this you will be presented with a form to complete. This is really easy and all done from the administrator section. From here select the ‘new’ button (shown on the right). What I’ve found is that if you just delete them they are replaced with some nice in fact. as this is important for the next chapter.png • printButton. Finally let’s get rid of those email. So. The reason I added this was twofold. complete this so it looks like this: 49 .S T E P F O U R : A D J U S T T H E S T Y L E S H E E T The final result will now look like this to a logged in user: The change we have just made will also affect the main menu and other menu. these > images once in this folder you need to delete these three images: • emailButton. Upload the template_css.

Scroll to the bottom of the page and you should see our new module in position just above the footer. Now scroll down to the big text area at the bottom of the form and enter some text.php file. As you can see it’s not formatted very well. Now click save and browse to your web site. we have called it ‘optional area’ set ‘show title’ to no. like this. So open up index.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T So.php and change line 39 so it looks like this: As you can see we have added this before the Joomla tag: <div class="dufoptional"> And this after it: </div> 50 . positioned it in the ‘user6’ slot and set it to published. Enter anything you want but try to add a couple of sentences for now. so we need to add a style to it. We are going to do this the same we have for other areas on the index page by adding <div> tags around the Joomla tag in the index.

which gives you great flexibility in what you display in this area. } The bottom of your template_css. background: #fff. margin-top: 20px. some white space above and below and some padding inside the bordered area. border: 1px solid #0055B3. You can create modules for every page. padding: 3px. Add this: . We will add this at the very bottom of the file. What we want to do is create an area for this text that highlights it and separates it from the text above and footer below.dufoptional { margin-bottom: 20px. To do this you need to adjust the settings of each module and select which menu links you want your new module to show up on.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T Our next task is to create the style in template_css. 51 .css. All we need to do now is package it. Believe it or not that’s it.css file should now look like this: And the bottom of your web page should look like this: As you can see we have added a blue border. Your template is complete.

w3.S T E P F O U R : A D J U S T T H E S T Y L E S H E E T W3C Validation One thing we need to do is just make sure the template is W3C valid. When we do this we see the page is valid W3C XHTML Transitional. 52 . What you will see is this error: PHP Designer 2006 has spelt ‘center’ with capital letters. we need to change this to lower case and re-validate the page. by going to http://validator.org we can enter the full URL of our site and see if it validates.

to finish this off and allow you to pass your template onto other people you need to learn how to package it.png</filename> <filename>images/spacer.png</filename> <filename>images/contenthead. You will need WIN ZIP or a similar application to create the zip package.xml file.png</filename> <filename>images/title_back.png</filename> <filename>images/header_short.xml file should now look like this: 53 .png</filename> <filename>images/button_bg. Because that still holds information about image files that we are not using anymore.jpg</filename> <filename>images/menu_bg.S T E P F I V E : P A C K A G E T H E T E M P L A T E Chapter 7: Step Five – Package The template In basic terms that’s everything done.png</filename> Your templateDetails. If we package the template then others will be able to install it directly from their Joomla administrator. You have created your first Joomla template and now you know where everything it will be much easier to create another one. However. Before we move onto that we need to make some adjustments to the templateDetails. open this file in PHP Designer 2006 and remove the following lines: <filename>images/arrow.png</filename> <filename>images/subhead_bg. So.png</filename> <filename>images/powered_by.

Take a screenshot of the page and save it so as to overwrite the current template_thumbnail. indent4. index. I’m going to use WIN ZIP to walk you through the process which is very easy.S T E P F I V E : P A C K A G E T H E T E M P L A T E Save templateDetails.html. indent3. it should look like this: 54 . template_thumbnail. You can see the css and images folder and in the main duffer1 folder you have 4 files.css. rating_star. index.xml. It should look like this. Save the file and open windows explorer.png. rating_star_blank. If you have all of these files you are ready to start packaging the template for Joomla. Next we need a screenshot of our template.php.png and templateDetails. index. Finally move up and then down into the images folder. editor_content.xml Now navigate into the css folder and you should see the following files.png.png and spacer. advertisement.png.html. Open WIN ZIP and you should see this: Click next and select ‘create new zip file’. index. indent2. Navigate to your duffer1 folder.png in the duffer1 folder on your PC.png.png. it should contain. indent1. to replace the one called template_thunmbnail.html and template_css.png.png.css.png.

S T E P F I V E : P A C K A G E T H E T E M P L A T E Click next and you will see a screen asking for a filename. We click the button that says ‘add folders’ and we browse to the duffer1 folder on our PC. Once we have found it click ‘ok’ and you should now see this screen: 55 . type duffer1 into the box. like this: Click next and you will see a screen asking you to add files to this zip package.

Now you can 56 . Best thing is it’s just really simple.S T E P F I V E : P A C K A G E T H E T E M P L A T E Now click ‘Zip Now’ and a zip file will be created in your default WIN ZIP folder. give that zip file to any Joomla user who doesn’t already have the duffer1 template installed and it will self install. To install all they need do is go to their Joomla administrator and navigate to ‘site > template manager > site templates’ Click ‘new’ and they will see this screen: Click the browse button and they will be able to locate the duffer1. once done click ‘upload and install’ and it will be installed and they will see this: That’s it. usually ‘My Documents’. That’s it. found out about Joomla tags to hold content. You have reached the end of this duffer’s guide to creating a Joomla template.zip file on their PC. found your way around the Joomla css file and finally seen how easy it is to package it for distribution. we have just created a Joomla template package others can install. you’ve made a template.

S T E P F I V E : P A C K A G E T H E T E M P L A T E start making your own Joomla templates. Later in this book we will look at editing this template to create a two column and a three column template in about 15 minutes. Here’s what our final template looks like: 57 . We will also look at some advanced Joomla template techniques and how we can add some graphics to our template.

S T E P F I V E : P A C K A G E T H E T E M P L A T E 58 .

It will probably end up named something like ‘copy of duffer1’.php file in the duffer2 folder using PHP Designer 2006. And creating the next one is even easier. Now go to your Joomla administrator and navigate to ‘site > templates > site templates’ here you will see ‘duffer2’ under the duffer1 template we’ve just created. so we need to rename it ‘duffer2’. Let’s do a really simple change first. because we’ve already done most of the hard work. It looks the same as duffer1 at present but that’s going to change. single row table.T W O A N D T H R E E C O L U M N T E M P L A T E Chapter 8: Two Column and Three Column Template We’ve seen just how easy it is to create a Joomla template. so open windows explorer and make a copy of the whole folder. Once this is done open the templateDetails. it should Now click the create table button look like this in PHP Designer 2006: 59 . create a two column single row table and place the Joomla main body tag in the right column and the Joomla left tag in the left column. Now duffer2 is your sites default template.xml file in the ‘duffer2’ folder and change line 3 (name) to this: <name>duffer2</name> Save it and then upload the whole duffer2 folder to the templates folder on your website. First let’s remove the Joomla tag: <td></td> and create a two column. open the index. Scroll down to line 36 and you should see this: <td><?php mosMainBody(). First let’s copy the duffer1 folder. Select the radio button next to ‘duffer2’ and click ‘default’. ?></td> What we need to do is remove the Joomla tag for the main body.

?> You need to place them in this newly created table as follows: <td> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td><?php mosLoadModules ( 'left' ). The first thing is to ensure our left module gets aligned at the top of the table cell. They look like this: <?php mosLoadModules ( 'left' ). to do this we add this valign="top" Plus we need to set the width of the left column and to do this we add this: width="200px" So now the table looks like this: 60 .T W O A N D T H R E E C O L U M N T E M P L A T E It should look something like this. ?></td> <td><?php mosMainBody(). ?> <?php mosMainBody(). ?></td> </tr> </table> </td> I’ve highlighted them so you can see exactly where they go. with the original <td> tags highlighted for you so you can see where the table should be: <td> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td></td> <td></td> </tr> </table> </td> Now we need to add the two Joomla tags. one for the left module position and one for the main body text. Now we need to make a few changes to the table to ensure it looks okay.

this will look like this: <td> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td width="200px" valign="top"> <div class="dufleft"> <?php mosLoadModules ( 'left' ). ?></td> </tr> </table> </td> I’ve highlighted these changes in pink so you can see where they go. ?></td> </tr> </table> </td> I’ve highlighted this green so you can see it. ?> </div> </td> <td valign="top"><?php mosMainBody(). So your index. Now open the template_css. Scroll to the very bottom and add this: 61 .css file in the duffer2/css folder. ?></td> <td valign="top"><?php mosMainBody().php file and upload it to the duffer2 folder on your web site.T W O A N D T H R E E C O L U M N T E M P L A T E <td> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td width="200px" valign="top"> <?php mosLoadModules ( 'left' ). just in case we have short amounts of text in here. Notice I have also add the valign to the main body column too.php file should be looking something like this: Save the index. Finally we need to wrap the left module tag with a <div> class so we can add some formatting to it.

} It should look like this now: Save the file and upload it to the css folder in the duffer2 folder on your website.T W O A N D T H R E E C O L U M N T E M P L A T E . hard refresh the page (Ctrl F5) and take a look. it should now look like this: 62 . Now browse to your web site.dufleft { margin-right: 40px.

we need to add these three: <td><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td><?php mosLoadModules ( 'left' ).xml and change the name tag to duffer3. like this: <td></td> And instead of putting a two column table in between the <td> and </td> tag we put a 3 column table. ?></td> <td><?php mosMainBody(). To do this we simply copy the duffer1 folder again but this time rename the copy as ‘duffer3’. What we’ll do now is create a 3 column template.php now looks like this: <td><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td></td> <td></td> <td></td> </tr> </table></td> I’ve highlighted the original <td> tags that we didn’t delete. Remember it looks like this: <td><?php mosMainBody().T W O A N D T H R E E C O L U M N T E M P L A T E Now you can place modules in the ‘left’ position and they will show up on your web site in that left column. ?></td> </tr> </table></td> This time we also need to wrap both the left and right Joomla tags with a <div> class and make sure we set the width and top align on all three columns. 63 . Now we have three columns to fill with Joomla tags. We need to open templateDetails. The html for line 36 in index.php from the duffer3 folder and get to line 36 again. ?></td> We delete the Joomla tag to leave just the <td> tags. ?></td> <td><?php mosLoadModules ( 'right' ). Then we open index.

css folder. Now browse to your site and take a look. Notice we have set both the left and right column to 200 pixels wide. Now save the index.dufright { margin-left: 40px. Go to your Joomla administrator and navigate to sites > templates > site templates and set duffer3 as default.T W O A N D T H R E E C O L U M N T E M P L A T E That’s what the final html should look like. } This will make sure the 3 columns are not touching each other. 64 .css file in the duffer3.php file back into the duffer3 folder and open the template_css.dufleft { margin-right: 40px. } . this is on line 11 and looks like this: <table align="center" width="700" cellpadding="0" cellspacing="0"> We need to change it to this: <table align="center" width="850" cellpadding="0" cellspacing="0"> Making it 150 pixels wider. To accommodate this we also need to adjust the overall width of the main table. We need to add the following to the bottom of this file: . Save all of the files and upload the whole duffer3 folder to the templates directory on your web site.

as it would be great to see thousands of people all making their site unique. Make a few of your own. In the next section we are going to look at some advanced techniques including adding some graphics to your page. Use the <div> tag to surround Joomla tags and add basic formatting like margins and colours. just remember you can’t break anything so mess around. see what works for you and what doesn’t. Keep trying different things as just about anything is possible. If you want your site to stretch the whole width of the page set the main table width to 100% instead of 850px. you now have a three column template.T W O A N D T H R E E C O L U M N T E M P L A T E That’s it. To get used to working with the templates start practicing. I hope this has given you some skills that can help inspire you to try making your own templates. 65 .

T W O A N D T H R E E C O L U M N T E M P L A T E 66 .

Set your site so it’s using duffer1 as the default template.jpg) repeat-x..jpg and looks like the picture here on the right.A D V A N C E D T E C H N I Q U E S Chapter 9: Advanced Techniques I want to cover some of the more advanced techniques you can use when developing Joomla templates. The first thing we will do is add a background image similar to the one we use on http://combtail. To add this we upload it to the images folder found in the duffer1 folder on your web site.com it’s a 50 x 50 pixel square gradient graphic repeated along the top of the page. Firstly let’s look at adding a couple of different background images and see what affect this has on the overall design. Then we need to edit line 343 of the duffer1 template_css./images/duf_back1. The graphic is in our download section in the images folder and called duf_back1. We’ll use that for this example. That section now looks like this: Save the file and upload to the css folder in the duffer1 folder on your web site. There are some basic ways you can change the look of the templates we have just created by adding some images.css and change the line to this: background: #fff url(. First the use of graphics when creating a template and then some of the style tags we can add to the Joomla tags to add some extra formatting. Browse to your site and do a hard refresh (Ctrl F5) and it should look like this: 67 .

As you can see we have changed the image name and added a line that center’s the image on the page.jpg) repeat-y. you will see the site name has moved down.jpg to the images folder of duffer1 and make this change to line 343 of template_css.css file and take a look at your web site. background-position : center top.css: background: #fff url(./images/duf_back4. First let’s upload another images. As you can see we have changed the image name and changed the ‘x’ to a ‘y’ this will repeat the image down the left hand side of the page and will look like this: Next let’s use an image to frame the content on the left and right. it looks like this: Save and upload and take another look at the site. called duf_back3. for this upload duf_back4.jpg and make this change to template_css. Upload the saved template_css.css: background: #0055B3 url(. Plus we have changed the background colour to #0055B3 so it matches the blue on the edge of our image. but we may need to make other adjustments depending on what we change it to.A D V A N C E D T E C H N I Q U E S To tidy up the site name position we may want to increase the margin size to the top of the page. Now we can play around with the background image.jpg) repeat-y./images/duf_back3.css and find line 658 ‘margin-top’ to 50px.. So. once again we edit template_css. it should look like this: 68 ..

Simple changes to your background can be made and can have a great overall effect on your web page.A D V A N C E D T E C H N I Q U E S As you can see the content is now framed right and left with our blue background. Adding a Logo One of the things you will need to consider if you are packaging templates for other people is image location.?>/templates/duffer1/images/duf_back5.jpg" height="63" alt="logo" /> width="309" The problem with doing this is that you won’t know whether the user of the template is going to install Joomla in the root of their web site. because it’s looking for it in: /templates/duffer1/images/duf_back5. we can get Joomla to dynamically find all of the path. They may install it in a folder within the root. as follows: 69 . We can improve this further by dynamically grabbing the template name as well.jpg The actual position may be: /joomla/templates/duffer1/images/duf_back5.?> This grabs the URL of the site from the Joomla config file and so will always find our image. So if you want to add a logo to your template or a header graphic you would normally use an image tag like this: <img src="/templates/duffer1/images/duf_back5. Use the images supplied as templates to make your own background colours.jpg" width="309" height="63" alt="logo" /> What we’ve done is added this to the front of the path to the image: <?php echo $mosConfig_live_site.jpg So. so we can use a tag like this: <img src="<?php echo $mosConfig_live_site. This would mean the above tag wouldn’t find the image.

The file should now look like this: Save the index file and upload it to the duffer1 folder and browse to your site. ?>/images/duf_back5.jpg" width="309" height="63" alt="logo" /> What we have done is replaced ‘duffer1’ in the image path with this Joomla tag: <?php echo "$GLOBALS[cur_template]".A D V A N C E D T E C H N I Q U E S <img src="<?php echo $mosConfig_live_site.?>/templates/<?php echo "$GLOBALS[cur_template]". And users can replace the duf_back5. It should look like this: If you package up the template now it wouldn’t matter where on a persons site they had Joomla installed the template would still know exactly where it had to find the logo image. So.jpg image with their own logo as long as they give exactly the same name and make it the same size.jpg to the duffer1 images folder and make this change to line 13 of the duffer1 index.jpg" width="309" height="63" alt="logo" /></h1></td> We removed the Joomla site name tag and put our image tag in between the two <h1> tags. ?>/images/duf_back5.php: <td><h1><img src="<?php echo $mosConfig_live_site. let’s test it out. upload the duf_back5.?>/templates/<?php echo "$GLOBALS[cur_template]". Complex Joomla Tags Joomla does allow for a certain amount of formatting by adding certain switches to each Joomla tag you add to your template. Normally you would add a tag that looks like this: 70 . ?> Using these Joomla tags in image paths can save a lot of trouble trying to determine exactly where an image is.

for example. Here’s a quick run through of the various switches you can use and what affect they will have on your content.2. like this: • -1 (minus one) Modules are displayed as raw output. However.org/content/view/33/125/ ) states that “Modules are displayed in a format that allows. This option was introduced in Mambo 4. Again no real explanation but it uses <div> tags again. I hope you have enjoyed it and found it useful. we can add a switch to the tag like this: <?php mosLoadModules ( 'user2'.5. ?> As you can see we have added a comma and 0 (zero) after the user2 tag. one on top of the other. That brings us to the end of this tutorial. ?> This then adds Joomla modules that are positioned in the user2 area. For us duffers we’ll stick to what we know and format using the basic tag and CSS.1. so no formatting will be applied to them • -2 (minus two) Joomla call this X-Joomla format. so modules put in this position will be stacked in a column. You should now know your way around the Joomla template system and be capable of putting together your own simple templates. 0 ).joomla. I can’t find any description of what exactly this means but the output uses <div> tags instead of a table for the formatting. Check out the appendices at the end of this book for important information on Joomla tags and for all of the code used in the creation of this book. stretchable rounded corners. Good luck and happy templating! 71 . • 0 (zero) This is the default display. They will look like this: • 1 (one) Modules will be displayed horizontally. • -3 (minus three) Joomla help (http://help.A D V A N C E D T E C H N I Q U E S <?php mosLoadModules ( 'user2' ).

The spacer image is a standard part of the raw material we started with in step one. The site name will be H1 and the description H2 – it will look like this: 72 . In the second row we are going to hard code our site name and our description.T H E C L U B T V K T E M P L A T E Chapter 10: The ClubTVK Template Let’s pull together everything we have learned and create one last unique template. The code looks like this: <tr> <td> <div class="clubtvktop"> <img src="<?php echo $mosConfig_live_site. However we will condense the tutorial to cover all the major sections. Change the name and all of the details we learned about earlier in chapter 4. Create a folder on your PC called ‘clubtvk’ and then download the contents of the /templates/rhuk_solarflare_ii/ folder from your Joomla web site into this folder on your PC.xml file in your new ‘clubtvk’ folder. page 9. We are going to create the actual template used on the ClubTVK web site. that is 725 pixels wide. Step 1 Grab The Raw Material Again we are going to start with the rhuk_solarflare_ii template as our raw material. Step 2 Make a Home for the Template Open PHP Designer 2006 and edit the templateDetails. we are going to use a centered table. Let’s go through each row: In the top row we are going to put a spacer image and create a div to give us a top border in our chosen colour.?>/templates/<?php echo "$GLOBALS[cur_template]". We have also used the advanced technique in the image path to dynamically get the site URL and template name. Now log into your Joomla administrator and set the clubtvk template as default. ?>/images/spacer. with one column and 7 rows. Step 3 Layout The layout is very simple. move into the templates folder and upload the clubtvk folder and all of it’s contents to your web site. Once you have done this FTP to your web site.png" width="1" height="1" alt="" /> </div> </td> </tr> As you can see we have wrapped the image path with a div class (highlighted yellow) so we can format the colour and size of this section in the style sheet. We’ll use the same 5 steps as we did for all the previous templates.

T H E C L U B T V K T E M P L A T E <tr> <td> <h1>Clubtvk . you will need to create a module in Joomla and set it to the user1 position. Here is the HTML for that row: <tr> <td> <div class="clubtvktext"> <?php mosLoadModules ( 'user1'. Here’s the HTML: 73 . -1 ). also make sure no other modules are using this position. So. Row 3 is going to hold a custom module. Confused? It will become clear. Most important is we have used the Joomla advanced styling switch (.A Beginners Guide</h2> </td> </tr> As you can see highlighted in yellow the two H1 tags and the two H2 tags. ?> </td> </tr> We don’t need to use a div class style for this because the changes will be made to the top menu style that already exists in the style sheet. highlighted yellow. Also notice the BR tag (highlighted green) this ensures the site description we have put in goes onto a new line. Here we need to insert another table because this row will hold the main body tag in a left column and the left tag in a right column. 1) highlighted green. we will add styles for these later in the style sheet. ?> </div> </td> </tr> As you can see we have wrapped the Joomla tag with a div tag so we can style it.</h1><br /> <h2>Make a Joomla Template in 5 Easy Steps . Row 5 is a bit more complex than the previous rows. This means our div class can have a unique effect just on this part. remember we covered how to create a module in an earlier chapter. The HTML looks like this: <tr> <td> <?php mosLoadModules ( 'user2' ). Row 4 is where we are going to put the Joomla top menu. to turn off the Joomla formatting.

?> </div> </td> </tr> </table> </td> </tr> Highlighted green is the original table row tags.T H E C L U B T V K T E M P L A T E <tr> <td> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <div class="clubtvkmbody"> <?php mosMainBody(). We have set the two <td> tags of this new table to vertically align to the top and set the width of the right column to 125 pixels. 2 column. As you can see we have put the main body tag in the left of the two columns and the Joomla left tag in the right hand column. ?> </div> </td> </tr> As you can see we have wrapped the Joomla tag with a div class so we can style it and we have also added the -1 switch to the Joomla tag to remove any pre-set formatting Joomla tries to add. We have also wrapped each Joomla tag with a div class so we can style these sections in the style sheet. ?> </div> </td> <td valign="top" width="125"> <div class="clubtvkmenu"> <?php mosLoadModules ( 'left' ). this is the column where our main menu and login form will go. 100% wide table in between the original <td> tags of that row. Added just in case we want to add some unique module at the bottom of each page. Row 6 is an optional row again. what we have done is place a single row. We used the Joomla left tag because this is the position that the modules we want in this column naturally appear in a standard Joomla install. The HTML looks like this: <tr> <td> <div class="clubtvkoptional"> <?php mosLoadModules ( 'user3'. -1 ). It saves us moving them to somewhere else. Row 7 is our final row and contains our footer tag: 74 .

w3.w3.dtd"> <html xmlns="http://www. ?></div></td> </tr> <tr> <td><div class="clubtvktop_menu"><?php mosLoadModules ( 'user2' ). ?>/images/spacer. ?></div></td> </tr> <tr> <td><?php include_once('includes/footer.?>/templates/<?php echo "$GLOBALS[cur_template]".</h1><br /><h2>Make a Joomla Template in 5 Easy Steps . let’s have a look at the complete HTML for this layout: <?php defined( "_VALID_MOS" ) or die( "Direct Access to this location is not allowed. ?> <?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_cs s.php'). ?></div></td> <td valign="top" width="125"><div class="clubtvkmenu"><?php mosLoadModules ( 'left' ).A Beginners Guide</h2></td> </tr> <tr> <td><div class="clubtvktext"><?php mosLoadModules ( 'user1'. } ?> <meta http-equiv="Content-Type" content="text/html. ?> </td> </tr> Nothing fancy here just the Joomla footer tag. So. ?> </head> <body> <table align="center" width="725" cellpadding="0" cellspacing="0"> <tr> <td><div class="clubtvktop"><img src="<?php echo $mosConfig_live_site.org/TR/xhtml1/DTD/xhtml1-transitional.php').css\" type=\"text/css\"/>" .org/1999/xhtml"> <head> <?php if ( $my->id ) { initEditor().ico\" />" . -1 ).?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1. -1 ).png" width="1" height="1" alt="" /></div></td> </tr> <tr> <td><h1>Clubtvk ." ). ?></div></td> </tr> </table></td> </tr> <tr> <td><div class="clubtvkoptional"><?php mosLoadModules ( 'user3'.0 Transitional//EN" "http://www.T H E C L U B T V K T E M P L A T E <tr> <td> <?php include_once('includes/footer. ?></div></td> </tr> <tr> <td><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><div class="clubtvkmbody"><?php mosMainBody(). ?><?php echo "<link rel=\"shortcut icon\" href=\"$GLOBALS[mosConfig_live_site]/images/favicon. ?></td> </tr> </table> </body> </html> 75 . charset=iso-8859-1" /> <?php mosShowHead().

margin-bottom: 20. margin-bottom: 0. padding-bottom: 3px. this is where we stripped away the Joomla formatting using the -1 switch in index. Next we need to save this file and upload it to the templates/clubtvk folder on our website. padding-bottom: 3px. line-height: 100%. the style sheet. then we add a margin to give us the desired gap between the text and top/bottom. Here is the first of them. The first thing we need is some additions to the style sheet to cover the new style classes we have used in index. margin-top: 70px.php. They are all added to the bottom of template_css.clubtvktext { font-size: 18px.css in the clubtvk/css folder. } h2{ font-size: 22px. padding-bottom: 1px. . colour and weight. color: #996600.clubtvktop { background: #CC9933. Next we set the style for the H1 and H2 tags that surround our site name and description h1{ font-size: 32px. } We have set the colour for the border and made it 10 pixels deep. it sets the style for the top border we added to the page (the place where the spacer image is). color: #663300. margin-bottom: 0. margin-top: 20px. Once done we can move onto step 4. . The next tag we add to the file is for the text in the custom module. font-weight: bold. } These two styles are pretty self explanatory. padding-bottom: 10px. we set the font size. padding-left: 40px.php. } 76 . margin-top: 0px. color: #cc9999.T H E C L U B T V K T E M P L A T E That’s how easy it is to create a unique layout. Step 4 The Style Sheet Let’s run through this the same way we did for the layout.

All straight forward stuff. float: left. . we will start at the top of the file and work down. padding-right: 0px. line-height: 21px. So.*/ } As you can see the border is commented out and font size increased.css.clubtvkoptional { font-size: 18px. padding-left: 0px. white-space: nowrap. margin-bottom: 20. color: #cc9999. } The only difference is we have removed the left padding to make this text align with the left hand side of the page. The first section we come to that needs changes is the part that controls the ‘top menu’ it’s controlled by the section called mainlevel-nav and will be around line 70 in template_css. Next we add the style for the main body content.clubtvkmenu { padding-left: 10px.T H E C L U B T V K T E M P L A T E Nothing too scary in that tag. /*border-right: 1px solid #cccccc. border-left: 1px dashed #cccc99. These are all modifications to styles that already exist within the file. we are just setting the font size and colour as well as the margins and padding for the area. font-size: 16px. The final style we add here at the bottom is for the optional box. The next style is for the menu on the right of the page. basically it’s the same as the previous custom module style and looks like this: .clubtvkmbody { padding-right: 10px. margin-top: 20px. padding-left: 0px. margin: 0. line-height: 100%. } We’ve put a 10 pixel padding to move the content away from the border and we have added a left border that is dashed. 77 . padding-bottom: 20px. it looks like this: .css. Let’s move onto the other changes needed in template_css. } All we have done with this tag is make it pad the main body content away from the border we added in the previous style. You need it as follows: ul#mainlevel-nav li { background-image: none.

That should take care of the top menu section. padding-right: 3px. a:visited { color: #cc9933. sans-serif. border-right: 1px solid #cc9933.button { color: #cc9933. change to this: . } ul#mainlevel-nav li a:hover { color: #a7a7a7. padding-left: 3px. text-decoration: none. } The padding and colours have been changed. background: #f4f4f4. text-decoration: none. border-top: 1px solid #cc9933.T H E C L U B T V K T E M P L A T E Staying with this section let’s go through the rest of the changes: ul#mainlevel-nav li a { display: block. font-weight: bold. /*font-weight: bold. background: transparent. Next we go to line 396 and find the button style. text-align: center.*/ } a:hover { color: #cccc99. color: #a7a7a7. Right below this you will find the inputbox style and this needs changing to this: 78 . Next we will look at the Joomla core stuff.*/ } As you can see bold has been commented out and the link colours changed. } #buttons>ul#mainlevel-nav li a { width: auto. font-size: 11px. border-left: 1px solid #cc9933. at around line 334 you will find this section: /* Joomla core stuff */ a:link. Hevlvetica. } As you can see some major changes to the button style. /*font-weight: bold. font-family: Arial. border-bottom: 1px solid #cc9933. text-decoration: none. background: #fff. margin: 2px.

font-weight: bold. text-align: left. height: 21px. div. } A few lines below the above you find contentheading and contentpagetitle. padding-top: 0px.T H E C L U B T V K T E M P L A T E .componentheading { /*background: url(.moduletable h3 { /*background: url(.png) repeat-x. /*font-weight: bold.inputbox { padding: 2px.. text-transform: uppercase. height: 21px. } Directly below the inputbox style is the heading style for components.moduletable th. font-size: 10px./images/subhead_bg.*/ color: #996600. font-size: 10px./images/subhead_bg. } . at around line 471 you will find this section. margin: 0 0 2px 0. font-weight: bold. color: #996600. /*font-weight: bold.png) repeat-x. border-bottom: 2px solid #ccc.. change these as follows: . text-transform: uppercase. padding-left: 0px.*/ font-size: 16px.contentheading { height: 30px. } Next we move onto the main menu section at around line 557. border:solid 1px #cc9933. text-align:left. padding-left: 0px.contentpagetitle { font-size: 16px. change it to this: . padding-top: 4px.*/ color: #ccc. change as follows: table. } Just below this. text-align: left. change it so it looks like this: 79 . white-space: nowrap.*/ color: #ccc. background-color: #ffffff. line-height: 21px.

That’s it. a.mainlevel#active_menu { color:#cc9933. padding-top: 5px.mainlevel:hover { /*background-position: 0px -25px. width: 100%. /*font-weight: bold. text-align: left.*/ font-size: 11px. the style sheet is now finished. vertical-align: middle.png) no-repeat. } a. background: url(./images/menu_bg. } a.mainlevel#active_menu:hover { color: #cccc99.mainlevel:link..mainlevel:visited { /*display: block.T H E C L U B T V K T E M P L A T E a. } Quite a few changes in the above section so work through them carefully.*/ } a.*/ text-decoration: none.*/ text-decoration: none. color: #cccc99. height: 25px. Save the files and upload them to your template folder ‘clubtvk’ and you should have a template and site that looks like this: 80 . /*font-weight: bold.*/ color: #cc9933. padding-left: 0px. /*height: 20px !important.

The End That’s how easy it is to create a Joomla template in 5 easy steps without any graphic design or programming knowledge. drop me an email and I will showcase any templates you make on our site.T H E C L U B T V K T E M P L A T E Step 5 Package The Template All that’s left is to package up the template and you are finished. I look forward to seeing your templates when you’ve done them. The more you do it the easier it will become. 81 .

strategic web design and consulting Founder and current CEO of m.utiny. Gary Launched The Venture Kit on the 16th of Jan 2006 82 .com blog host provider Gary drove both PowerVPS and AccountLab to top of their respective markets. acquired by Defender Technologies October 2004) • Founder and CEO of AccountLab (founded Feb 2005. you can view Gary's blog here Former Projects: • Founder and CEO of Blue Box Internet (founded March 2000. with PowerVPS in just six months. acquired by RL October 2003) • Founder and CEO of PowerVPS (founded Feb 2004. acquired by Netenberg April 2005) Current Projects: Founder and current CEO of The Venture Kit Founder and current CEO of Combtail .A B O U T G A R Y R E I D Chapter 10: About Gary Reid Gary Reid is 4 time Internet entrepreneur and author of The Web Driven Entrepreneur .

A B O U T G A R Y R E I D 83 .

} ?> <meta http-equiv="Content-Type" content="text/html. ).?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1. ?><?php echo "<link rel=\"shortcut icon\" href=\"$GLOBALS[mosConfig_live_site]/images/favicon.w3. ?> Joomla Site Path Tag <?php echo $mosConfig_live_site. ). ). ).org/1999/xhtml"> <head> <?php if ( $my->id ) { initEditor().0 Transitional//EN" "http://www. ?> ?> ?> ?> ?> ?> ?> ?> ?> Joomla Pathway Tag <?php mosPathWay(). ). ). charset=iso-8859-1" /> <?php mosShowHead().ico\" />" . ?> <?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_cs s.w3.dtd"> <html xmlns="http://www.org/TR/xhtml1/DTD/xhtml1-transitional.A P P E N D I X 1 J O O M L A T A G S Appendix 1: Joomla Tags Below are all the tags that can be used to include Joomla content in your template: Joomla Head Tag This must be used at the top of your Joomla template index. ?> Joomla Main Body Tag <?php mosMainBody(). ).php'). ?> Joomla Site Name Tag <?php echo $mosConfig_sitename.?> 84 .php file: <?php defined( "_VALID_MOS" ) or die( "Direct Access to this location is not allowed. ?> </head> <body> Joomla Footer Tag Include this tag to display the Joomla footer: <?php include_once('includes/footer. ). ?> Joomla Tags <?php <?php <?php <?php <?php <?php <?php <?php <?php mosLoadModules mosLoadModules mosLoadModules mosLoadModules mosLoadModules mosLoadModules mosLoadModules mosLoadModules mosLoadModules ( ( ( ( ( ( ( ( ( 'user1' 'user2' 'user3' 'user4' 'user5' 'user6' 'user7' 'user8' 'user9' ).css\" type=\"text/css\"/>" ." ).

?> -1 ). 'user2'. ?> Joomla Tags with Switches <?php <?php <?php <?php <?php mosLoadModules mosLoadModules mosLoadModules mosLoadModules mosLoadModules ( ( ( ( ( 'user2'. 'user2'. ?> -2 ). ?> -3 ). 0 ).A P P E N D I X 1 J O O M L A T A G S Joomla Template Path Tag <?php echo "$GLOBALS[cur_template]". ?> 1 ). 'user2'. ?> 85 . 'user2'.

?></h1></td> </tr> <tr> <td><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><div class="duftopmenu"><?php mosLoadModules ( 'user1' ).php'). ?></td> </tr> <tr> <td><div class="dufoptional"><?php mosLoadModules ( 'user6' )." ). ?></td> <td valign="top"><?php mosLoadModules ( 'user5' ). } ?> <meta http-equiv="Content-Type" content="text/html.?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.dtd"> <html xmlns="http://www. ?></div></td> <td valign="top"><?php mosLoadModules ( 'user4' ).org/TR/xhtml1/DTD/xhtml1-transitional. ?> </head> <body> <table align="center" width="700" cellpadding="0" cellspacing="0"> <tr> <td><h1><?php echo $mosConfig_sitename. ?></td> </tr> </table> </body> </html> 86 . ?></div></td> </tr> <tr> <td><?php mosMainBody(). ?></td> </tr> </table></td> </tr> <tr> <td><div id="pathway_text"><?php mosPathWay().0 Transitional//EN" "http://www. ?></div></td> </tr> <tr> <td><?php include_once('includes/footer. ?></td> </tr> </table></td> </tr> <tr> <td><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><div class="duflogin"><?php mosLoadModules ( 'user3' ). charset=iso-8859-1" /> <?php mosShowHead(). ?> <?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css.A P P E N D I X 2 D U F F E R 1 H T M L Appendix 2: Duffer1 HTML Below is the HTML used for the duffer 1 template: <?php defined( "_VALID_MOS" ) or die( "Direct Access to this location is not allowed.css\" type=\"text/css\"/>" .ico\" />" .w3.org/1999/xhtml"> <head> <?php if ( $my->id ) { initEditor(). ?><?php echo "<link rel=\"shortcut icon\" href=\"$GLOBALS[mosConfig_live_site]/images/favicon. ?></div></td> <td valign="top"><?php mosLoadModules ( 'user2' ).w3.

rockettheme.com at http://www.png</filename> <filename>images/indent4.0</version> <description>A template created from the duffer's tutorial.xml file: <?xml version="1.png</filename> </files> <images> <filename>images/advertisement.css</filename> </css> </mosinstall> 87 .com</authorEmail> <authorUrl>http://combtail.0.0"> <name>duffer1</name> <creationDate>03/15/06</creationDate> <author>Gary Reid</author> <copyright>GNU/GPL</copyright> <authorEmail>gary@combtail.xml Below is the contents of the completed templateDetails.php</filename> <filename>template_thumbnail.png</filename> </images> <css> <filename>css/template_css. the template uses a developed version of the CSS file from the rhuk_solarflare_ii template developed by rhuk@rockettheme. X M L Appendix 3: Duffer1 templateDetails.com</authorUrl> <version>1.png</filename> <filename>images/indent1.0" encoding="iso-8859-1"?> <mosinstall type="template" version="1.com </description> <files> <filename>index.png</filename> <filename>images/indent2.png</filename> <filename>images/indent3.A P P E N D I X 3 D U F F E R 1 T E M P L A T E D E A T I L S .

These resources are only available to legitimate purchasers of this book and are available at http://clubtvk. Use of this e-book signifies your acceptance of the license below. 88 .A P P E N D I X 4 A D D I T I O N A L R E S O U R C E S Appendix 4: Additional Resources To help in your use of this book we have put together some additional resources. Including downloads of all of the templates and files used in the book and a forum where you can discuss Joomla Templates.com When you purchase the book you are automatically granted access to the private areas of this site.

You may also have other rights that vary from state to state. remove. a non-exclusive. or warrant that the e-book will meet your requirements or that the operation of the e-book will be uninterrupted or error-free. You may not give copies of the e-book to others. You may make reasonable back-up copies of the e-book to avoid losing it. print. You may download or install the e-book onto your computer. timeshare. Without Warranty. 7. Your Agreement. All content in the e-book is copyrighted under the UK Copyright laws. including. 5. the services of a competent professional should be sought. 89 . Please read the License Agreement carefully. except for reasonable backup copies. This e-book is designed to provide accurate and authoritative information in regard to the subject matter covered. or in any way exploit any of the e-book's content. and Gary Reid owns the copyright and the e-book itself. the above exclusions may not apply to you as some states do not allow the exclusion of implied warranties. Gary Reid does not guarantee that the information in this e-book is error-free. create derivative works from. Purchaser will be liable for any damage resulting from any violation of this License Agreement. delete. 8. (2) duplicate the e-book. and Resale Prohibitions. A license to use the e-book is sold with the understanding that the publisher is not engaged in rendering legal. The entire risk as to the results and performance of the e-book is assumed by you. or make the e-book available for others to copy or download. You shall not: (1) rent. (3) remove any proprietary notices. accounting. Copyright. including. including any infringement of copyrights or proprietary rights. 2. Gary Reid agrees to grant. Risk. labels. In no event will Gary Reid be liable for any damages.A P P E N D I X 5 L I C E N S E A G R E E M E N T Appendix 5: E-Book License Agreement This e-book contains copyrighted material. 4. The e-book is provided "as is" without warranty of any kind. or transfer all or part of the e-book or any rights granted by this license agreement to any other person. The unauthorized use or distribution of copyrighted or other proprietary content is illegal and could subject the purchaser to substantial money damages. Your use of the e-book constitutes your agreement to the above terms and conditions. distribute. If legal advice or other expert assistance is required. sell. without limitation. in whole or in part. and you (the person who has purchased or received the e-book) agree to accept. non-transferable license to install and use the e-book under the following terms and conditions: 1. which essentially says that you mustn't give away or sell copies of the e-book you just purchased. Liability. Its use is subject to the following License Agreement. Professional Services. 6. modify. augment. incidental and consequential damages and damages for lost data or profits arising out of the use or inability to use the e-book. You may not give printed pages from the e-book or the entire printed e-book to others. implied warranties of merchantability and fitness for a particular purpose. assign. either express or implied or statutory. Other than as stated in this License Agreement. The entire liability of Gary Reid shall be limited to the amount actually paid by you for the e-book license. without limitation. If the e-book was purchased in the United States. or marks from the e-book. and you may not aid or permit others to do so. publish. You may print the e-book for your personal use. resell. you may not copy. add to. Use. (4) transfer or sublicense title to the e-book to any other party. Printing. or other professional service. transmit. 3. Installing Onto Your Computer.

png</filename> <filename>images/indent4.0" encoding="iso-8859-1"?> <mosinstall type="template" version="1.png</filename> </images> <css> <filename>css/template_css.A P P E N D I X 6 C L U B T V K T E M P L A T E D E T A I L S .com</authorEmail> <authorUrl>http://clubtvk.png</filename> </files> <images> <filename>images/advertisement. X M L Appendix 6: ClubTVK templateDetails.css</filename> </css> </mosinstall> 90 .png</filename> <filename>images/arrow.0</version> <description>Clubtvk main site template</description> <files> <filename>index.0"> <name>clubtvk</name> <creationDate>03/20/06</creationDate> <author>Gary Reid</author> <copyright>Commercial see licence</copyright> <authorEmail>gary@combtail.png</filename> <filename>images/indent1.png</filename> <filename>images/indent2.png</filename> <filename>images/spacer.png</filename> <filename>images/indent3.xml <?xml version="1.png</filename> <filename>images/button_bg.com</authorUrl> <version>1.0.php</filename> <filename>template_thumbnail.

w3.php'). ?></div></td> <td valign="top" width="125"><div class="clubtvkmenu"><?php mosLoadModules ( 'left' ). -1 ). ?><?php echo "<link rel=\"shortcut icon\" href=\"$GLOBALS[mosConfig_live_site]/images/favicon. ?></td> </tr> </table> </body> </html> 91 .css\" type=\"text/css\"/>" . ?> </head> <body> <table align="center" width="725" cellpadding="0" cellspacing="0"> <tr> <td><div class="clubtvktop"><img src="<?php echo $mosConfig_live_site.org/TR/xhtml1/DTD/xhtml1-transitional.A P P E N D I X 7 C L U B T V K I N D E X .?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.dtd"> <html xmlns="http://www. P H P Appendix 7: ClubTVK index. } ?> <meta http-equiv="Content-Type" content="text/html. ?></div></td> </tr> <tr> <td><div class="clubtvktop_menu"><?php mosLoadModules ( 'user2' ). ?></div></td> </tr> </table></td> </tr> <tr> <td><div class="clubtvkoptional"><?php mosLoadModules ( 'user3'.w3.ico\" />" . ?></div></td> </tr> <tr> <td><?php include_once('includes/footer.</h1><br /><h2>Make a Joomla Template in 5 Easy Steps . charset=iso-8859-1" /> <?php mosShowHead().?>/templates/<?php echo "$GLOBALS[cur_template]".png" width="1" height="1" alt="" /></div></td> </tr> <tr> <td><h1>Clubtvk . ?>/images/spacer.php <?php defined( "_VALID_MOS" ) or die( "Direct Access to this location is not allowed. ?></div></td> </tr> <tr> <td><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><div class="clubtvkmbody"><?php mosMainBody().org/1999/xhtml"> <head> <?php if ( $my->id ) { initEditor()." ).A Beginners Guide</h2></td> </tr> <tr> <td><div class="clubtvktext"><?php mosLoadModules ( 'user1'.0 Transitional//EN" "http://www. ?> <?php echo "<link rel=\"stylesheet\" href=\"$GLOBALS[mosConfig_live_site]/templates/$GLOBALS[cur_template]/css/template_css. -1 ).