If you want to change something in a core Joomla file, say the layout, heading tags, etc., there is a proper way to approach this. If you alter the actual core files you run the risk of breaking your site if done improperly and you risk losing these changes when you upgrade your version of Joomla.

The proper way to change the things that the core Joomla site do things is to create Template Overrides. These files reside in subfolders of the html folder of your default template, and have the same file name as the file in the core, but do not have the same path. When compiling the page using PHP, Joomla will look first at the HTML folder in the template, if the file is not there, it goes to the standard path in the core files.

These files must be stored in the html folder in the proper manner in order for Joomla to find and use them.

To create Template Overrides, you need to copy the original php file from the core and place the copy into the proper place in your template directory. The correct directory structure for your override file is:

TEMPLATE_NAME/html/EXTENSION_NAME/VIEW_NAME/FILE_NAME.php

If you wanted to override the core file that controls the way an article is laid out, copy the original into the new directory inside your html directory of your template files and edit it from there. Say for example you are using the protostar template. Use the following structure:

Original File location: JOOMLA_ROOT/components/com_content/views/article/tmpl/default.php

Override File Location: JOOMLA_ROOT/protostar/html/com_content/article/default.php

Joomla 3+ can do this work for you

Pull the Extensions menu down, click on Template Manager   Extensions -> Template Manager

You will come to a table of the templates that are installed on your site. The columns are Style, Default, Location, Template and ID.

There should be two templates where the Default star is filled in, one is your Adminstrator Template the other is the Site Template. The Administrator template controls what you Administrative interface looks like. The Site template controls what the front end of the site looks like.

Click on the name of the default site template in the Template column.

This brings you to the Template Manager: Customise Template screen.

Click on the Create Overrides tab.

Screenshot of the Create Overrides template

We are assuming that you have done your research and know what file you wish to override and how to edit the file to accomplish your goals.

Say you wish to change something about the default way an Article is laid out. Click on com_content and all of the views for that component will be displayed.

Click on Article, and after a moment, you should get a green box on top that says that the Override was created and the path to that file. This file will be placed in the /templates/TEMPLATE_NAME/html/ directory of your site.

Click on the Editor tab.

Click on the html folder in the left hand column.

This will open up to the existing sub-folders.

For our example of wishing to edit the Article layout, click on html -> com_content -> article -> default.php.

Keep in mind that this is a copy of the core file. If you change something and it causes errors, you can simply delete the file from this directory, and Joomla will go back to using the original core file.

Joomla 3 allows you to edit the override file right within the Template Manager. Click on the file and a text editor appears with that file's contents. You can also create new files for things like your custom CSS file. This is a fabulous improvement over the previous way to edit the stylesheet file through the Joomla interface. Previously there were no line numbers, which made it difficult to find things in the file. It still isn't perfect, as it reverts to the top of the page when you save the file. This can be annoying if you are tweaking your stylesheet file.

You can also edit this file in a text editor like Notepad++. Download the file using FTP, edit it, then upload the edited file back to the same location.


Has BJ.Zemplate.com helped you with understanding Joomla?

If you would like to make a small contribution to help fund this resource, that would be great, but do not feel obligated in any way.

Donation Amounts


Still not finding a special topic?

Use Google's Search function below for search the content of bj.zemplate.com.