Skip Headers
Oracle® Fusion Middleware User's Guide for Oracle Portal
11g Release 1 (11.1.1)

Part Number E10235-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

11.8 Applying a Style

You can apply styles to pages, tabs, and regions. On pages, you can apply styles explicitly and by default. This section describes the various ways to apply styles. It includes the following subsections:

11.8.1 Applying a Style to a Page

The style you apply to a page governs the colors and fonts used by the page and its content. You can apply styles to standard pages and to pages of a custom type that is based on a standard page.

This section explores the rules that govern how styles are applied in default situations and describes how to explicitly apply a style. It contains the following sub-sections:

11.8.1.1 Applying a Style by Default

You can specify that a page must use a user's current default style. The user's view of the page displays in that style. Users set their default style under Account Info. For more information, see Section 2.1.6, "Choosing a Default Page Style".

If you base a page on a Portal Template that does not allow pages to use a different style, your users will not be able to apply a different style to the page when they edit or customize the page.

If you change the style selection for a template, the style selection is also changed for any page that is based on that template. However, if the template allows pages to use a different style, and users have chosen different styles for pages based on the template, changes to the template style selection do not affect these pages.

There is a hierarchical structure to the application of styles when no explicit style is selected. First, it is useful to understand that default styles can be set at the system, page group, and individual user levels.

  • The system default is set on the Administer tab in the Services portlet under Global Settings.

  • The page group default is set in page group properties.

  • The user default is set by the user under Account Info.

Note that the page group default is not automatically applied to the page group root page; you must explicitly specify a style in the root page's page properties.

If the page group administrator has selected the page group option to Copy Parent Page Properties When Creating Page, new pages created in the page group will (by default) use the same style specified in the parent page's page properties (rather than the default style selected in the page group properties).

To summarize how default styles are used:

  • When page group administrators configure a page group to Copy Parent Page Properties When Creating a Page, then sub-pages use the style specified in the page properties of the parent page.

  • When page group administrators select the option, the page group's default style, specified in page group properties, is used for newly created sub-pages.

  • When page group administrators select the Use Default Properties When Creating Page option, and the page group's default style is set to <None>, then the system default style is applied.

  • An individual user's default style is specified in each user's Account Info settings. Users go into their personal portal accounts and select a preferred page style. This selection is applied when a page designer explicitly selects the page style <Use User's Default Style>.

    User default styles are useful where the page designer creates complimentary styles and configures all of the pages to use the current user's default style. In this example, users make updates to their Account Info style settings, and their entire portal changes to match that color scheme. Many popular Internet Service Providers follow this example, allowing users to select from a series of color schemes for their personal view of the home page.

    A hierarchy also controls what default style to use when the user's default is set to <None>:

    • If the user's Account Info default style is set to <None>, then the style defined by the user's default group is used. A user's default group is selected in the Account Info settings. The default group's default style is selected through the Portal Group Profile portlet.

    • If the group default style is set to <None> or the user has not selected a default group, the page group default style is used.

    • If the page group default style is set to <None>, then the system default style is used.

All of this becomes irrelevant when you explicitly apply a style to a page.

11.8.1.2 Applying a Style Explicitly

Note:

To apply a style to a page, you must have at least the page privilege Manage Style on the page and the page group option Allow Privileged Users To Manage Page Style must be enabled. For more information, see Section 4.3.2, "Controlling Who Can Apply a Different Style to a Page".

