13

Currently to update templates on our production site, we are taking the site offline, changing the template, uninstalling the template, reinstalling it, changing the template settings back, and then putting the site back online. I generally am not a fan of taking the site down for any reason and this process allows for errors especially with templates used only for a few pages. Components and such can be updated easily, but it seems this same functionality is omitted for templates.

Is there a better methodology for handling template updates that eliminates taking the site offline?

3
  • What types of changes are you updating on the template? Are these custom templates or ones from a third-party provider? Commented Apr 22, 2014 at 18:33
  • @DavidFritsch The templates we work with are custom to our sites. The changes often include JavaScript or CSS modifications, such as upgrades to Twitter Bootstrap or other frameworks. Commented Apr 22, 2014 at 18:38
  • I'm new to Joomla so maybe I've missed a biggy, but I seem to skip over most of these steps when editing my own templates (an entirely custom template with CSS/JS etc.) - which I believe you are doing - rather than updating a 3rd party template. Once initially created and installed in Joomla, I don't "use Joomla" at all. I edit the files directly on my development server (refresh the browser to check) and push to the live site when done. No uninstalling, reinstalling, changing settings or downtime. Is this bad? What have I missed? (Should this be another question?!)
    – MrWhite
    Commented Apr 28, 2014 at 9:43

3 Answers 3

14

Upgrading a template should be as simple as using the Joomla installer to upload and install the updated version of the template.

For it to work, though, the templateDetails.xml file must define the 'method' as 'upgrade', rather than 'install'.

You can check this by unzipping the template install file, opening the templateDetails.xml file and check for the following at or around line 3:

<extension version="2.5" type="template" method="upgrade" client="site">

If the method="install", change it to method="upgrade", and save the file. Zip up the package and point the installer at it and you should be good to go.

A note about customizations: This process will upload the full template, potentially overwriting any customizations you've done. For this reason it's a good idea to add any and all customizations you might like to do to a single file for easy backup and re-adding. I like to use a CSS file I name 'custom.css', and load this file last, so that my customizations override the defaults.

3
  • Adding method="upgrade" was exactly what I was missing. Thank you! Commented Apr 22, 2014 at 19:02
  • Is the process any different between Joomla versions?
    – MrWhite
    Commented Apr 28, 2014 at 1:07
  • method="upgrade" is the same across versions of Joomla (sorry I originally missed the question)
    – Zaridan
    Commented Oct 16, 2014 at 20:12
3

If you don't have any custom changes to the template - just install the new one over the current one.

If you made some custom changes you will need to redo the changes or diff the your current template code and the new template code.

3
  • I'm not sure I quite understand. I don't believe you can install a newer version of a template over an older one. Joomla! returns "Warning Template Install: There is already a Template using the named directory: Install. Are you trying to install the same template again?" Then "Error installing template." Commented Apr 22, 2014 at 18:33
  • 5
    If you are getting such a warning it's most likely because the manifest file does not have the proper method defined. Check the template's xml file for the defined method, and set it to 'upgrade' if it's set as 'install'. More on manifest files here: docs.joomla.org/Manifest_files
    – Zaridan
    Commented Apr 22, 2014 at 18:39
  • 1
    @Zaridan I think that you've hit on the key point. You should add this as an answer and include some of the relevant code to get this to work. Commented Apr 22, 2014 at 18:45
1

There ARE some advanced staging options. I think siteground has something like this. There are ways to replace parts of a site without overriding all of the db tables, so if you've got the time and resources to look into this, it CAN be done...it just takes some good setup time (and you have to get your brain around it).

But if you're talking changing the theme on a few pages, why not just upload the new theme under a different name and apply it to some hidden menu items while you work on it. No one will see it and you can tweak the settings and then apply it to the correct menu items when you're done.

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.