Portal style classes

 

+

Search Tips   |   Advanced Search

 

The CSS style sheets that are used for the portal page are dynamically generated by JSPs located in the /themes/Portal/. You can change the tag definitions and the class definitions in the CSS style sheets. However, make sure that you do not delete any style sheets or remove any style classes. Portlets require these style classes for JSP output.

Dynamically generated style sheets require far fewer files to support variations based on locale, browser, and color palette. The following provides information about the CSS File structure:

styles.jsp Root page which includes children
styles_cacheSettings.jspf Headers to control how the output CSS is cached
styles_rules.jspf Logic to be consumed by style definitions
styles_theme.jspf Style definitions for the theme
styles_portlet.jspf Standard styles for portlets
styles_ibm.jspf Styles for IBM portlets
styles_help.jspf Styles for portlet help files
styles_oob.jspf Styles for out of box Information portlet JSPs

 

Modifying dynamic styles

All logic controlling the generation of dynamic styles is contained in styles_rules.jspf. This JSP fragment creates a map of rules for use by the style definitions. Refer to this file for the rules available for use in your style definitions, as well as to modify the logic as desired for your installation.

To add your own additional styles, create your own JSP fragment, such as styles_myStyles.jspf, and modify styles.jsp to include it as well. In this way, your styles are incorporated into the portal stylesheet and are able to use the dynamic rules.

 

Caching dynamic styles

Dynamic styles vary their output by browser, locale, and color palette. The <portal-theme:cacheProxyUrl> tag generates a cacheable url to styles.jsp that encodes the browser, locale and color palette variables. This allows the output CSS to be cached by the server for improved performance.

 

Style classes for portlets

The style sheets that are used by IBM WebSphere Portal contain classes that can be used by portlets to ensure visual consistency among portlets on the page. Using these classes ensures that no matter what theme has been selected, the portlet look and feel matches that of other portlets and the portal page. To determine which classes to invoke in your portlet output, portlet developers can examine the styles_portlet.jspf file that is located in the IBM WAS directory:

The file includes comments explaining the use of each class.

Portlet helps use the style classes in styles_help.jspf . For most tags, using class="help" ensures that the portlet help renders consistently with helps for other portlets on the page.

 

Parent topic

Customizing the portal