1

In Joomla 3 there was a handy button to create a copy of template so that you had a basis on which to customise and create your own template.

This seems to have been removed in J5 and instead there is a create child template button which is not at all what I want. I want an entirely separate template to customise which is not linked to a parent.

What is the best way do do this now? (and why on earth was the facility removed - it was really useful) ?

5 Answers 5

1

In an effort to make maintenance of my sites easier to manage without creating problems for future upgrades, I copy the core template periodically and go through the process of renaming the files and code and then add my enhancements to make the template look, feel and act as I want it. This means when a new major release is dropped (or near dropped), I go through the process. I also keep a bit of an eye on GitHub changes relating to the template.

So for J5 I copied Cassiopeia files:

templates/cassiopeia Folder
media/templates/site/cassiopeia Folder
language/en-GB/tpl_cassiopeia.ini
language/en-GB/tpl_cassiopeia.sys.ini

Don't forget to rename all CSS files as appropriate.

0

there is a way to duplicate a template in Joomla 5. - Do the following:

  • go to "System" on backend
  • Click on "Site Template Styles"
  • Check the box beside the Template you want to duplicate
  • If you check the box the Duplicate button becomes available on the top

I hope this helps...

1
  • er, no. That is not what I want. All that does is make a duplicate of the template style settings in the template_styles table in the database. So you can have more than one set of style settings for a given template (default colours etc) for different parts of your site.
    – RogerCO
    Commented Mar 12 at 19:33
0

This is not an answer but a long comment @Gerald

er, no. That is not what I want. All that does is make a duplicate of the template style settings in the template_styles table in the database. So you can have more than one set of style settings for a given template (default colours etc) for different parts of your site.

What I am after is the old J3 facility to create a copy of the actual template files and install it as a fresh template that you can then customise. It was quite handy for creating a copy of a template to modify that wouldn't get overwritten by updates.

The only way to do it now is manually by zipping up the template folder and the template's media folder and copying them to new folders with a new name and manually editing all of the references to the old template name so that the namespacing etc all works and doesn't get confused. Not so simple as it was in J3 which is probably why they couldn't be arsed to include it in J5.

0

Template copying is a old way for users to customize templates without losing changes. It has many issues. For example, it cannot rename PHP classes and language constants. Which eventually leads to conflicts. Furthermore, it's not really optimal because users have to maintain the whole template on their own. That's why it has been superseded by child templates. Although the implementation is poor, it does solve the mentioned issues because no files are copied. Users can override individual files and maintain only them.

Non-inheritable templates can still be copied but for modern templates you'd need to use an extension export extension or copy the files manually by inspecting the contents of templateDetails.xml manifest. Basically how you would copy any other extension.

1
  • Yes, I get that. But the problem with child templates is that subsequent updates to the parent template may interfere with your child one. Really I am using the standard template as a template to create my own, so sorting out any naming issues etc is a one time job after creating the copy, but easier than starting from scratch with a completely blank set of files. Its not a big deal because it is typically something that you only want to do once (and then reuse your derived template across other sites by installing/discovering it in the usual way)
    – RogerCO
    Commented Apr 25 at 10:44
0

I did try to create a child template but the appearance of my site changed when I loaded the next Joomla version.

I did copy the following files as suggested by Glenn but did not find which CSS files I should rename. I guess that I am missing something because I cannot view the duplicated template with a new name in the backend.

2
  • A couple of quirks - I don't think you need to rename any css files. You do need to rename the language files names to match your new though and you also need to edit the /templates/yourtemplatename/templateDetails.xml file to replace any references to cassipeia with yourtemplatename - specifically in the sections <name> <media destination= and the ``language filenames. No need to replace the language string names TPL_CASSIOPEIA unless you also change them in your new language files. (probably a good idea)
    – RogerCO
    Commented Nov 26 at 12:54
  • Thje you need to use the Discover entry under Extensions on the main menu (or dashboard if you are using the default dashboard rather than the better menu) so that the system finds and installs your new template. Thereafter you can edit the template files as you wish without system updates messing with them, but as Glenn suggested you need to watch for changes that should be implemented in your version.
    – RogerCO
    Commented Nov 26 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.