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/IBM directory. We 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.jsp Sets headers to control how the output CSS is cached
styles_rules.jsp Defines logic to be consumed by style definitions
styles_theme.jsp Style definitions for the theme
styles_portlets.jsp Standard styles for portlets
styles_ibm.jsp Styles for IBM portlets
styles_help.jsp Styles for portlet help files
styles_oob.jsp Styles for out of box Information portlet JSPs

 

Modify dynamic styles

All logic controlling the generation of dynamic styles is contained in styles_rules.jsp. 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 the style definitions, as well as to modify the logic as desired for the installation.

If you want to add your own additional styles, create your own JSP fragment, such as styles_myStyles.jsp, and modify styles.jsp to include it as well. In this way, the 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. For more information, refer to Tags used by the portal JSPs.

 

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 the portlet output, portlet developers can examine the styles_portlets.jsp file that is located in the IBM WAS directory:

  • Windows:

    was_profile_root\installedApps\cellname\wps.ear\wps.war\themes\html\IBM \

  • UNIX:

    was_profile_root/installedApps/cellname/wps.ear/wps.war/themes/html/IBM /

  • i5/OS:

    app_server_root/installedApps/cellname/wps.ear/wps.war/themes/html/IBM /css

The file includes comments explaining the use of each class.

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

 

Related information