Using Portal Style Element Classes in HTML Templates and CSSs Troubleshooting Styles

Working with Colors and Fonts 11-33 My Page portletnavigation page is using the background color of the container page, rather than the source page, as I prefer. To ensure that a page portlet or navigation page uses its own background color, rather than the one specified for the page it is placed on: 1. Ensure that the page portlet or navigation page uses its own style when it is published as a portlet that is, do not select this option for the page or navigation page that you are using as a portlet. 2. In the style that is used by the target page that is, the page where you place the page portlet or navigation page, set Portlet Body Color style element to Null no value. 11-34 Oracle Fusion Middleware Users Guide for Oracle Portal 12 Providing a Standard Look and Feel 12-1 12 Providing a Standard Look and Feel In your organization, you may care to impose a standard layout, look, and feel on all of your portal pages. Although you will want to allow for variations, such as the addition of different kinds of content on different pages, you may want the overall look from page-to-page, region-to-region, portlet-to-portlet, or item-to-item to remain precisely consistent. If this is the case, consider using templates. Figure 12–1 Use Templates for a Standard Layout and Style This chapter describes the template options offered in Oracle Portal and provides information on how to use them. It includes the following sections: ■ Section 12.1, Understanding Templates in Oracle Portal ■ Section 12.2, Working with Portal Templates for Pages and Items ■ Section 12.3, Working with HTML Templates ■ Section 12.4, Deleting Templates from Oracle Portal ■ Section 12.5, Troubleshooting Templates Oracle Portal provides several caching options to assist page designers and administrators with optimizing the performance of their portal pages, portlets, and 12-2 Oracle Fusion Middleware Users Guide for Oracle Portal templates. To find out more about caching, see Chapter 21, Improving Page Performance . For information about specifying access rules for Portal Templates, see Chapter 17, Protecting Your Content . Intended Audience This chapter is intended for users who will work with templates. Different types of privileges are required for different types of tasks. For example, the page group privilege Manage Templates enables a user to create a template. With Manage Templates alone, however, the user will not be able to access or view a page. Consequently, such a user must also have at least the page privilege Manage to apply a template.

12.1 Understanding Templates in Oracle Portal

A template is a tool for enforcing a standard layout and look and feel across multiple pages or within a region. When you change a template, all pages or regions that are based on that template are automatically changed as well. Templates provide additional standardization controls, depending on the type you use. In Oracle Portal, you can create two types of templates: ■ Portal Templates ■ HTML Templates These are described later in this chapter. Templates can be used only within their page group, except for those contained in the Shared Objects page group. Templates in the Shared Objects page group can be applied across page groups. This section provides descriptions of these template types and lists the conditions governing their use. It includes the following subsections: ■ Section 12.1.1, What Are Portal Templates? ■ Section 12.1.2, What Are HTML Templates? ■ Section 12.1.3, Comparing Template Types 12.1.1 What Are Portal Templates? Portal Templates are templates you build declaratively by stepping through a template-building wizard. You can use Portal Templates to enforce specific layouts, colors, fonts, and backgrounds. You can extend Portal Templates using page parameters and events. Note: The default language of the Shared Objects page group is English. This can have implications particularly when you want to share a template over non-English page groups. Objects on a template in the Shared Objects page group that do not have an explicit translation in the relevant language will not display on the non-English pages that are based on the template. If you want those objects to display, first you must add translated versions of those objects to the template. For information on adding item translations, see Section 19.3.1, Adding a Translated Item . Providing a Standard Look and Feel 12-3 You can use Portal Templates in two ways: with pages and with items. This section provides a high-level overview of the benefits and uses of Portal Templates and a more detailed discussion of Portal Templates for pages and Portal Templates for items. It includes the following subsections: ■ Section 12.1.1.1, Portal Template Uses and Benefits ■ Section 12.1.1.2, Portal Templates for Pages ■ Section 12.1.1.3, Portal Templates for Items

12.1.1.1 Portal Template Uses and Benefits

Portal Templates provide a simple, declarative means of defining templates to apply to pages and items. Use Portal Templates for pages on navigation pages, standard pages, and custom pages that are based on the standard page type. Use Portal Templates for items with Text items, PLSQL items, URL items, and all File items of the type texthtml or textplain. Portal Templates for pages enforce a standard appearance and page layout. Portal Templates for items display item content within the context of a template and, working in concert with parameters, show template portlets in a masterdetail relationship with the item currently displayed. Portal Templates for items use the Item Placeholder item type to stand in for item content. Users access an item’s URL, and the item renders within the context of the template, in the location formerly held by the Item Placeholder. Portal Templates for items can be applied at either the page or item level see Section 12.2.2, Using Portal Templates with Items .

12.1.1.2 Portal Templates for Pages

