Creating Templates

In order to understand, edit, and eventually create your own Joomla Template, let's start with learning the fundamental parts of how a Joomla Template works.

Note

Building Joomla Templates can be a world unto itself and not easy to fully grasp in a quick read. If you're new to building web templates for Content Management Systems, such as Joomla, it's best to try and learn the fundamentals over time by trying to build a simple template yourself.

As we step through the following sections, you will find that creating a template involves these basic guidelines/steps:

  1. Core Template Files: understand the core template files and how they work.

  2. Basic Shell: not only represents the basic HTML elements such as <head>, but the Joomla-specific code you will want to include to ensure some of the core Joomla functionality is available in your template.

  3. Defining Layout: refers to the general layout of your template and more specifically the positions you define, which is where Joomla Modules can be positioned.

  4. External CSS and JavaScript Files: most all templates will have external CSS and maybe JavaScript files. Ensuring that you properly construct the paths to these files in your templates is very important.

    Note

    It is a generally accepted, and recommended, practice when creating templates for all images to be specified in stylesheets rather than from within the HTML files (e.g., index.php). The idea here is that if what you are building is truly a template, then images are just another ...

Get Up and Running with Joomla, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.