Show TOC

 Distinguishing Forums Using ThemesLocate this document in the navigation structure

Use

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:

  • A theme.xml file

    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>

  • A directory named templates.

    All custom template files are loaded from the templates directory.

Prerequisites

The templates must be valid FreeMarker template files. For more information on FreeMarker, visit http://freemarker.sourceforge.net/Information published on non-SAP site .

Note

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.

Procedure
  1. From the Admin Console, open the User Interface tab.
  2. In the left-hand navigation pane, choose Custom Themes.

Selecting the Global Theme

  1. In the Themes list, select the custom theme you want to activate as the global theme.
  2. Save the theme selection.
  3. In clustered environments: Restart the cluster.

Mapping Themes

  1. In the Theme Maps section, choose Add Theme Map.
  2. Select a theme.
  3. Select one of the following ways to map pages to themes:
    • URL - Associate a theme with a URL pattern (using regular expressions).

      If the requested URL matches one of these URL mappings, the specified theme is displayed.

    • Locale - Associate a theme with a specific locale.
    • Categories/forums - Associate a theme with any page that has a handle on a category or forum object
  4. Choose Add.
  5. In clustered environments: Restart the cluster.

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 .