Attention

This document was written for an unsupported version of Plone, Plone 2.1.x, and was last updated 1600 days ago.

For more information, see the version support policy.

To learn how to upgrade to the current version of Plone, read the upgrade manual.

AttributeError: getBodyTagClass

by J. Cameron Cooper last modified Dec 30, 2008 03:08 PM
If you customize 'main_template' and get an AttributeError on 'getBodyTagClass' you have probably customized the wrong 'main_template'.

Plone comes with an alternate skin that lays out the main structure of the page without tables. (Getting it to work right in without problems in IE is difficult, which is why it's not the default. But that's another issue.) This skin is just like the default skin, except that it includes the plone_tableless layer at the top. This layer contains a main_template and some other supporting components that will over-ride any existing components from the regular skin of the same name.

If you customize the main_template from the plone_tableless layer, but are still using the default skin, that main_template will want things that come only from the plone_tableless layer, which which are not present in the current skin. This results in, for Plone 2.1, an attribute error as noted above.

If you intend to use the tableless layout, you should switch to the tableless skin (or add the plone_tableless layer to your own skin).

If you did not intend to customize the tableless layout, but found the wrong main_template by accident, remove the customized version and start again from plone_templates/main_template.

A word of advice, though: unless there is a very good reason, avoid customizing the main_template. It will almost certainly have to re-customized on every migration.