m (Hutchy68 moved page How do you modify a template? to Modifying a Joomla! Template: FAQ to tutorial title)
|Line 58:||Line 58:|
[[Category:Template Development FAQ]]
[[Category:Template Development FAQ]]
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 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.
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.
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.
Create a new template by copying an existing template:
<language tag="en-GB">en-GB.tpl_my_template.ini</language> <language tag="en-GB">en-GB.tpl_my_template.sys.ini</language>
<param name="theme_header" type="folderlist" directory="templates/my_template/styles/header" default="" label="Header Themes" description="HEADER THEMES DESCRIPTION" /> <param name="theme_background" type="folderlist" directory="templates/my_theme/styles/background" default="" label="Background Themes" description="BACKGROUND THEMES DESCRIPTION" /> <param name="theme_elements" type="folderlist" directory="templates/my_theme/styles/elements" default="" label="Primary Elements" description="PRIMARY ELEMENTS DESCRIPTION" />
Now the new template must be introduced to your Joomla site through the discovery process.
If successful, the new template will now be available in Administrator → Extensions → Template Manager
To edit or copy a template's files with the Template Manager: Customise Template you must first access the Template manager.
You will now see the Template Manager screen.
Note: If you do not see Template Manager listed as an option on the Extensions menu, then it is most likely because you are not logged in as a Super Administrator. Only Super Administrators will see this menu item.
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.
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.
To access the Template Customise feature:
You should now be looking at the image below, Template Manager: Customise Template.
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.