This is the bit of code that goes at the very top of every web page. What actually is in an index.php file? It is a combination of (X)HTML and PHP that determines everything about the layout and presentation of the pages.įirst, let's look at a critical part of achieving valid templates, the DOCTYPE at the top of the index.php file. These describe parameters that can be passed to allow advanced template functions such as changing the color of the template. The module positions available in the template. Again, the filename is enclosed by, and it's path is relative to the template root. Last, any stylesheets are listed in the files section.For example, if the template is in the directory called 'YourTemplate', and all images are in a directory 'images' that is inside 'YourTemplate', the correct path is: images/my_image.jpg. Path information for the files is relative to the root of the template. All image files that the template uses are also listed in the section.Also included would be any additional files here the example of a JavaScript file that is required by the template is used. Each file listed in this section is enclosed by. The "files" sections contain all generic files like the PHP source for the template or the thumbnail image for the template preview. ![]() The files used in the template are laid out with tags: Email address where the author of this template can be reached.A Licensing Primer for Developers and Designers can be found in the Joomla forums. Any copyright information goes into this element. The name of the author of this template-most likely your name. ![]() It is a free form field and can be anything such as May 2005, 08-June-1978,, and so on. If installing manually, you need to create a directory that is identical to the template name. Therefore it should not contain any characters that the file system cannot handle, for example spaces. The name you enter here will also be used to create the directory within the templates directory. The option type="template" tells the installer that we are installing a template and that it is for Joomla 1.5. The contents of the XML document are instructions for the backend installer. Let's explain what some of these lines mean: An example XML file is shown here: įirst example template for Chapter 9 of the Joomla Book Some of these are shown in the admin backend in the Template Manager. It also includes information such as the author and copyright. The templateDetails.xml must include all the files that are part of the template. Here we have an image file called logo.png as an example. Again for organization reasons, most designers put this in an images folder. Usually the name shown is used, but we will see later that there are advantages in having other CSS files too.Īny images that go with the template. The folder location is optional, but you have to specify where it is in the index.php file. After the template has been installed, this functions as a "Preview Image" visible in the Joomla administration Template Manager and also the template selector module in the frontend (if used). Core Files Needed for a TemplateĪ web browser screenshot of the template (usually reduced to around 140 pixels wide and 90 pixels high). It is conventional (although not required by the core) to name and locate them as shown here: /element/template_thumbnail.png In almost all templates, additional files are used. It lays out the site and tells the Joomla CMS where to put the different components and modules. Second, we have the engine of the template, the index.php: index.php The last use of this file is for installing a template when using the admin backend. Note the uppercase "D." It also details the author, copyright, and what files make up the template (including any images used). This is an XML format metadata file that tells Joomla what other files are needed when loading a web page that uses this template. The first of these is the template XML file. These two filenames and locations must match exactly because this is what they are called by the Joomla core script. Within the directory of a template, there are a number of key files: /element/templateDetails.xml Obviously they are case sensitive and shouldn't contain spaces. Note that the directory names for the templates must be the same as the name of the template, in this case element and voodoo. So if we had two templates installed, our directory would look something like the following: /templates/element These files must be placed in the /templates/ directory of a Joomla installation in their own folder. The template contains the various files and folders that make up a Joomla template. To understand the contents of a template, we will start by looking at a blank Joomla template. ![]() Learn More Buy Creating a Simple Template Joomla! A User's Guide: Building a Successful Joomla! Powered Website
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |