What is the typical template directory structure?

From Joomla! Documentation

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Typical Template Directory Structure[edit]

Template directories[edit]

<translate> A typical template for Joomla! will include these directories:

  • css - contains all the .css files
  • html - contains template override files for core output and module chrome
  • images - contains all images used by the template
  • language - contains additional language files used by the template</translate>

<translate> Depending on the complexity and design of the template, it may also contain:

  • javascript - contains supporting JavaScript used by the template for added functionality</translate>

<translate>====Example Structure with Files==== </translate> <translate> Typical path of a template is <root>/public_html/domain-name/template/<name of your template> which will contain the following directories and files based on your template.</translate>

/css
/html
/images
/javascript
/language
component.php
error.php
favicon.ico
index.php
templateDetails.xml
template_preview.png
template_thumbnail.png


Template files[edit]

It is most common for a template to have at least the following files:

  • index.php
Provides the logic for the display and positioning of modules and components.
  • component.php
Provides the logic for the display of the printer friendly page, "E-mail this link to a friend." etc.
  • error.php
Provides a method to handle errors such as 404, page not found error.
  • favicon.ico
favicon icon file
  • template.css
Handles the presentational aspects of the template including specifications for margins, fonts, headings, image borders, list formatting, etc. The .css files may also be located in the /css directory.
  • templateDetails.xml
Holds meta-information related to the template and is used by the Installer and the Template Manager.
  • template_preview.ext - replace .ext with the extension format of the image (.jpg, .png, .gif)
Generally a 600x400 pixel image that is shown when the cursor is clicked on the thumbnail image in Template Manager:Templates, not Template Manager:Styles. This gives the Administrator a pop up modal window of the template before applying it to the Site.
  • template_thumbnail.ext - replace .ext with the extension format of the image (.jpg, .png, .gif)
Generally a 200x150 pixel thumbnail image that is shown when viewing the Template list in Template Manager:Templates, not Template Manager:Styles . This gives the Administrator a thumbnail view of the template before applying it to the Site.