HTML Logo by World Wide Web Consortium ( Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS. ocPortal 9 is superseded by Composr 10.

Head over to for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.

Upgrading themes

There are no pages beneath this page

Submitted by Chris Graham
When upgrading to a major new release, you may need to apply some style changes made to the default theme templates or CSS back into your own theme. The developers try to minimise this requirement, but it does sometimes come up when there are interdependent changes between various styles and templates.

ocPortal's upgrader will try and help with this, by automerging-in changes made to the default files. It is not perfect though: it only handles insertions and deletions. It can't handle conflicting changes on a line (if you've made a change on the same line the developers have made a change on), can't handle changes in line order and it doesn't have any actual knowledge of CSS or XHTML syntax (it just looks at lines as text).

The automerging works on the principle that ocPortal creates backups of theme files that you override, and then uses those with what is called a "3-way merge" (we'll explain this later). Let's have a worked example…
  • if you use the Theme Wizard to make a theme, it will create backups of all the default theme CSS files into your theme too
  • so your theme will contain your recoloured versions, and also the original versions (which are on disk with a filename suffix or .editfrom and aren't actually shown inside ocPortal).
  • you would then in all likeliness go on to make your own changes to the CSS
  • if you then do an upgrade, the default theme CSS will of course be replaced with the latest version
  • so you will actually at this point have 3 interesting copies of the CSS files:
  1. the files in the default theme (themes/default/css/*.css)
  2. the files in your theme (themes/<yourtheme>/css/*.css)
  3. the files that are copies of the version of the default theme you originally overrode from (themes/<yourtheme>/css/*.css.editfrom)

The 3-way merge will see the changes between 1 and 3, and then apply them to 2. If it can't make a match when it looks at 2 for a particular change it will not be able to merge in that change.

Because of the deficiencies in merging already described, it is often better to go through the process by hand, or to go over by hand to perfect what the automatic results haven't done quite right.

The development team recommends 3 tools for doing this:
  • WinMerge (Windows)
  • DiffMerge (Mac)
  • Kompare (Linux)

Here is some documentation for Winmerge that explains how to use these kinds of tools (they're all very similar) a bit better:
WinMerge 2.12 Quick Tour

You essentially need to download from your server a copy of the new default theme, and your theme, and start doing file comparisons within the tool.

Look between 1 and 3 to identify changes made by the development team. This is useful to see what changes were made for the new version. If you have 2 open in a separate editor it is easy to manually apply each change you see into that copy, i.e. upgrade your theme.

Look between 2 and 3 to find the changes you and the Theme Wizard made.

Look between 1 and 2 to find all the changes made by the development team and by you and the Theme Wizard.
CEDI change-log Post