Wednesday, June 29, 2011

How to create a joomla template?

In this article we will lay the groundwork for understanding the necessary techniques for making a joomla template, the famous and fasted CMS. Have you already tried but you gave up quick? You understood nothing while browsing the folders? Do you think it’s difficult?
You are something wrong, enough to understand the method. You don’t believe me?
Before beginning let us see which are the advantages and disadvantages of using a cms for the development of a website.
  • A large of quantity  codes and queries has to be executed even though the website is very light. This reduces performances which, on a traditional website, would undoubtedly be superior.
  • A joomla installation occupies more than 20Mb.
  • We’ll be tied to a theoretical example (this is not necessarily a disadvantage). A high level of structuring, like in every cms, binds us to a precise methodology. And this is not only in the organization of the website itself, but also in the extensions of its features. Thus, we can barely reuse for example a library which we had written on another occasion without having to partially or completely rearrange it.
Let us now list the major advantages which in detail are many:
  • Structured and standardized content management. Thus we won’t have to be anxious of even a strong growth of the website.
  • Simplified management and maintenance. The modification of logic, organization or navigation will be easy and fast operations.
  • instant availability of services and features. In a traditional website, implementing a reserved area requires hard work. If we use a CMS the entire chain which includes registration, registration verification, user management and authentication is already available. Or let’s imagine we are being asked to implement an internal search engine for a traditional website. It’s Posible, but the results are not excellent and it will take time. If we use a CMS instead, it will take just one minute.
The infinity of existing modules for joomla will be enabled you to always find an answer for the most diverse needs.
I wish to make clear that with Joomla it is possible to make every type of template. I say it for those who are convinced that the use of a CMS brings limitations to creativity. Well, that’s not true as it will come out further on.
Thus, we begin producing our template, it will be very simple (header, navigation on the left, contents on the right, footer); it won’t be a captivating layout, what we are interested in is understanding the technique.
I start assuming that you have a clean joomla installation, with no sample data.
1. Files and folders structure of joomla
The folder of a Joomla template can contain many files and folders, but as a minimum it should be structured as follows (use the same names, they are compulsory).
The template folder – whose name will be the name of the template itself – (in our case we will invoke the template “inspiration” so the folder also will bear this name). It contains:
  • A file named “index.php“.
  • A file named “templateDetails.xml“.
  • A folder called “css” which is going to contain the style sheet named “template.css“.
  • A folder named “images“.
Thus we create the file and folder structure inside Joomla’s “template” directory. Our template, as we said, will be called “inspiration “.

2. The templateDetails.xml file

This file can contain many data relative to the template; we will insert only a few, the mandatory ones. Our file will be composed like this:


<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" type="template">
<name>inspiration</name>
<version>1.0.0</version>
<creationDate>03/11/10</creationDate>
<author> joomlaoscommerce</author>
<authorEmail>joomlaos@joomlaoscomerce.com</authorEmail>
<authorUrl>http://www.joomlaoscommerce.com</authorUrl>
<copyright></copyright>
<license>GNU/GPL version 2</license>
<description>Template description</description>
<positions>
<position>left</position>
<position>user1</position>
</positions>
</install>

Now you can see, the first part contains general information relative to the template, some of which can be found on the choice screen. It is important that the value of “name” is equal to the folder name.
consequently, we find another important element, that is the positions. In this section we define the available positions where to insert the various modules. Our template will need solely the “left” position for inserting the navigation and “user1″ which we are going to explain further on for what we’ll be using it. This list can be found in the administrative panel when we will have to choose where to position a module.

No comments:

Post a Comment

Review joomlaoscommerce.blogspot.com on alexa.com