Work with dynamic content spots

You can add dynamic content to custom theme by using either client-side or server-side logic.

Client-side logic

Server-side logic

For details about the syntax and examples of referencing dynamic content in the theme.html template refer to topic about Writing theme HTML.

There are cases where it can be better to not reference the dynamic content directly, but rather reference it by a logical name.

Examples:


Configure and modifying named dynamic content spots

The named dynamic content spots are defined in a Resource Environment Provider (REP) named WP DynamicContentSpotMappings in the WAS administrative console. By default the portal installation has the following named content spots defined:

Table 1. Named content spots shipped in a default portal installation

Name of the content spot Value Description
head res:/PageBuilder2/themes/html/PageBuilder2.0/head.jsp The head section of the theme
bannerNav res:/PageBuilder2/themes/html/PageBuilder2.0/bannerNav.jsp The banner navigation of the theme
search res:/PageBuilder2/themes/html/PageBuilder2.0/searchAndEdit.jsp The search widget
bannerCommonActions res:/PageBuilder2/themes/html/PageBuilder2/bannerCommonActions.jsp The username, actions menu, help link, login/logout
status res:/PageBuilder2/themes/html/PageBuilder2/status.jsp The status bar for the theme
tabNav res:/PageBuilder2/themes/html/PageBuilder2.0/tabNav.jsp The tabbed navigation with drag and drop and submenus
pageToolbar res:/PageBuilder2/themes/html/PageBuilder2.0/pageToolbar.jsp The toolbar displaying buttons for customization
layout lm:template Renders the layout of the page
asa res:/PageBuilder2/themes/html/PageBuilder2/asa.jsp Active site analytics
config res:/PageBuilder2/themes/html/PageBuilder2/config.jsp The config for the theme, setup of ibmCfg object

Caching:

The parameter max-age can be set on a dynamic spot POC URL to define caching. The value for max-age is set in seconds, while a value of -1 means that information is cached for as long as the server is running. A server restart refreshes the cache.

Example:

res:/PageBuilder2/themes/html/PageBuilder2/spot.jsp?max-age=604800

You can modify this configuration by using the WAS administrative console. When you work with this configuration, observe the following hints and tips:

  1. To change the implementation of a JSP, do not modify the version of the JSP provided with the portal. Either change this configuration to point to own JSP in own WAR file, or reference this JSP directly in theme and bypass the configuration.

  2. The REP configuration is global, not per theme. Therefore, if you change the configuration, the change applies to all themes in the portal.

  3. To override a configuration for a specific theme only, set a theme metadata parameter with key=com.ibm.portal.dynamic-content-spot.dynamic spot name and a value equal to the overriding POC URL (Piece Of Content URL). An override requires the theme to be specified on the dynamic content spot. You can specify the theme by using @tl:oid:<theme unique name> at the end of the mapping name.

      Example: <a rel="dynamic-content" href="dyn-cs:tabNav@tl:oid:csa2.theme"></a>

  4. Theme metadata is easier to modify than the REP: Theme metadata is accessible for updates through the themelist entry point on WebDAV and does not require a server restart for the changes to take effect. You might consider overriding the defaults through theme metadata, particularly at development time, even if the changes are global in production

    When viewing metadata through the themelist WebDAV entry point, all keys with the prefix com.ibm.portal are hidden from view. You can add the metadata using this entry point and it will be applied, but after persisting the change to the back-end, reopening the metadata properties file might not display it.

  5. You are not limited to the dynamic spots that are shipped with the portal. If theme design requires additional named content spots, you can add them.

  6. Changes to the Resource Environment Provider require a server restart to take effect.


Develop custom themes

Related reference

Page Builder theme templates (theme.html)

December 14, 2011
   

 

Apr 1, 2011 4:55:28 PM Apr 1, 2011 1:26:17 PM

});


+

Search Tips   |   Advanced Search