Templates are just a group of XML, PHP, HTML and image files that are stored in the ''templates'' directory of your site. You can edit these files or you can use the editing interface available in the [[Template Manager]].

+

Templates are just a group of XML, PHP, HTML and image files that are stored in the ''templates'' directory of your site. You can edit these files directly or use the Template Manager.

== Before You Begin ==

== Before You Begin ==

−

Before you start hacking away at a default installed template, remember that any updates of the Joomla core files is likely to contain new copies of the default templates. Unless you take steps to protect your work, your modifications will be lost.

+

Before you start hacking away at a default installed template or any other template you may have installed, remember that any updates of the Joomla core files may contain new copies of the default Joomla templates. Similarly, editing an installed template means you may have to re-install it to reset it to the original state at installation.

−

There are options in the Template Manager to Duplicate and Copy an existing template. Note that you are only copying the style of the template and you are '''not''' protected from overwrites. There is simply another entry made in the ''_template_styles'' table of the database. The template files are '''not''' duplicated into another uniquely-named directory and they will be overwritten during an upgrade.

+

Unless you take steps to protect your work, modifications could be lost when upgrading Joomla. Likewise, you may want to preserve an installed template in case you have any problems with modifications to it.

−

For example, consider the case in which you Duplicate the Protostar template in the Template Manager and then modify the ''/templates/protostar/css/template.css'' file. A Joomla upgrade is likely to contain a full set of those Protostar template files. Your changes will be lost.

+

There are options in the [[J{{ns}}:To_access_the_Template_Manager|Template Manager]] to Duplicate and Copy an existing template style or the '''actual template and template files'''. This page refers to the methods available to make a full copy of your template. This includes the style and all the template files of a template.

−

=== Copy an Existing Template ===

+

+

{{tip|Template Style and Template copying are not the same. You can make a copy of the template style but you are '''not''' protected from overwriting the actual template files. Style copying simply adds another entry made in the <code>''_template_styles''</code> table of the database. This is useful is you want to check a web site design with different fonts, colors, widths or logos if these template style parameters exist. The template files are '''not''' duplicated into another uniquely-named directory and they will be overwritten during an upgrade.}}

+

+

==Copy the Template==

+

To preserve your changes you need to Copy the template with all its files and styles. This procedure makes references to creating a full copy (an exact duplicate) of the template including all the files. In order to make a copy, you must be on the '''Customise Template''' view.

Now the new template must be introduced to your Joomla site through the discovery process.

−

*Go to Administrator > Extensions > Extension Manager > Discover.

+

==== Discover the New Template ====

+

When manually copying a template, the new template must be introduced to your Joomla site through the discovery process.

+

+

*Go to {{rarr|Administrator,Extensions,Extension Manager,Discover}}

*Click the Discover icon.

*Click the Discover icon.

*Select your new template.

*Select your new template.

*Click Install.

*Click Install.

−

If successful, the new template will now be available in Administrator > Extensions > Template Manager. Make the new template the default template. View the site to verify it.

+

If successful, the new template will now be available in {{rarr|Administrator,Extensions,Template Manager}}

−

== Editing the Template ==

+

−

In the Administrator, select Extensions > Template Manager. Now select Styles or Templates. Select the template you wish to modify.

+

*Make the new template the default template.

−

+

*View the site to verify it.

−

[[CSS]] stands for cascading style sheets. This controls many elements of the look and feel of your site.

+

−

[[HTML]] is the file that controls where positions are defined and placed. Other than that, it should be noted that, with a few exceptions, what is in the .css and what is in the HTML files largely depends on the approach of the template designer.

+

== Finding Errors ==

+

You might have problems as a result of copying an existing template to a new template. Because of the way that Joomla handles file names, you might be tripped up by a capitalization error, for example.

+

+

Joomla contains some useful debugging tools. To see what is happening while working on a site, there are three settings that you should change.

One common change is to use your own graphic/image. Graphics are linked to the HTML file. Simply change the reference to the image of your choice. Keep in mind that if it is a different size than the original image this may change the appearance of the site in unexpected ways.

+

With the Debug Language set to ''Yes'', for instance, you will see the success or failure of language file loading on each page of the Administrator. Open the ''Joomla Debug Console > Language Files Loaded'' panel to view the report.

Contents

Before You Begin

Before you start hacking away at a default installed template or any other template you may have installed, remember that any updates of the Joomla core files may contain new copies of the default Joomla templates. Similarly, editing an installed template means you may have to re-install it to reset it to the original state at installation.

Unless you take steps to protect your work, modifications could be lost when upgrading Joomla. Likewise, you may want to preserve an installed template in case you have any problems with modifications to it.

There are options in the Template Manager to Duplicate and Copy an existing template style or the actual template and template files. This page refers to the methods available to make a full copy of your template. This includes the style and all the template files of a template.

A Tip!

Template Style and Template copying are not the same. You can make a copy of the template style but you are not protected from overwriting the actual template files. Style copying simply adds another entry made in the _template_styles table of the database. This is useful is you want to check a web site design with different fonts, colors, widths or logos if these template style parameters exist. The template files are not duplicated into another uniquely-named directory and they will be overwritten during an upgrade.

Copy the Template

To preserve your changes you need to Copy the template with all its files and styles. This procedure makes references to creating a full copy (an exact duplicate) of the template including all the files. In order to make a copy, you must be on the Customise Template view.

<translate>
There are two methods available for accessing the Template Manager: Customise Template. The Customise Template interface allows for editing the actual code found in the template files, creating template overrides and template file manipulation.</translate>
<translate>====One-Click or Switch to Template View==== </translate>
[[File:30-Template-manager-template-styles-view-1<translate>
-en</translate>.png]]

<translate>

A Tip!

Styles column refers to changing the available parameters of a template, such as color, font-color, logo, etc. These are dependent on the parameters a template maker made available and are a convenience for quick changes. Template - column refers to editing the actual template files.

</translate>

<translate>
To access the Template Customise feature:

Directly - Click the template name in the column Template</translate>

[[File:30-Template-manager-template-styles-view-2<translate>

-en</translate>.png|600]]
<translate>

Indirectly - Styles will be highlighted, click on Templates below it which will turn the view to Template Manager:Templates, see image below.</translate>

[[File:30-Template-manager-template-style-view<translate>

-en</translate>.png]]

<translate>

Select the template you wish to modify which will change the view to Template Manager: Customise Template view</translate>

Discover the New Template

When manually copying a template, the new template must be introduced to your Joomla site through the discovery process.

Go to Administrator→ Extensions→ Extension Manager→ Discover

Click the Discover icon.

Select your new template.

Click Install.

If successful, the new template will now be available in Administrator→ Extensions→ Template Manager

Make the new template the default template.

View the site to verify it.

Finding Errors

You might have problems as a result of copying an existing template to a new template. Because of the way that Joomla handles file names, you might be tripped up by a capitalization error, for example.

Joomla contains some useful debugging tools. To see what is happening while working on a site, there are three settings that you should change.

With the Debug Language set to Yes, for instance, you will see the success or failure of language file loading on each page of the Administrator. Open the Joomla Debug Console > Language Files Loaded panel to view the report.