Joomla 4.1. brought numerous fresh and practical features. The ability to create, use and install Joomla 4 child templates is one of them that you shouldn't overlook. What does this signify, and why is this feature included in Joomla 4.1? In this blog post, we'll attempt to explain what Joomla child templates are and what their benefits are. We'll also explain in details, how to install a Joomla child template into your Joomla site.
Let's begin right away!
What are Joomla child templates?
A Joomla child template is a template from a parent template that must contain minimum the file "templateDetails.xml" but can contain more files if it needs to. All other files are inherited from the parent template. So basically, you should have a parent template to use a child template because a Joomla child template can't work without its parent template.
Let's illustrate this with an example.
Your Joomla site comes with the native Cassiopeia template and you want to create a variation for it. In this instance, you can accomplish it by making a child template from Cassiopeia. After that, all that remains is to load the parent template's contents while using custom CSS or adding a custom position to the index.php file.
Why you should use Joomla child templates?
What are the advantages of using child templates for Joomla 4?
To put it simply, you may preserve all of your changes or updates with each Joomla update by using child templates feature. In other words, you can use overrides whenever a module or component has to be changed or adjusted. This will not be erase on the next Joomla update.
But with parent templates, you can't do that. You must copy and rename the complete template in order to save all of your changes made during an update. Both time and inconvenience are saved. So, you easily understand that the child template functionality will make it simple for you to solve this problem.
How to install a child template in Joomla?
Thanks to the latest versions of Joomla, there is no longer a need to generate these child templates in the admin panel of your site. These child templates are created automatically by an installation script. But such installation may overwrite the "custom CSS" file you've previously created. So as usual, be careful, and always backup your site before installing Joomla child templates.
And now, follow these steps:
- 1 Download the Joomla child template you want to install. The template must be provide in a compressed format. In case of doubt, read the child template documentation and/or contact the template developer.
- 2 Install the Joomla child template like any other Joomla extension
System - Install - Extensions
- 3 The installation package contains files which will be copied into these folders:
Congrats, your new Joomla child template is now installed in your Joomla site.
How to uninstall a child template in Joomla?
Uninstall a Joomla child template is as easy as to install it.
Open your Joomla admin panel and navigate to - System - Manage - Extensions and search for the template you want to unisntall.
In the list, you must select the type Template to remove the child template and all its files.
If you select the type file, only the custom files located in the template folder will be removed (not those in the media folder).
Overall, Joomla child templates are crucial for saving all the alterations you made while Joomla was being updated. You should therefore make a child template for your Joomla 4 website.
Additionally, feel free to look at the responsive and SEO-friendly Joomla 4 templates listed in the biggest Joomla template directory if you're thinking about redesigning your Joomla 3 website.
Thanks for your reading and for sharing.
Go further with the Joomla Community Magazine: Sweet child o' mine... A deep dive into Joomla Child Templates by Philip Walton.