Joomla Template Overrides: Change How Pages Look Safely
Joomla builds each page's HTML from layout files that belong to Joomla's core, its components and modules, and your extensions. If you edit those files directly, the next update overwrites your changes. A template override puts your own copy of a layout inside your template, and Joomla uses your copy instead.
This one's for developers and confident DIYers. Overrides involve PHP and HTML. If that's not you, we're happy to help.
When to use an override
- Changing the HTML of an article, category blog, module, or other output
- Adding or removing elements, like the author line or a "Read more" link
- Making an alternative layout that you can pick for some pages but not others
If you only need to change colors, fonts, or spacing, CSS is usually enough. Your template may have a custom CSS option.
Before you start
- Take a backup. See Website Backups: What to Back Up, How Often, and How Restores Work.
- Work on a staging copy if you can.
- Check if your template uses a child template (supported in Joomla 4.1 and later). If so, create overrides in the child template so the parent template can be updated safely.
Create an override
- Go to System > Site Templates (under Templates).
- Click your template's Details and Files link (it reads "Your Template Details and Files") to open the template editor.
- Click the Create Overrides tab.
- Pick what you want to override from the Modules, Components, Plugins, or Layouts column. For example, Components > com_content > article for single articles.
- Joomla copies the files into your template's
htmlfolder, liketemplates/your-template/html/com_content/article/default.php. - Open the copied file on the Editor tab and make your changes.
- Save, then check the page on your site.
Make an alternative layout
Rename the copied file (for example, default.php to wide.php). It then appears as an option in the Layout setting for articles, categories, menu items, or modules, so you can use it only where you choose.
After Joomla or extension updates
When the original file changes in an update, Joomla flags overrides that may need a look. Go to System > Site Templates, open your template, and check the Updated Files tab. Use Mark Checked once you've reviewed a file. Compare your override with the new original and bring over any fixes.
Tips
- Keep changes small, and comment what you changed and why.
- Don't copy more files than you need.
- Keep a list of your overrides somewhere your team can find it.
- If an override breaks a page, rename or remove the override file and Joomla goes back to the original.
Related
- Joomla Modules Basics: Positions, Assignments, and Visibility
- How to Update Joomla Safely (Back Up First)
How 3by400 can help
We build and maintain template overrides on the Joomla sites we develop. Learn about our website development work.
Start a project
Ready to talk about your website? Start a project or reach us at 678-379-9321 or