To apply a style to a page:

  1. Log in to Oracle Portal.

  2. Click the Build tab to bring it forward.

  3. From the Page Groups portlet Work In drop-down list, select the page group that owns the relevant page.

    By default, the Page Groups portlet is located on the Build tab of the Portal Builder page.

  4. Under Pages in the Layout & Appearance section, click the page to be edited.

    This opens the page in Edit mode.

  5. In the page toolbar at the top of the page, click the Style link.

    This screen does not display when the page group administrator does not allow users to change styles in the page group.

  6. Choose a style from the Choose Style list.

    Note:

    The Choose Style list includes all styles that you have created in this page group, all styles that were created in this page group by others and that you have privileges to use, and all styles in the Shared Objects page group. The initial selection is the page group's default style.

    Additionally, this list includes the choice <Use User's Default Style>. With this selection, the style a user chooses through the Account Info link will be used. The style each user sees will depend on his or her default style.

    The Current Style field shows which style is currently applied to the page. The Style Properties section includes a preview of the current style's settings.

    If you cannot find a style with the color and font settings that you want, and you have the appropriate privileges, you can click the Edit link in the Style Properties section to edit an existing style, or the Create New link to create a new style.

    Tip:

    Click each of the radio buttons in the Style Properties section to preview the colors and fonts provided by the style. The Style Properties section shows the style that is currently selected in the Choose Style list.

  7. Click OK to save your changes and return to the page.

If your changes do not display immediately, edit the style; click the Main tab to bring it forward; and click the Clear Cache link under Cache Invalidation. This will clear the previous style from the cache, allowing the newly-selected style to display. For information on how to edit a style, see Section 11.10, "Editing a Style".

11.8.2 Applying a Style to a Region

The style you apply to a region governs the colors and fonts used by the region and all the tabs, items, and sub-page links displayed within it. By default, regions use the same style as their parent page. However, you may want to apply a different style to a region to create visual interest.

You can apply a style to item, tab, and sub-page links regions. You cannot apply a style to a portlet region. All portlets on a page use the style that is applied to the page. One exception to this is page portlets. With page portlets, you are given the opportunity to use the source page's style or to use the style of the containing page. Using the style of the containing page works in most cases. The exception is when the source page is provided through the Federated Portal Adapter. In such cases, the setting to use the style of the containing page is ignored. The page portlet uses whatever style is applied to its source.

Note:

For more information on styles and portlets, see Section 11.13, "Troubleshooting Styles".

If your portlets are hand-coded, you can call your own cascading style sheet in lieu of an Oracle Portal style. For more information, see Section 12.3.3, "Using HTML to Create Templates for Database Portlets". See also, Section 11.12, "Using Portal Style Element Classes in HTML Templates and CSSs".

Note:

To apply a style to an item region, you must have at least the page privilege Manage on the page, and the option Allow Privileged Users To Manage Page Style must be selected for the page's page group.

To apply a style to an item, tab, or sub-page links region:

  1. Log in to Oracle Portal.

  2. Click the Build tab to bring it forward.

  3. From the Page Groups portlet Work In drop-down list, select the page group that owns the page on which to apply styles.

    By default, the Page Groups portlet is located on the Build tab of the Portal Builder page.

  4. Under Pages in the Layout & Appearance section, click the link to the page on which to apply styles.

    This opens the page in Edit mode.

  5. Click the Edit Region icon in the region on which to apply styles (Figure 11-14).

    Figure 11-14 The Edit Region Icon

    Edit Region icon
  6. On the resulting page, click the Style tab to bring it forward.

    This tab does not display when the page group administrator does not allow users to change styles in the page group.

  7. Select a style from the Style list.

    The style is applied to the region, and the Preview section is refreshed to show the style's settings.

    The Style list includes all the public styles in this page group and the Shared Objects page group, as well as any styles that you have created in this page group for your own use.

    To use the same style that is applied to the page, select <Use Page Style>.

  8. Click Close to save your change and return to the page.

If your changes do not display immediately, edit the style; click the Main tab to bring it forward; and click the Clear Cache link under Cache Invalidation. This will clear the previous style from the cache, allowing the newly-selected style to display. For information on how to edit a style, see Section 11.10, "Editing a Style".

When you apply a style to a tab, it controls the colors and fonts of the tabs themselves as well as the region containing the tabs. For this reason, you will want to be judicious in your choice of background colors for styles applied to tab regions. For example, in Figure 11-15, the tab region's background color has been defined for the style. In this example, the selection may not be the best choice for the overall look of the page.

Figure 11-15 Tab Region with Defined Background Color

Tab region with defined background color