You can use Portal Templates for pages to enforce a particular layout, style, set of privileges, and content across multiple pages. As with a standard page, you can divide a Portal Template for pages into regions and tabs, apply a style to the template, grant access privileges, and add items and portlets. Additionally, you can define parameters for the template and use them in conjunction with the portlets placed on the pages that are based on the template. 12-4 Oracle Fusion Middleware Users Guide for Oracle Portal Figure 12–2 Portal Templates for Pages Any page that uses the template includes all the items, portlets, privileges, and parameters included in the template. An update to the template results in an instant and automatic update to all pages that are based on the template. Template builders have the option of allowing template users to specify their own access rules or select their own styles. When templates allow users to select their own access rules or styles, updates to these properties on the template do not affect the pages that are based on the template. For information on creating, applying, editing, or detaching a Portal Template for pages, see Section 12.2, Working with Portal Templates for Pages and Items .

12.1.1.3 Portal Templates for Items

You can use Portal Templates for items to enforce a particular layout, style, and associated content. With Portal Templates for items, a requested item displays within the layout defined by the template rather than in place on the item’s container page. For example, when a link to an item displays on the item’s container page, users click the link, and the item content displays within the context of its associated Portal Template. The item’s content is displayed in place of the item placeholder on the template Figure 12–3 . Providing a Standard Look and Feel 12-5 Figure 12–3 Portal Templates for Items You can use Portal Templates for items with Text items, PLSQL items, URL items, and all File items of the type texthtml or textplain. Portal Templates for items are built with the same wizard that is used for creating Portal Templates for pages. The main difference between these template types is that templates for items are used in conjunction with the Item Placeholder item type, while templates for pages are not. Once an item placeholder is added to a Portal Template, the Portal Template becomes a Portal Template for items and is available for use only with items. Another difference is the security model that applies to each template type. For more information, see Section 17.11, Granting Privileges on Portal Templates . When an item is requested through its URL, Portal Templates for items dynamically place the requested item’s content where the item placeholder is located on the template. Portal Templates for items cannot be used as page templates. Once the item placeholder is added to a Portal Template, the template no longer displays on any template pick lists used to apply templates to pages. The item placeholder reserves a position within the template layout. As items are requested, that position is filled with their content. You can select a default item to temporarily stand in for the content that will populate the reserved position. You may wish to select a default item for the item placeholder to ensure that relevant content is seen if the Portal Template for items is called directly, through its URL. Users switching between tabs on a page assembled from a Portal Template for items may lose the context of the originally-requested item. In such cases, users are likely to see the default placeholder item in lieu of the item that originally invoked the 12-6 Oracle Fusion Middleware Users Guide for Oracle Portal template. One way to circumvent confusing, though logical, situations like this is to keep item templates as simple as possible, with minimal in-page navigation, such as with few if any tabs and sub-tabs. You can define parameters in a Portal Template for items and use them to communicate with any portlets that are included on the template. You can apply access controls to Portal Templates for items that secure the entire template, template tabs, and template items. For more information, see Section 17.11, Granting Privileges on Portal Templates For information on creating, applying, editing, or detaching a Portal Template for items, see Section 12.2.2, Using Portal Templates with Items . 12.1.2 What Are HTML Templates? HTML Templates are templates you build using your own HTML code. You can build HTML to wrap around page content or to format region content. Create HTML Templates using a simple Oracle Portal wizard. Any valid HTML code can be placed in an HTML template. This includes JavaScript, Macromedia Flash, and the like. Additionally Oracle Portal provides HTML template substitution tags, which you can use to include Oracle Portal content in the template. For more information on HTML substitution tags, see Appendix E, Substitution Tags for HTML and Unstructured UI Templates . HTML Templates include two subtypes: HTML Page Skins and HTML Content Layouts. This section describes these template types and explores their potential uses. It includes the following subsections: ■ Section 12.1.2.1, HTML Template Uses and Benefits ■ Section 12.1.2.2, HTML Page Skins ■ Section 12.1.2.3, HTML Content Layouts

12.1.2.1 HTML Template Uses and Benefits

HTML templates give you more control over HTML for your pages. Use them for page and page portlet decoration, for wrapping pages and page portlets in HTML or any other standard Web mark-up, and for laying out and formatting item links in concert with their item attributes. HTML page skins render around the outside borders of a page. They can be applied to both pages and Portal Templates. For example, you can apply an HTML page skin to a Portal Template, then apply the Portal Template to a page. Because pages allow the application of only one page-level template, applying an HTML page skin to a Portal Template, then applying the Portal Template to a page is a way to enable a page to use an HTML page skin and a Portal Template at the same time. The page skins you apply to a page also display when the page is exposed as a portlet. The template wraps around the portlet, giving the appearance of a region skin. You can use an HTML content layout template to achieve the same effect. Page skins use page-level substitution tags to stand in for standard page elements, such as the page title, the currently logged in user, seeded site links, and the like. Substitution tags generate the HTML to render information stored in the Portal Repository. Additionally, you can use oracleoracle tags to introduce PLSQL elements, such as conditional statements, into your template. For more information on HTML page skin substitution tags, see Appendix E, Substitution Tags for HTML and Unstructured UI Templates .