<portal-theme-ext/> tags
The <portal-theme-ext/> tags are used to provide extended functionality to enhance portal themes.The following table provides a brief description of each tag.
Do not use portal tags in portlet JSPs. The following tags are only for use in theme and skin JSPS.
Tag Description <portal-theme-ext:initthemepolicy/> Used to get the theme policy for the current page. <portal-theme-ext:themeExtension/> Used to locate the theme extensiondefined by the plugin.xml. <portal-theme-ext:themeExtensionLoop/> Used for iterating through all of the extensions defined in the plugin.xml. <portal-theme-ext:themeExtensionItemTooltip/> Prints the tool tip for the extension if available. <portal-theme-ext:themeExtensionItemText/> Prints the text associated with the extension. <portal-theme-ext:themeExtensionItemUrl/> Streams the URL associated with the current ThemeLinkItem to the output stream. <portal-theme-ext:themeExtensionItemIconUrl/> Create a URL for the extension icon. <portal-theme-ext:themeExtensionRenderInclude/> Renders extensions which use the com.ibm.portal.theme.plugin.ThemeInclude interface.
Detailed descriptions of the <portal-theme/> tags
The following section provides detailed descriptions of the <portal-theme/> JSP tags:
- <portal-theme-ext:initthemepolicy/>
- Used to get the theme policy for the current page. The tag makes two variables available in the JSP.
Variables
- portalThemePolicyMap
- Holds all of the theme policy values as a map.
- portalThemePolicyPath
- Holds the path of the theme policy.
- <portal-theme-ext:themeExtension id="id_name"/>
- Used to locate the theme extensiondefined by the plugin.xml. The tag has one attribute.
Attributes
- id
- Specifies the id of the extension you will be using defined in the plugin.xml. The following example is where com.ibm.portal.theme.plugin.MenuItem is defined inside the plugin.xml and is used for the id attribute:
<extension point="com.ibm.portal.theme.plugin.MenuItem" id="MenuItems" name="PageMenuItems"> <item id="PageMenuItemOne" class="com.ibm.wps.theme.plugin.impl.PageMenuItem" context="com.ibm.wps.theme.plugin.impl.PageContext" name="Item One" resourceBundle="nls.engine" portletWindowState="Solo" pacCheck="NoCheck" /> </extension>
- When to use the extension that has been defined inside the plugin.xml in the JSP, we can then use the tag as follows:
<portal-theme-ext:themeExtension id="com.ibm.portal.theme.plugin.MenuItem" > <portal-theme-ext:themeExtensionLoop> . . [extensions rendered] . . </portal-theme:themeExtensionLoop> </portal-theme:themeExtension>
- <portal-theme-ext:themeExtensionLoop/>
- Used for iterating through all of the extensiondefined in the plugin.xml.
- <portal-theme-ext:themeExtensionItemTooltip/>
- Prints the tool tip for the extension if available.
- <portal-theme-ext:themeExtensionItemText/>
- Prints the text associated with the extension. The extension must implement the com.ibm.portal.theme.plugin.ThemeTextItem interface.
The following code example uses this tag to include text inside a table that is being created:
<table> <portal-theme-ext:themeExtension id="com.ibm.portal.theme.plugin.PageMenuItem" > <portal-theme-ext:themeExtensionLoop> <tr> <td> <portal-theme-ext:themeExtensionItemText/> </td> </tr> </portal-theme:themeExtensionLoop> </portal-theme:themeExtension> </table>
- <portal-theme-ext:themeExtensionItemUrl"/>
- Streams the URL associated with the current ThemeLinkItem to the output stream.
The following code example uses this tag to set the location of the anchor tag to the current ThemeLinkItem:
<portal-theme-ext:themeExtension id="com.ibm.portal.theme.plugin.PageMenuItem" > <portal-theme-ext:themeExtensionLoop> <c:set var="extensionTitle"><portal-fmt:title varname="<%=(com.ibm.portal.theme.plugin.ThemeItem) themeExtension%>" /> </c:set> <a href="http://setgetweb.com/p/portal80/<portal-theme-ext:themeExtensionItemUrl />"> <c-rt:out value="${extensionTitle}" escapeXml="true" /></a> </portal-theme:themeExtensionLoop> </portal-theme:themeExtension>
- <portal-theme-ext:themeExtensionItemIconUrl state="filename_state"/>
- Creates a URL for the extension icon.
Attributes
- state
- State used to determine the file name of the icon. Use the following values:
- STATE_ENABLED
- STATE_ENABLED_HOVER
- STATE_ACTIVE
- STATE_DISABLED
- <portal-theme-ext:themeExtensionRenderInclude/>
- Renders extensions which use the com.ibm.portal.theme.plugin.ThemeInclude interface. A ThemeInclude is a theme contribution responsible for its own rendering.
Syntax notes
Added a trailing space after every element. For example
Bad (<c:set var="childNodeTitle" value="${childNode.title}"/>) Good (<c:set var="childNodeTitle" value="${childNode.title} "/>) In general, when use the trim function when using the length function
Bad (<c:set var="titleLength" value="${fn:length(childNodeTitle))}" />) Good (<c:set var="titleLength" value="${fn:length(fn:trim(childNodeTitle))}" />)
Parent: Tags used by the portal JSPs
Related: <portal-core/> tags
<portal-dynamicui/> tags
<portal-fmt/> tags
<portal-logic/> tags
<portal-navigation/> tags
<portal-showtools/> tags
<portal-skin/> tags