Working with dynamic content spotsAdded by IBM | Edited by IBM on January 9, 2013 | Version 3 (Show original)
|You can add dynamic content to your custom theme by using either client-side or server-side logic.
You cannot add a JSP to WebDAV, as it needs a servlet context to compile and execute. But you can reference a JSP in the file theme.html by using a dynamic content spot.
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.
- Reference by name abstracts the dynamic content away from the implementation. This is necessary if the theme needs to run on multiple runtimes, for example WebSphere Portal and IBM® Mashup Center. The portal implementation of the navigation tabs can be a JSP that contains portal specific code. The Mashup Center on the other hand cannot execute portal JSP code, but provides an iWidget instead.
- Including a named dynamic content spot mapping:
<a rel="dynamic-content" href="dyn-cs:/newDynamicContent"></a>
- Including a theme JSP directly:
- Including an iwidget definition:
<div class="iw-iWidget id="myWidget">
<a class="iw-Definition" href="/path-to-widget-definition.xml"></a>
<span class="iw-ItemSet" style="display:none" title="attributes">
<a class="iw-Item" href="#key">value</a>
Configuring and modifying named dynamic content spots
The dynamic content spot mappings are defined in a Resource Environment Provider (REP) named WP DynamicContentSpotMappings
in the WebSphere Application Server administrative console. By default the portal installation has the following content spot mappings defined:
Table 1. Content spot mappings shipped for the Portal 126.96.36.199theme template
Table 2. Content spot values available in the skin template
|Name of the content spot||Value||Description|
|7002theme_asa||res:/wps/themeModules/asa/jsp/asa.jsp, wp_analytics||Provides the site analytics extension|
|7002theme_head||res:/wps/themeModules/themes/html/dynamicSpots/head.jsp||HTML head element that provides the document title, styles, bookmark icon, etc.|
|n/a||co:head||Invokes the combiner datasource which injects the head markup identified in the module profile|
|7002theme_pageModeToggle||res:/wps/themeModules/themes/html/dynamicSpots/pageModeToggle.jsp, wp_theme_js||Page mode toggle icon located in the theme header|
|7002theme_topNav||res:/ps/themeModules/themes/html/dynamicSpots/navigation.jsp?level=0&rootClass=wpthemeHeaderNav||Navigation located in the theme header, 1st level of navigation|
|7002theme_primaryNav||res:/wps/themeModules/themes/html/dynamicSpots/navigation.jsp?level=1&rootClass=wpthemePrimaryNav||Navigation located in the banner, 2nd level of navigation|
|7002theme_secondaryNav||res:/wps/themeModules/themes/html/dynamicSpots/navigation.jsp?level=2&rootClass=wpthemeSecondaryNav||Navigation located in the sub-banner, 3rd level of navigation|
|7002theme_commonActions||res:/wps/themeModules/themes/html/dynamicSpots/commonActions.jsp||Common actions located on the banner, i.e. Actions, Login, Logout|
|7002theme_crumbTrail||res:/wps/themeModules/themes/html/dynamicSpots/crumbTrail.jsp?level=2&rootClass=wpthemeCrumbTrail||Navigation breadcrumb trail to display the page selection path|
|7002theme_search||res:/wps/themeModules/themes/html/dynamicSpots/modules/search/markup/search.jsp||Search input displayed on the sub-banner|
|7002theme_layout||lm:template||Layout of the page|
|7002theme_footer||res:/wps/themeModules/themes/html/dynamicSpots/footer.jsp||Footer of the page|
|n/a||co:config||Invokes the combiner datasource which injects the config markup identified in the module profile |
|Content spot value||Description|
|lm:control||Renders the layout control body |
|lm:title||Renders the title of the portlet |
|lm:description||Renders the description of the portlet|
You can modify this configuration by using the WebSphere Application Server administrative console. When you work with this configuration, observe the following hints and tips:
Parent topic: Dynamic content spots
- 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 your own JSP in your own WAR file, or reference this JSP directly in your theme and bypass the configuration.
- The REP configuration is global, not per theme. Therefore, if you change the configuration, the change applies to all themes in your portal.
- To override a configuration for a specific theme only, set a theme metadata parameter with key=com.ibm.portal.theme.dynamic spot name and a value equal to the overriding POC URL (Piece Of Content URL).
- Changes to the Resource Environment Provider require a server restart to take effect.
- Theme metadata is easier to modify than the REP: Theme metadata is accessible for updates via 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.
- You are not limited to the dynamic spots that are shipped with the portal. If your theme design requires additional named content spots, you can add them.