The Joomlashack Blog

Making changes to Joomla's core files is often neccessary, but there's a right and a wrong way to do it.

The wrong way is to directly edit Joomla's files. If you do, you'll lose all your changes when you next update your site.

The right way is to use an override. In this post, we'll show you what overrides are and how you can use them to safely edit components, modules and languages.

An Introduction to Overrides

What? An override is a file or database entry that is loaded instead of the normal core file.

An override is a file or database entry that is loaded instead of the normal core file. Where? In Joomla, overrides are nearly always placed inside your template's files.

In Joomla, overrides are nearly always placed inside your template's files. Who? Almost every template designer uses them. If you buy a template or download a free template, there is 99% chance that it will use overrides to help in designing your site.

Almost every template designer uses them. If you buy a template or download a free template, there is 99% chance that it will use overrides to help in designing your site. How? Read on and find out how to override modules, components and languages.

#1. Joomla Module Overrides

Here's the Login Form module we're going to modify in this example. We're going to remove the "Remember Me" button.

Login to your site's files and browser to the /modules/ folder.

Look for the /mod_login/ folder.

Inside the /mod_login/ folder, you'll hopefully find a /tmpl/ folder. If there isn't, your module won't support overrides.

Inside the /tmpl/ folder, look for the layout file for the module. In simple modules, it's often called default.php. Make a copy of this file.

Browse to your /templates/ folder.

Open the folder for your current template. In this example, our template is /beez_20/.

Open the /html/ folder.

Inside the /html/ folder, create a new folder with the same name as your original module's folder. In this case, that's /mod_login/.

Upload the layout file to this new folder.

You can now edit the layout file. In this example, comment out lines 49 to 54 from default.php.

Save the file and your change will be visible:

#2. Joomla Component Overrides

Let's look at almost exactly the same task, but this time with a component. We're going to remove the Remember me box from our login component.

Login to your site's files and browser to the /components/ folder.

Look for the /com_users/ folder.

Inside the /com_users folder, you'll hopefully find a /views/ folder. If there isn't, your components won't support overrides.

Inside the /views/ folder, you may find several subfolders. Normally each one is logically named, according to the part of the component that they modify.

Look inside these folders and the /tmpl/ folders they contain . Look for the layout file you want to alter. In our example, the file is /login/tmpl/default_login.php.

Browse to your /templates/ folder.

Open the folder for your current template. In this example, our template is /beez_20/.

Open the /html/ folder.

Inside the /html/ folder, create a new folder with the same name as your original component's folder. In this case, that's /com_users/.

Create a subfolder inside /com_users/, matching the subfolder of the original component. In this case, that's /login/.

Upload the layout file to this new folder.

You can now edit the layout file. In this example, comment out lines 47 to 50 from default_login.php.

Save the file and your change will be visible:

#3. Joomla Language Overrides

Whereas modules and components need to be overriden via the files, you can override language on your site via the Joomla administrator.

In this example, we're going to override "Don't have an account?"

Go to Extensions > Language(s) > Overrides.

Click New.

Enter "Don't have an account?" and click Search.

You'll see the results below the search box. Click the one you want to override.

Enter your new phrase into the Text box.

Click Save & Close.

You'll see the override listed as below:

Visit the front of your site and you'll see that override is now working:

This post has more details on Joomla language overrides.

For more information on overrides in general, check out the Best Tutorials on Joomla Template Overrides.