
A forums application can display multiple themes (skins). You can customize various themes and deploy them without compiling or even restarting the forums application.
You can use the Admin Console to map themes to categories, forums, and even URL patterns. Simply reload the page and the new, customized theme appears. Whether you want to distinguish various forums by providing unique themes for each or want one forum in English and another in Chinese, theme support can solve these challenging problems gracefully and with ease.
Themes Directory
Themes are specified in the Home folder in a themes directory. Each folder in the themes directory contains a specific theme, with the folder name being the name of the theme. Each theme folder must contain the following objects:
The theme.xml file needs to specify the decorator template. It can also specify a locale for the theme by means of a locale code specification. An example theme.xml file is shown below:
<theme>
<decorator>mydecorator.ftl</decorator>
<locale>en_US</locale>
</theme>
All custom template files are loaded from the templates directory.
The templates must be valid FreeMarker template files. For more information on FreeMarker, visit http://freemarker.sourceforge.net/
.
Themes are cached, so if you add a directory for a theme under Home, you have to restart the system to see it in the Admin Console.
Selecting the Global Theme
Mapping Themes
If the requested URL matches one of these URL mappings, the specified theme is displayed.
Configuring the Order of Theme Mappings
Theme mappings are sorted by default, but you can configure the order of the mappings in the Theme Map Precedence section.
Overriding Default Forum Views
To override a forum view, create an accordingly named template file in the templates directory. For example, to override the viewforum.jsp page, create a file called viewforum.ftl and place it in the templates directory for a specific theme.
Loading Images and Other Resources
You can load images from the theme directory by specifying them in the following manner:
themes/themeName/pathToFile .