.

The Theme Is Change

By now many of you have upgraded to v5 (currently v5.0.2) with little or no difficulty. As expected, the most troublesome upgrades have involved AOM sites that were already heavily customized.  This post is going to discuss various aspects of completing the upgrade process, and what it will entail for some sites going forward. For this discussion, the terms ‘template’ and ‘theme’ are interchangeable. A ‘scheme’ refers only to a site’s color choices.

One of the most obvious effects of having editable template files is that it makes the whole concept of separate header and/or footer files obsolete. You can simply incorporate the customizations you want directly into the header.tpl.php or footer.tpl.php files. This means you don’t have to worry about including the code snippets for the Title, Description or Keywords tags, or the various bits of Javascript and other odds & ends. They will already be included, and the whole process is greatly streamlined.

Likewise, a separate stylesheet can also be considered surplus to requirements. Simply append the CSS you want to include into the css.tpl.php file.

You can see how a site that has been customized with external stylization can be updated by including the changes internally, without needing to include the separate files. Of course, this is not a requirement. You are still free to utilize external header/footer files, or a second stylesheet.

By changing the structure of AOM from tables to nearly pure CSS, it’s important to check your external codes to make sure they do not contain outdated references. Many custom header files may try to reference the cfg.css.php file, which no longer exists in v5.x.  The link would need to be changed to /aom/themes/default/css.tpl.php instead. Stylesheets may try to modify table classes that have been replaced by CSS, such as .CategoryBox, which would be used to in conjunction with the side category box.

Another consideration that has been noted in some sites that have upgraded from v4.x to v5.x is the importance of closing tags. Stores suddenly shift to the left for example, or all the text will be centered. Usually these can be traced back to an open align=”left” table tag or a <center> missing a </center> tag. It may require quite a bit of detective work to unravel a file full of nested tables, or a malformed </td> buried somewhere. Of course, it’s always good coding practice to make sure that all open tags are closed properly. This includes paragraph tags (<p> & </p>) as well.

If you do make changes to the default theme, as we have discussed above, it would be strongly recommended that you either make a backup copy of your default template files, or rename the theme altogether. This will ensure that the changes are not overwritten in a following upgrade. The procedure to rename a theme is very simple, and consists of two or three steps:

The first thing to do is to rename the /aom/themes/default folder. You can use standard filename rules, so anything like default2, mydefault, main_theme, etc. will do. Note that this will cause AOM to ‘lose’ the connection to the theme files, so your site may appear without any CSS styling. This will be resolved in just a moment.

Next, edit the theme.php file located in the folder you’ve just renamed. This file contains information regarding the theme, such as the name, who created it, etc. Change the name to whatever you want, except ‘default’ of course. Or any other themes you may have installed.

Examples of installed AOM themes

Once you’ve made these changes, go into your AOM control panel and click on the Themes tab. You should see the newly renamed theme. Select it by clicking on the radio button below the image, then save. This will restore the theme, allowing AOM to ‘find’ it again. If you have any references to /aom/themes/default/css.tpl.php in an external file, etc., this will need to be changed to reflect the new theme name, such as /aom/themes/default2/css.tpl.php.

If you have changed the default color scheme by customizing some colors, you can also make your own color scheme file. Copy one of the scheme files found in the /aom/colors folder, and replace the color codes with the ones you’ve customized. Also change the name, and don’t forget to save the file with a new filename, such as scheme_default2.php or scheme_mydefault.php, etc. Then upload this file to the /aom/colors folder. When you go to the Colors tab of your AOM control panel, you should see this color scheme listed with the rest.

You can choose the new scheme you’ve created to show that it’s the new default setting, but the main reason for creating the file is so that the color selections will not be lost if you should change to a different scheme for any reason. The scheme and theme files can also be downloaded to your computer as backups.

It should be stressed that if you have not made changes to the theme files, you do not need to rename the default template. Nor do you need to make a backup copy. You can make a custom color scheme file if you would like to make sure your colors are preserved in case of accidental change or deletion; but this is not a requirement.



Comments (1)

Converting to v5 | AOM Talk

October 22nd, 2011 at 3:55 pm    


[...] Some of this information has been touched upon in a previous post, The Theme Is Change. [...]

Leave a reply

Name *

Mail *

Website


nine − 7 =