Skip Headers
Oracle® Application Server Portal User's Guide
10g Release 2 (10.1.4)
B13809-04
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

13 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 13-1 Use Templates for a Standard Layout and Style

Templates standardize page layouts and styles
Description of "Figure 13-1 Use Templates for a Standard Layout and Style"

This chapter describes the template options offered in OracleAS Portal and provides information on how to use them. It includes the following sections:

OracleAS Portal provides several caching options to assist page designers and administrators with optimizing the performance of their portal pages, portlets, and templates. To find out more about caching, see Chapter 22, "Improving Page Performance".

For information about specifying access rules for Portal Templates, see Chapter 18, "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.

13.1 Understanding Templates in OracleAS 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 OracleAS Portal, you can create two types of 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.


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 20.3.1, "Adding a Translated Item".

This section provides descriptions of these template types and lists the conditions governing their use. It includes the following subsections:

13.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.

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:

13.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, PL/SQL items, URL items, and all File items of the type text/html or text/plain.

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 master/detail 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 13.2.2, "Using Portal Templates with Items".

13.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.

Figure 13-2 Portal Templates for Pages

Portal templates for pages
Description of "Figure 13-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 13.2, "Working with Portal Templates for Pages and Items".

13.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 13-3).

Figure 13-3 Portal Templates for Items

Portal templates for items
Description of "Figure 13-3 Portal Templates for Items"

You can use Portal Templates for items with Text items, PL/SQL items, URL items, and all File items of the type text/html or text/plain.

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 18.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 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 18.11, "Granting Privileges on Portal Templates"

For information on creating, applying, editing, or detaching a Portal Template for items, see Section 13.2.2, "Using Portal Templates with Items".

13.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 OracleAS Portal wizard.

Any valid HTML code can be placed in an HTML template. This includes JavaScript, Macromedia Flash, and the like. Additionally OracleAS Portal provides HTML template substitution tags, which you can use to include OracleAS 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:

13.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 <oracle></oracle> tags to introduce PL/SQL 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".

At the region level, choose between selecting specific attributes for display and rendering region content with an HTML content layout template. With HTML content layouts, the HTML you create repeats for every item in a region. For example, create an HTML content layout with a two-column structure, that exposes item content (in the form of a link to the item) in one column and its Create Date, Description, and Author attributes in the other column. Enter the HTML for this once in the HTML content layout template. Apply the template to a region with three items. All three items display according to the template's HTML (Figure 13-4).

Figure 13-4 Region with an HTML Content Layout

Region with an HTML content layout
Description of "Figure 13-4 Region with an HTML Content Layout"

HTML content layouts use item-level substitution tags for label, value, and style, allowing you full control of your HTML. Additionally, with HTML content layouts you can use <oracle></oracle> tags to introduce PL/SQL elements, such as conditional statements, into your template.

13.1.2.2 HTML Page Skins

Use HTML page skins to define the appearance of the area surrounding page content. You can use HTML tables to make the page skin display content on all four sides of the page. You can add images, text, HTML formatting, JavaScript, and any other typical mark up or object type you could place on any other Web page.

Figure 13-5 HTML Page Skin

HTML page skin
Description of "Figure 13-5 HTML Page Skin"

With HTML page skins, you define where the body area of the page will be. The body area is where page content will display.

You can introduce OracleAS Portal elements into your page skin through the use of HTML page skin substitution tags. Use these to introduce such elements as page Edit or Personalize links, the name of the currently logged-in user, the current page's display name, and so on. For a list of HTML page skin substitution tags, including descriptions and examples, see Appendix E, "Substitution Tags for HTML and Unstructured UI Templates".

You can also use <oracle></oracle> tags to introduce PL/SQL elements, such as conditional statements, into your template.

Create an HTML page skin using an OracleAS Portal wizard. You can use a third-party HTML editor to create the template HTML, then simply cut and paste your result into the wizard's HTML code field.

For information about creating, applying, editing, or detaching an HTML page skin, see Section 13.3.1, "Using HTML to Define a Page Border".

13.1.2.3 HTML Content Layouts

Use HTML content layouts to define a formatting scheme for content within a particular region. Design HTML content layouts for use with item regions, portlet regions, or both. Use HTML to create tables, font designs, colors, and any other mark up or object type you could place in any other HTML template. You can even call a cascading style sheet (CSS) to apply a standard format that you use in other forms of company documentation.


Note:

The HTML content layout repeats itself for each portlet or item in the region. Consider carefully before using a CSS in the content layout. The CSS is repeated as many times as the number of items in the region.

For additional information on OracleAS Portal and cascading style sheets, see Section 12.12, "Using Portal Style Element Classes in HTML Templates and CSSs".


Figure 13-6 HTML Content Layout

HTML content layout
Description of "Figure 13-6 HTML Content Layout"

Use HTML content layout substitution tags to introduce OracleAS Portal elements, such as display names, descriptions, categories, perspectives, and so on. For a list of HTML content layout substitution tags, including descriptions and examples, see Appendix E, "Substitution Tags for HTML and Unstructured UI Templates".

You can also use <oracle></oracle> tags to introduce PL/SQL elements, such as conditional statements, into your template.

Create your HTML content layout using the Oracle AS Portal wizard. You can use a third-party HTML editor to create the template HTML, then simply cut and paste your result into the wizard's HTML code field.

For information on creating, applying, editing, or detaching an HTML content layout, see Section 13.3.2, "Using HTML to Define the Layout and Appearance of Region Content".

13.1.3 Comparing Template Types

Table 13-1 provides a concise description of where in the OracleAS Portal user interface you can apply each type of template and a brief summary of the conditions governing the use of each type.

Table 13-1 Comparison of Template Types

Type Where to Apply Conditions Governing Use

Portal Templates for Pages

  • Select a default template for the page group on the Configure tab of page group properties.

  • Select a template for a page on the Template tab of page properties.

The default template you select at the page group level is applied to sub-pages in the page group only if page designers do not explicitly select a template when they create pages. Additionally, the page group setting Use Default Properties When Creating Page (on the Configure tab of page group properties, under Page Defaults) must be selected. If it is not selected, sub-pages inherit whatever template is specified for the parent page's page properties, rather than from page group properties).

Use Portal Templates for pages on navigation pages, standard pages, or custom page types that are based on the standard page type.

Portal Templates for Items

Select a Portal Template for items on the Items tab of page properties (but see Conditions Governing Use).

  • For this feature to be available, a Portal Template for items must be defined for the page group that owns the current page or for the Shared Objects page group.

  • For the template to be a Portal Template for items, it must contain an item placeholder-type item.

  • Default content for the item placeholder can be a file or a text item type. Files can contain either text or HTML.

HTML Page Skins

  • Select a default template for the page group on the Configure tab of page group properties.

  • Select an HTML Page Skin for a page on the Template tab of page properties

The option to use a page skin is selectable on a page's Template tab only when at least one page skin is defined in the page group or the Shared Objects page group.

HTML Content Layouts

To select an HTML Content Layout:

  1. Edit a portlet or item region.

  2. Go to the Attributes tab.

  3. Select the Use HTML Content Layout radio button.

  4. Select a content layout template.

The option to use a content layout is selectable on the Attributes tab only when at least one content layout is defined in the page group or the Shared Objects page group.



Note:

When a page group and the Shared Objects page group both have a template of the same name, the page group name is added to the template name in pick lists. For example: <template_name> (page_group_name). This assists in distinguishing between templates on pick lists.

13.2 Working with Portal Templates for Pages and Items

Use Portal Templates for pages and Portal Templates for items when you want your pages to display consistent layout, font, color, and auxiliary content when viewing a page or an item.

This section provides information on using both types of Portal Templates. It includes the following subsections:

13.2.1 Using Portal Templates with Pages

Portal Templates for pages enable you to enforce a standard look and feel on your portal pages. Keep in mind that a Portal Template for pages is rigorous in enforcing the layout, look, and feel it provides. For example, in most cases, you cannot add new regions to pages that are based on Portal Templates. Be sure the template contains the regions your content providers will require.

There's one exception to the "no new regions" rule. If the template includes a tab, users with edit or personalization privileges on a page can add more tabs on pages that are based on the template. Then they can create additional regions on the new tabs.

Additionally, you can allow or prevent privileged users from applying a page style other than the one provided by the template. You can lock template regions to prevent anyone from adding content to those regions. And you can allow or prevent privileged users from defining page access rules other than those defined for the template.

Use Portal Templates for pages on navigation pages, standard pages, or custom page types that are based on the standard page type.

This section provides information on how to create, apply, edit, and detach Portal Templates for pages. It includes the following subsections:

13.2.1.1 Creating a Portal Template for Pages

There are two methods for creating a Portal Template for pages:

13.2.1.1.1 Creating a Portal Template for Pages Using a Wizard

The template creation wizard provides an easy-to-use interface for defining the underlying structure of your Portal Template. Use the template creation wizard to:

  • Specify whether the template should be available immediately or remain unpublished until it is complete

  • Select the style that will define its colors, fonts, and background images

  • Specify access rules that will define which users can access the pages that are based on the template

During the process of creating a template, you are given the opportunity to select a navigation page banner for the top of your template and a style to specify the fonts, colors, and background image to apply to the template. Before you create a template, the navigation page and style you plan to use should already be created and available for selection. For information on defining a style, see Chapter 12, "Working with Colors and Fonts". For information on creating a navigation page, see Chapter 14, "Designing Your Portal's Navigation".

You can use Portal Templates for pages on navigation pages, standard pages, or custom page types that are based on the standard page type.

To create a Portal Template with the template creation wizard:


Note:

In the OracleAS Portal user interface, fields that require a value are marked with an asterisk (*).

  1. Log in to OracleAS Portal.

  2. Click the Build tab to bring it forward.

  3. From the Page Groups portlet Work In drop-down list, select a page to own the template.

    The default location of the Page Groups portlet is on the Build tab of the Portal Builder page. If you plan to use this template across multiple page groups, select the Shared Objects page group. Templates in the Shared Objects page group can be shared across page groups. Templates in any other page group can be used only within their page group.

  4. In the Layout & Appearance section, click the Create link next to the Portal Templates heading.

    This opens the template creation wizard.

  5. In the Display Name field, enter a Display Name for the template.

    Use up to 256 characters of any kind. The Display Name identifies the template in the Page Groups portlet, the Portal Navigator, and the various template pick lists.

  6. Enter a template description in the Description field.

    Enter information that future template editors would find useful. The description is accessible by viewing template properties.

  7. Select Make available for use in this page group if you want the template to be immediately available for use in its page group.

    Selecting this option adds this template's display name to the Portal Template pick list on the Template tab in page properties. Users with a sufficient privilege level on the page will be able to see and select this template.

    Consider clearing this check box while you develop the template to prevent other users from selecting it until it is complete. The template name displays in the Page Groups portlet so that you can continue to access it easily to continue its development. But it does not appear on the template pick list on the page properties Template tab. Consequently, it cannot be applied to a page.

  8. Select a banner from the Navigation Page For Banner drop-down list.

    If you will not use any of the banners that are available on this list, select <None>. This list includes all the navigation pages in this page group and the Shared Objects page group.

  9. Click Next.

    Alternatively, click Finish to skip selecting a style or specifying template access settings. The default values for these properties will automatically apply.

  10. Select Enable Pages To Use Different Style to enable users with sufficient privileges to apply a different style to pages that are based on the template.

    Clear this check box if you want users to have no choice about what style to use. Pages that are based on the template will always use the style you choose here. Users will be prevented from selecting a different style, even for their own version of the page. That is, when a page is being personalized, the Style tab will not display.

    This setting works in conjunction with the Page Group properties Allow Privileged Users to Manage Page Style and Allow Privileged Users to Personalize Page Style. For more information, see Section 4.3.2, "Controlling Who Can Apply a Different Style to a Page".


    Note:

    When you base a page on the template, it will initially use the template's style. The page will continue to use the template's style even when you enable pages based on the template to have their own style selections. Every time you update the style for the template, the style for the pages based on the template will also be updated. This relationship continues until you select a different style for the page.

  11. Select Enable Pages to Have Different Access to enable users with sufficient privileges to choose different access control settings when they create or edit pages that are based on the template.

    Clear this check box to prevent users from choosing different access control settings when they create or edit pages that are based on this template. Such pages will always use the template access control settings.

  12. Select Display Page to Public Users to enable all users to view pages that are based on this template—even users who are not logged on.

    Clear this check box to limit the display of pages that are based on this template to users who have been granted explicit access to them.

  13. Select Enable Item Level Security to enable item creators to specify access control settings for individual items on pages that are based on this template.

    • If you select this check box, item creators can choose to inherit access control from the page or specify access control for individual items.

    • If you do not select this check box, all the items on the page inherit access control from the page, rather than the template.


    Note:

    For more information on security features in OracleAS Portal, see Chapter 18, "Protecting Your Content".

  14. Under the Grant Access section, define access settings for individual users and groups:

    1. In the Grantee field, select a user or group.

      Browse for user or group names by clicking the Browse Users or Browse Groups icons.


      Note:

      OracleAS Portal uses the Oracle Internet Directory for identity management. The Oracle Internet Directory serves as the repository for users and groups. In the Oracle Internet Directory, groups are uniquely identified by their distinguished name (DN). Each group has a unique DN, though many groups can share a common name, in the same way that two people can share a common name, yet have completely different lineage (such as John Smith and John Doe). When working within the portal, groups created from within that portal are displayed simply with their common names. However, when the portal references a group from some other location in the Oracle Internet Directory—such as a group from some other portal associated with the same Identity Management Infrastructure—the DN of the group is displayed to distinguish it from the portal's locally defined groups.

    2. In the next (access privilege) field, select the level of privilege to grant to the selected user or group.

      For an explanation of the listed privileges, see Appendix B, "Page Group Object Privileges".

    3. Click the Add button.

      Once you grant a privilege, a Change Access section displays. Use this section to revise or revoke privileges.

  15. Click the Finish button.

    The template displays in Edit mode. Create regions, add content, and complete the construction of the template. For information on working with regions, see Chapter 11, "Working with Layouts". For information about adding content, see Chapter 15, "Working with Items" and Chapter 16, "Working with Portlets".

A Portal Template can enforce both style and access for a page. When it does, the Style or Access tab or both tabs are not displayed in the page properties tab set for pages that are based on the Portal Template.

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 that belongs to 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 more information, see Chapter 20, "Translating Portal Content".

13.2.1.1.2 Converting a Page to a Portal Template

You can use an existing standard page as the starting point for a new template. When you convert a page to a template, a copy of the page is created. The copy becomes the new template. The original page still exists, and is not affected by the conversion.

Only pages that are not based on a template can be converted to templates.

When you convert a page to a template, almost everything associated with the page is converted, but a few things are not. The attribute values, option selections, and objects that are not converted from the source page include:

  • Caching options

  • Contact E-Mail

  • Category

  • Perspectives

  • Keywords

  • Default WebDAV Types

  • Portal Template for items assignment

  • Custom page attributes

  • Page Images

  • Approval routing

  • Sub-pages

  • Page function items

To convert a page to a Portal Template:

  1. Log in to OracleAS 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 to be converted.

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

  4. Under Layout & Appearance, click the Browse link next to the Pages heading.

  5. On the resulting Portal Navigator page, click the Convert to Template link next to the page you will convert.


    Note:

    If you want to create a template from the page group's root page, click Convert Root Page to Template next to the page group in the Portal Navigator.

  6. In the confirmation screen, click Yes to convert the page to a Portal Template.

    You are returned to the Portal Navigator where the original page remains intact. A copy of the page is created under the Portal Templates node in the Portal Navigator. A link to it also displays under the Portal Templates heading in the Page Groups portlet. Click this link to edit the template.

  7. Optionally, click the Builder link at the top of the page to return to the Portal Builder page.

13.2.1.2 Applying Portal Templates for Pages

You can apply Portal Templates for pages to navigation pages, standard pages, or custom page types that are based on the standard page type.

To apply a Portal Template for pages:

  1. Log in to OracleAS Portal.

  2. Click the Build tab to bring it forward.

  3. In the Page Groups portlet, select the page group that owns the page to which you will apply a Portal Template from the Work In drop-down list.

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

  4. In the Layout & Appearance section, under the Pages heading, click the link to the page to which you will apply a template.

    This opens the page in Edit mode.

  5. In the toolbar at the top of the page, click the Page: Properties link.

  6. On the resulting page, click the Template tab to bring it forward.

  7. Select the Use Portal Template radio button, and select the Portal Template you will use from the Portal Template drop-down list.

    When a page group and the Shared Objects page group both have a template of the same name, the page group name is added to the template name in pick lists. For example: <template_name> (page_group_name). This assists in distinguishing between templates on pick lists.

  8. If the page contains content, a Region Mapping section displays.

    In this section, specify where you want to move content from the original page regions into the new, template-provided regions. The regions are represented either by automatically-assigned identification numbers or by their user-assigned region names.

  9. Click OK to save your changes and open the page in Edit mode.

13.2.1.3 Editing Portal Templates for Pages

To edit a Portal Template for pages:

  1. Log in to OracleAS 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 template to be edited.

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

  4. In the Layout & Appearance section, under the Portal Templates heading, click the link to the relevant template.

    This opens the template in Edit mode.

  5. Make your changes, and click the View Template link in the toolbar at the top of the page to view your results.

For information on template caching options, seeChapter 22, "Improving Page Performance".

When you edit a page that is based on the template, you can also click the Edit Template link in the toolbar at the top of the page to enter Template Edit mode.

13.2.1.4 Detaching a Portal Template from a Page

If you will no longer use a Portal Template for a particular page, you can detach the template from the page. When you detach a Portal Template from a page, the page retains the same layout and content that was provided by the template, but the page now owns it. Any changes made to the template no longer affect the page. If you have a sufficient level of privilege, you will now be able to change the layout of the page and add content to any region.

To detach a Portal Template from a page:

  1. Log in to OracleAS 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 from which to detach a template.

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

  4. In the Layout & Appearance section, under the Pages heading, click the link to the page from which to detach a Portal Template.

    This opens the page in Edit mode.

  5. Click the Page: Properties link in the toolbar at the top of the page.

  6. On the resulting page, click the Template tab to bring it forward.

  7. Click the Detach from Template link next to the Use Portal Template field.


    Note:

    If you do not see the Detach from Template link, the page does not use a template.

  8. In the confirmation page, click Yes to detach the template.

  9. Click OK to return to the page.

13.2.2 Using Portal Templates with Items

You can use Portal Templates for items to control the appearance of items—including supporting content and decoration—when they are accessed through a URL. For example, render item content while maintaining the context of your portal's look and feel. Use Portal Templates for items with Text items, PL/SQL items, URL items, and File items of type text/html or text/plain.

Any access rules you define for a Portal Template for items are preserved. When an unauthorized user tries to access an item in the context of a template, an error message is rendered.

Users can view an item within the context of its template when one of the following conditions is met:

  • The template is public.

  • The user has at least the View privilege on the template.

  • The user has Manage Template privilege on the page group.

This section describes how to create, apply, edit, and detach from a Portal Template for items. It contains the following subsections:

For information on parameter passing and Portal Templates for items, see Section 23.6.1, "Defining Parameter Values for Items Displayed on a Portal Template". For information on securing Portal Templates for items, see Section 18.11, "Granting Privileges on Portal Templates".

13.2.2.1 Creating Portal Templates for Items

Portal Templates for items enable page designers to create a template that defines layout, font, color, and auxiliary content in addition to a placeholder that is replaced dynamically with the content of the requested item. You can select default content for the item placeholder to display in the event that the target content should lose its context, such as when a user navigates away from the item content, then navigates back to it.

When users click a tab on a Portal Template for items, the tab URL displaces the item URL and item content is not preserved. This means that users switching between tabs on a page assembled from an item template, may lose the context of the item whose URL rendered the item template. In such a case, users are likely to see the default (placeholder) item in lieu of the item that originally invoked the 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. That is, with few if any tabs and sub-tabs.

Whenever you place an item placeholder on a Portal Template, it becomes a Portal Template for items. This is true even when the item placeholder is in a non-active state, such as Draft, Pending, Rejected, Hidden, Expired, and so on. Note, however, that when the item placeholder is not in an active state, its default content or the content that replaces it when an item is rendered does not display.


Note:

Items on the template itself are not selectable as default content for an item placeholder.

When items of the type URL with Display Options set to Item Displayed Directly In Page Area are rendered with Portal Templates for items, the item cannot point to a URL that requires HTTP authentication. Such items rendered as links have no such restriction.


To create a Portal Template for items:

  1. Log in to OracleAS Portal.

  2. Click the Build tab to bring it forward.

  3. From the Page Groups portlet Work In drop-down list, select a page group to own the template.

    By default, the Page Groups portlet is located on the Build tab of the Portal Builder page. If you plan to use the template across page groups, select the Shared Objects page group.

  4. In the Layout & Appearance section, click the Create link next to the Portal Templates heading.

  5. Enter a display name in the Display Name field.

    Use any character, including spaces.

    For information on object naming rules in OracleAS Portal, see Appendix D, "Object Naming Rules in OracleAS Portal".


    Note:

    In the OracleAS Portal user interface, an asterisk (*) indicates a field that requires a value.

  6. Optionally, enter a description of the template in the Description field.

  7. Check the Make available for use in this page group check box if you want users to be able to apply this template now.

    Consider leaving this check box blank until you have completed creating the template. Once this option is selected, the template displays on the relevant template pick lists. For example, if this check box is selected, once the template contains an item placeholder, it will be listed and available for selection on the Items tab of page properties.

    No matter whether this option is selected, an item template is always listed and available under the Portal Templates heading in the Page Groups portlet.

  8. Select a navigation banner to display at the top of the page from the Navigation Page For Banner drop-down list.

    Select <None> to forgo selecting a banner.

  9. Click Next.

  10. Optionally, go to the Page Style section, and select a style for the template from the Style drop-down list.

    Styles specify a page's colors and fonts. Click the Preview button and cycle through the Portlets, Items, Tabs, and Common radio buttons to preview the look and feel of a selected style. To learn more about styles, see Chapter 12, "Working with Colors and Fonts".


    Note:

    The setting Enable Pages To Use Different Style has no effect on Portal Templates for items. The item template is rendered dynamically, on-the-fly, and consequently, there is no opportunity for other page designers to navigate to it (as they could a static page) to specify a different style.

  11. Click Finish.

    The template opens in Edit mode.

    Clicking Next takes you to access control settings. These have to do with pages and items. For more information about securing Portal Templates for items, see Section 18.11, "Granting Privileges on Portal Templates".

  12. Build the template.

    This consists of designing a layout with regions and adding whatever images and other content you plan to include on the template. For more information on working with page regions, see Chapter 11, "Working with Layouts". For more information about adding different types of content, see Chapter 15, "Working with Items" and Chapter 16, "Working with Portlets".

  13. In at least one of the item regions, add an item placeholder:

    1. Click the Add Item icon over the region that will contain the item placeholder.

    2. From the Content Item Types drop-down list, select Item Placeholder.

      If the Item Placeholder item type does not appear on this list, click the link configure the list of available item types, and add Item Placeholder to the list of available item types. If you do not see this link, ask your page group administrator to add this item type to the page group's list of available item types. For information on making different item types available to a page group, see Section 6.2.2.3, "Making an Item Type Available to a Page Group".

    3. Click Next.

    4. Click the Choose Item icon to browse to a list of available content.

      Choose from all the available items that are uploaded to your portal. The only item you cannot choose is one that is already placed on the template.

Once a Portal Template contains an item placeholder, it becomes a Portal Template for items and appears on the item template pick list on the Items tab of page properties.

13.2.2.2 Applying Portal Templates for Items

Portal Templates for items can be selected at the page level and the item level. At the page level, the Portal Template is selected on the Items tab of page properties. At the item level, the Portal Template is selected on the Edit Item screen. For a template to be selectable on the Edit Item screen, page properties must specify that users can select a template other than that specified at the page level.

This section describes how to apply a Portal Template for items at the page level and at the item level. It contains the following subsections:

13.2.2.2.1 Applying a Portal Template for Items at the Page Level

To apply a Portal Template for items:

  1. Log in to OracleAS 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 the item template.

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

  4. In the Layout & Appearance section, under the Pages heading, click the link to the page on which to apply the item template.

    This opens the page in Edit mode.

  5. Click the Page: Properties link in the toolbar at the top of the page.

  6. On the resulting page, click the Items tab to bring it forward.

  7. Select the Use this portal template radio button, then select a template from the associated drop-down list.

    When a page group and the Shared Objects page group both have a template of the same name, the page group name is added to the template name in pick lists. For example: <template_name> (page_group_name). This assists in distinguishing between templates on pick lists.

  8. Optionally, select the Allow items on this page to use a different Portal Template check box.

    Selecting this option enables users to choose a different template when they edit an item on this page.

  9. Click OK to save the change and return to the page in Edit mode.

    Alternatively, click Apply to save the change but remain on the Items tab.

When users click a link to an item on this page, the item content will display within the context of the selected template.

When property inheritance rules (set at the page group level) are set to copy property settings from the parent page, all sub-pages of a page where you apply an item template also inherit the parent page's item template setting. Subsequent changes to the template setting cascade to sub-pages.

The option Allow items on this page to use a different Portal Template is exempted from this behavior. When changes to item template settings on the parent page cascade to sub-pages, any change to the Allow items on this page to use a different Portal Template setting do not also cascade.

13.2.2.2.2 Applying a Portal Template for Items at the Item Level

For users to be able to apply a Portal Template for items at the item level, the option Allow items on this page to use a different Portal Template must be selected on the page properties Items tab.

Apply a Portal Template for items at the item level when you want to use a template other than the one specified at the page level.


Note:

The option to apply a template at the item level is available only for items of one of the following types: Text, PL/SQL, URL, and File items of the type text/html or text/plain.

To apply a Portal Template for items at the item level:

  1. Log in to OracleAS 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 the item template.

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

  4. In the Layout & Appearance section, under the Pages heading, click the link to the page on which to apply the item template.

    This opens the page in Edit mode.

  5. Go to the page to which you have applied a Portal Template for items, and edit an item.

    For information on editing an item, see Chapter 15, "Working with Items".


    Note:

    The option to select a Portal Template for items on a specific item is available only when you edit an item and not when you add an item.

  6. Select Use this portal template, then choose a template from the drop-down list.

  7. Click OK.

13.2.2.3 Calling a Portal Template for Items at Runtime

Sometimes you may need to display an item within the context of a template that is different from the one defined in your portal's properties. An example of this is viewing an item in a printer-friendly format.

Many businesses offer a printer-friendly option for their published content. Users reading an item can click a link that takes them to the same item without display ads or other unrelated content. You can achieve this effect by specifying a printer-friendly template on the item URL, thus calling the template at runtime.

A call to override the default Portal Template for items in a path-based URL takes the following syntax:

http://<host>:<port>/portal/page/<dad>[/lang-<language>][/ver-<version>]/
<page_path>/<item_name>?_template=/<page group name>/<template name>

A call to override the default Portal Template for items in a durable URL takes the following syntax:

http://<host>:<port>/portal/page/<dad>[/lang-<language>][/ver-<version>]/
<item_guid>?_template=/<page group name>/<template name>


Note:

Before either call can work, the Printer Friendly template must already be created.

The template name to call is the Name specified when the template was created. This is in contrast to the template's Display Name.

You can create a Portal Template for items that includes a link to a printer-friendly version of the item using one of these URL formats in conjunction with two Item Placeholder items, each in its own region, two Portal Templates for items, and two HTML content layout templates.

When you place two Item Placeholders on the same template, they render the same item. Armed with this knowledge, you can create a Portal Template for items that includes a link to a printer-friendly version of the item—one that gives more real estate to the article and eliminates unnecessary additional content.

For example:

  • Create a Portal Template for items, named MainItem.

  • Create a second Portal Template for items, named PrinterFriendly. This is the template that will override the default item template currently selected in page or item properties.

  • On the MainItem template, create at least two regions: one for the display of item content, the other for the display of a link to the printer-friendly version of the item. Add an Item Placeholder to each region.

  • Create an HTML content layout template to render a link to the item (using the #item.url# substitution tag) and invoke the PrinterFriendly Portal Template for items (using the URL syntax demonstrated at the beginning of this section). For example:

    <a href="#item.url#?_template=/mypg/PrinterFriendly">
    <img src="/images/printer.gif" border="0"> Printer Friendly
    </a>
    
    

    This code displays a printer icon with the label Printer Friendly (Figure 13-7).

    Figure 13-7 Printer Icon and Label

    Printer friendly icon and label

    The icon and text are enclosed in an HREF tag that references the displayed item's URL (#item.url#) and the PrinterFriendly Portal Template for items (?_template=/mypg/PrinterFriendly).

    This reference works for all items because the #item.url# substitution tag renders the URL of the current item, whatever that may be.

  • Apply the MainItem template to the page that contains the links to your articles. To apply the template, go to the Items tab of page properties.

When users request an item, the item's content is displayed within the context of the MainItem template. The MainItem template contains the Printer Friendly link to the requested item. When users click the Printer Friendly link, the same item is rendered, this time within the context of the PrinterFriendly template.

In this example, the PrinterFriendly template is called at runtime.

For additional information on the formation of URLs in OracleAS Portal, see Appendix C, "Formation of URLs in OracleAS Portal". For additional information on substitution tags, see Appendix E, "Substitution Tags for HTML and Unstructured UI Templates". For information on creating and applying HTML content layout templates, see Section 13.3.2, "Using HTML to Define the Layout and Appearance of Region Content".

13.2.2.4 Editing Portal Templates for Items

To edit a Portal Template for items:

  1. Log in to OracleAS 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 Portal Template for items.

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

  4. In the Layout & Appearance section, under the Portal Templates heading, click the link to the template to be edited.

    This opens the template in Edit mode.

Make your changes to the template. Once any cached versions of the template expire, all items that use the template will display the edited version. You can accelerate this process by going to the page's Access tab and clicking the Clear Cache link. For more information about templates and caching, see Chapter 22, "Improving Page Performance".


Note:

When URL items with Display Options set to Item Displayed Directly In Page Area are to be rendered on Portal Templates for items, they cannot point to a URL that requires HTTP authentication. Such items rendered as links have no such restriction.

13.2.2.5 Detaching a Portal Template for Items

If you do not want items to display within the context of a Portal Template for items, you can detach the template from the page. Once the template is detached, the content that displays when users click item links will no longer display in the context of the template. In contrast to when you detach a Portal Template for pages, when you de-select a Portal Template for items no template objects are left behind. Item content displays in an otherwise blank browser window.

To detach a Portal Template for items:

  1. Log in to OracleAS 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 from which to detach the Portal Template for items.

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

  4. In the Layout & Appearance section, under the Pages heading, click the link to the page from which to detach the template.

    This opens the page in Edit mode.

  5. Click the Page: Properties link in the toolbar at the top of the page.

  6. On the resulting page, click the Items tab to bring it forward.

  7. Select the Do not use a portal template radio button.

  8. Click OK.

Once the cache that is storing the item content and the template expires, when users click a link to an item on this page, the item content will no longer display within the context of the detached template. You can accelerate this process by going to the page's Access tab and clicking the Clear Cache link. For more information about templates and caching, see Chapter 22, "Improving Page Performance".

13.2.3 Copying a Portal Template

Copying a Portal Template provides a quick way to create a new Portal Template based on an existing one with a similar layout and content. The copy is created in the same page group as the original.


Note:

Content and any portlet personalizations are not copied for the Portal Templates that are generated automatically for categories and perspectives.

To copy a Portal Template:

  1. Log in to OracleAS Portal.

  2. Click the Navigator link at the top of the page.

  3. Navigate to the root level of the Page Groups tab (Path: Page Groups).

  4. Click the name of the page group that owns the template to be copied.

  5. On the Page Group Objects page, click the Portal Templates node.

  6. Click the Copy link next to the relevant template.

  7. On the Copy Portal Template page, edit the template Display Name.

    Use up to 256 characters of any kind. The Display Name identifies the Portal Template to other users. It is used in the Page Groups portlet, the Portal Navigator, and on template pick lists in the OracleAS Portal user interface. The default value of the Display Name field is taken from the Display Name of the source template, with the words Copy of added.

  8. Select or clear the Copy Access Control check box:

    • Select to copy access control from the source template.

    • Clear to forego copying the source template's access control settings.

  9. Select or clear the Copy Content check box:


    Note:

    This option is available for all Portal Templates except for those generated automatically for categories and perspectives.

    • Select to copy the content of the source Portal Template. This includes the source template's items and portlets.

    • Clear to prevent the copy of the source template's content. Only the source's properties, including its style, and its region layout are copied.

  10. Select or clear the Copy Portlet Personalizations check box:


    Note:

    This option is available for all Portal Templates except for those generated automatically for categories and perspectives.

    • Select to copy any personalizations that were made to the portlets on the source Portal Template.

    • Clear to reset the portlets on the copy to their default values.

  11. Click OK to complete the copy.

13.2.4 Editing Portal Template Properties

Edit template properties to revise basic template attribute values, such as the template's Name, Display Name, and caching rules.

To edit a Portal Template:

  1. Log in to OracleAS Portal.

  2. Click the Build tab to bring it forward.

  3. From the Page Groups portlet's Work In drop-down list, select the page group that owns the Portal Template to be edited.

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

  4. Under Portal Templates in the Layout & Appearance section, click the name of the template to be edited.

    This opens the template in Edit mode.


    Note:

    If the template is not included in those listed in the Page Groups portlet, click the More … link that displays at the end of the list.

  5. Click the Template: Properties link in the toolbar at the top of the page.

    This opens the Template Properties page, displaying the Main tab. The attributes available on the Main tab vary a little from the attributes available when you first create the page. Notably, the Main tab includes a Name attribute.

    The Name attribute differs from the Display Name attribute both in the way OracleAS Portal uses it and in the rules that govern which characters can be used in its formation. OracleAS Portal uses the Name in the formation of path-based URLs.


    Note:

    For information on the formation of URLs in OracleAS Portal, see Appendix C, "Formation of URLs in OracleAS Portal".

    The default value in the Name field is taken from the Display Name provided when the template was created. The value is truncated to 60 characters and any characters that are invalid in this field are removed. Invalid characters include:

    & # % \ / : * ? < > | , "

    For example, if the Display Name is R&D Temp, the Name is RD Temp.

    The Name is case sensitive. It must be unique within its page group. Use up to 60 characters of any kind, except those specified in the preceding paragraphs.

  6. Move from tab to tab, and edit properties as desired.

    For detailed information about template caching options, see Chapter 22, "Improving Page Performance".


    Note:

    You will find the user interface for applying an HTML page skin template to the Portal Template on the Optional tab.

  7. Click OK when you are done.

13.3 Working with HTML Templates

You can use your own HTML to create a template for a portal page and to define the format, style, and colors to be used in portlet and item regions. Create templates for pages with HTML page skins. Create templates for regions with HTML content layouts.

This section provides information on working with HTML templates in OracleAS Portal. It includes the following subsections:

13.3.1 Using HTML to Define a Page Border

Using a simple wizard, you can either enter or paste a copy of your own developed HTML to define the layout, look, and feel of a portal page. You can enrich the HTML by including substitution tags to stand in for standard elements that are available through the OracleAS Portal user interface. You can also add any other Web standard mark up, such as JavaScript, to increase the dynamic capability of the template. HTML page skins, as these types of templates are known, affect the appearance of the area surrounding page content.


Note:

When a page uses an HTML page skin template, the page background color is taken from the template and any background color specified in a defined style is ignored.

An exception to this is when the page skin uses a class generated by an OracleAS Portal style. For example, you can place an OracleAS Portal style element class in the <body> HTML tag: <BODY style="margin:0px" class="Bodyid2siteid0">. Should you change the style declaratively, through the OracleAS Portal user interface, the change is reflected as well in the template that references the style class.

This enables you to change the Background Color of all pages that use the page skin through the declarative style. (For more information on OracleAS Portal style element classes, see Chapter 12, "Using Portal Style Element Classes in HTML Templates and CSSs".)


This section provides information about working with HTML to create page skins. It includes the following subsections:

13.3.1.1 Creating an HTML Page Skin

OracleAS Portal provides a simple wizard for creating an HTML template for a page. Enter HTML and any other tags that are valid within HTML, such as JavaScript, Oracle tags, HTML substitution tags, and the like.

For information on HTML page skin substitution tags, see Appendix E, "Substitution Tags for HTML and Unstructured UI Templates".

To create an HTML page skin template:

  1. Log in to OracleAS Portal.

  2. Click the Build tab to bring it forward.

  3. From the Page Groups portlet Work In drop-down list, select a page group to own the HTML page skin.

    By default, the Page Groups portlet is located on the Build tab of the Portal Builder page. If you plan to use the template across page groups, select the Shared Objects page group.

  4. In the Layout & Appearance section, click the Create link next to the HTML Templates heading.

  5. On the resulting page, select HTML Page Skin from the Template Type drop-down list.

  6. In the Template Name field, enter a name for the HTML page skin.

    The Template Name must be unique within its page group. Use up to 50 characters. Multibyte characters are allowed. Use any character except the following:

    , & # % \ / : * ? < > | "

    Template Name is not case-sensitive. The portal stores it in uppercase.


    Note:

    For additional information on the rules governing object naming in OracleAS Portal, see Appendix D, "Object Naming Rules in OracleAS Portal".

  7. In the Template Definition field, enter HTML to define the template's appearance.

    Use a combination of HTML, JavaScript, Oracle tags, and any other type of mark-up available for use in Web pages. To render OracleAS Portal user interface elements within the template, use HTML page skin substitution tags. To view a list of available tags, click the link tags as substitution variables on the Create HTML Template page. For more information, see Appendix E, "Substitution Tags for HTML and Unstructured UI Templates".

  8. Click Create.

    The HTML page skin is created. A link to it appears at the top of the page. Click this link to make additional changes. For information on how to make changes to the template after you leave this screen, see Section 13.3.1.3, "Editing an HTML Page Skin".

  9. Click OK.

13.3.1.2 Applying an HTML Page Skin

You can apply an HTML page skin to a navigation page, a standard page, custom pages that are based on the standard page type, a Portal Template for pages, or a Portal Template for items. Use HTML page skins to wrap an HTML table around page content and provide your own mark-up around the border of the page.

To apply an HTML page skin:

  1. Log in to OracleAS 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 to which to apply the template.

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

  4. In the Layout & Appearance section, under the Pages heading, click the link to the page to which to apply the template.

    This opens the page in Edit mode.

  5. Click the Page: Properties link in the toolbar at the top of the page.

  6. On the resulting page, click the Template tab to bring it forward.

  7. Select the Use HTML Page Skin radio button.

  8. Select a template from the Use HTML Page Skin drop-down list.

    When a page group and the Shared Objects page group both have a template of the same name, the page group name is added to the template name in pick lists. For example: <template_name> (page_group_name). This assists in distinguishing between templates on pick lists.

  9. Click OK to save your changes and exit page properties.

    The page renders with the HTML page skin.

    Click Apply, rather than OK, if you want to save your changes but remain on the Template tab. Click the Preview button on the Template tab to preview how the selected HTML page skin will display.

13.3.1.3 Editing an HTML Page Skin

As you fine-tune your HTML page skin template, OracleAS Portal provides a quick, convenient way to access template content for editing.

To edit an HTML page skin template:

  1. Log in to OracleAS 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 HTML page skin to be edited.

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

  4. In the Layout & Appearance section, under the HTML Templates heading, click the link to the page skin to be edited.

    This opens the template wizard with the selected template's content displayed.

  5. Edit the template.

  6. Click OK to save your changes and exit the wizard.

    Click Apply to save your changes and remain in the wizard. Click the Preview button to preview how the template will display.

13.3.1.4 Detaching an HTML Page Skin from a Page

Detaching an HTML page skin from a page results in the removal of the objects, formatting, and layout that were provided by the page skin template. Once the skin is detached, page content renders according to the page's default settings.

To detach an HTML page skin from a page:

  1. Log in to OracleAS 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 from which to detach the template.

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

  4. In the Layout & Appearance section, under the Pages heading, click the link to the page from which to detach the template.

    This opens the page in Edit mode.

  5. Click the Page: Properties link in the toolbar at the top of the page.

  6. Click the Template tab to bring it forward.

  7. Select the Do not use a template radio button.

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

    All formatting and content provided by the template is removed. The page renders with its default display settings.

13.3.2 Using HTML to Define the Layout and Appearance of Region Content

Use HTML content layout templates to control the way items, portlet borders, and their associated attributes display within a particular region. This section describes how to create, apply, and detach from an HTML content layout. It includes the following subsections:

13.3.2.1 Creating an HTML Content Layout

Use HTML content layout templates to define the structure, colors, and fonts of region content. Apply HTML content layout templates to portlet and item regions. OracleAS Portal provides a simple wizard for creating HTML content layout templates, which you can use to enter a combination of HTML, Oracle tags, HTML content layout substitution tags, and any other tags and scripting that is valid in HTML.

To create an HTML content layout template:

  1. Log in to OracleAS Portal.

  2. Click the Build tab to bring it forward.

  3. From the Page Groups portlet Work In drop-down list, select a page group to own the HTML content layout template.

    By default, the Page Groups portlet is located on the Build tab of the Portal Builder page. To enable sharing the template across page groups, select the Shared Objects page group.

  4. In the Layout & Appearance section, click the Create button next to the HTML Templates heading.

  5. On the resulting page, select HTML Content Layout from the Template Type drop-down list.

  6. In the Template Name field, enter a name for the HTML content layout.

    The Template Name must be unique within its page group. Use up to 50 characters. Multibyte characters are allowed. Use any character except the following:

    , & # % \ / : * ? < > | "

    Although Template Name is not case-sensitive, the portal stores it in uppercase.


    Note:

    For additional information on the rules governing object naming in OracleAS Portal, see Appendix D, "Object Naming Rules in OracleAS Portal".

  7. In the Template Definition field, enter HTML to define the template's appearance.

    Use a combination of HTML, Oracle tags, HTML content layout substitution tags, and any other tags and scripting that is valid in HTML. To view a list of available HTML content layout substitution tags, click the link tags as substitution variables on the Create HTML Template page. For more information, see Appendix E, "Substitution Tags for HTML and Unstructured UI Templates".

  8. Click Create.

    The HTML content layout is created. A link to it appears at the top of the page. Click this link to make additional changes. For information on how to make changes to the template after you leave this screen, see Section 13.3.2.3, "Editing an HTML Content Layout".

  9. Click OK to exit the wizard once you edit the template; or click Cancel to exit the wizard without editing the template.

13.3.2.2 Applying an HTML Content Layout

You can apply an HTML content layout to any editable item or portlet region. Before you can apply a content layout, the region type must be defined. You cannot apply an HTML content layout to an undefined region.

On pages that are based on a template, some regions are not editable. However, if the template includes a tab, users with enough privilege to edit a page can add another tab with an editable region. In such a case, the user could apply an HTML content layout template to the editable region on the new tab.

To apply an HTML content layout template:

  1. Log in to OracleAS 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 to which to apply the HTML content layout template.

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

    This opens the page in Edit mode.

  5. Click the Edit Region icon on the region where you will apply the template (Figure 13-8).

    Figure 13-8 The Edit Region Icon

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

  7. Select Use HTML Content Layout.

    The option to use a content layout is selectable on the Attributes tab only when at least one content layout is defined in the page group or the Shared Objects page group.

  8. Select a content layout from the HTML Content Layout drop-down list.

    When a page group and the Shared Objects page group both have a template of the same name, the page group name is added to the template name in pick lists. For example: <template_name> (page_group_name). This assists in distinguishing between templates on pick lists.

  9. Click OK.

    Region content is formatted as specified in the content layout template.

13.3.2.3 Editing an HTML Content Layout

As you fine-tune your HTML content layout template, OracleAS Portal provides a quick, convenient way to access template content for editing.

To edit an HTML content layout template:

  1. Log in to OracleAS 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 HTML content layout.

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

  4. In the Layout & Appearance section, under the HTML Templates heading, click the link to the template to be edited.

  5. Edit the template.

  6. Click Apply to save your changes without exiting, or click OK to save your changes and exit the wizard.

13.3.2.4 Detaching an HTML Content Layout Template from a Region

Detaching an HTML content layout from a region results in the removal of the objects, formatting, colors, fonts, and layout that were provided by the content layout template. Items or portlets continue to display in the affected region along with any default attributes selected for the region's attribute settings.

To detach an HTML content layout template from a region:

  1. Log in to OracleAS 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 from which to detach the template.

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

  4. In the Layout & Appearance section, under the Pages heading, click the link to the page from which to detach the template.

    This opens the page in Edit mode.

  5. Click the Edit Region icon over the region that uses the HTML content layout template to be detached (Figure 13-9).

    Figure 13-9 The Edit Region Icon

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

  7. Change the selection from Use HTML Content Layout to Select Attributes.

  8. Click OK.

13.3.3 Using HTML to Create Templates for Database Portlets

The HTML templates you create for database portlets are also known as Unstructured User Interface templates, or UI templates. UI templates control the look and feel of the Web page on which an OracleAS Portal database portlet is rendered when the portlet displays in full-page mode. Database portlets are those portlets built under the ownership of Portal Database Providers (as opposed to Web providers).

Unstructured User Interface templates are based on HTML code that you supply. You can enter the code directly into the template wizard, or create it using a third-party tool, then cut and paste that HTML into the wizard. Additionally, you can enter substitutions tags to stand in for such information as the current user's name, the OracleAS Portal images directory, the portal schema owner, and the like.

You can also use <oracle></oracle> tags to include SQL statements or PL/SQL blocks in your UI template. Additionally, you can include HEAD elements, such as custom JavaScript, cascading style sheet references, and META tags.

By applying a UI template to a database portlet, you can automatically specify a portlet title, a title background, links to home and help pages, and background colors and images. UI templates are good for standardizing groups of database portlets in a provider. For example, you can design a UI template for a provider that includes the company logo in the heading, the company name in the title, and an industry-related background image. By seeing that every database portlet in the provider uses the same UI template, you can ensure that such portlets display in a standard, controlled way to all users.

This section describes how to work with UI templates. It includes the following subsections:

13.3.3.1 Creating an Unstructured User Interface Template

To create an unstructured UI template:

  1. Log in to OracleAS Portal.

  2. Click the Navigator link at the top of the page.

  3. Click the Providers tab to bring it forward.

  4. Click the Locally Built Providers link.

  5. Click the Shared Components link.

  6. Click the User Interface Templates link.

  7. Next to Create New, click the User Interface Template link.

  8. Click the Unstructured UI Template link.

  9. In the Template Name field, enter a name for the template.

    The name must be unique within the objects in the Shared Components provider. Use up to 50 bytes. This equals 60 ASCII bytes, but fewer multibyte characters. Use any character except the following:

    , & # % \ / : * ? < > | "

  10. In the Template Definition field, enter the HTML or other Web-standard code for your template.

    Click the tags as substitution variables link for a list of substitution tags available for use in your template. See Appendix E, "Substitution Tags for HTML and Unstructured UI Templates" for a list and description of these database portlet substitution tags.

    You can use <oracle></oracle> tags in your HTML to include SQL statements or PL/SQL blocks in your template.

  11. Click Preview to see how the template definition displays.

  12. Click Create when you are finished to save your changes and exit the wizard.

13.3.3.2 Applying an Unstructured User Interface Template

Data components always display within the context of a UI template when viewed in full-page mode. They use either a default template provided by the portal or a template you select. You cannot detach a UI template from a data component, but you can select a template other than the default. Additionally, should you want a data component to display on a blank page when displayed in full-page mode, you can create a simple template that does not include any colors, objects, or formatting, then select that in lieu of a populated UI template.

You can apply a UI template when you create a data component or when you edit one. This section describes how to apply a UI template when you edit a data component.

To apply a UI template:

  1. Log in to OracleAS Portal.

  2. Click the Navigator link at the top of the page.

  3. Click the Providers tab to bring it forward.

  4. Click the Locally Built Providers link.

  5. Under the Name column, click the link to a database provider that contains the data component to which to apply a template.

  6. On the resulting page, click the Edit link next to the data component (portlet) to which to apply a template.

  7. Click the final tab in the series, Data Component and Personalization Form Text (Figure 13-10).

    Figure 13-10 Data Component and Personalization Form Text Tab Icon

    Data Component and Personalization Text tab icon
  8. From the Template drop-down list, select the UI template to apply to the data component.

  9. Click OK to save your change and go to the Develop Data Component screen.

    You can perform additional management tasks on the data component on this screen.

  10. Click Close to return to the Portal Navigator.

13.3.3.3 Editing an Unstructured User Interface Template

To edit an unstructured UI template:

  1. Log in to OracleAS Portal.

  2. Click the Navigator link at the top of the page.

  3. Click the Providers tab to bring it forward.

  4. Click the Locally Built Providers link.

  5. Click the Shared Components link.

  6. Click the User Interface Templates link.

  7. Click the Edit link next to the UI template to be edited.

  8. Make your changes to the template.

    If you change the name of the UI template, keep in mind that the name must be unique among the object names within the Shared Components provider. Use up to 50 bytes. This equals 60 ASCII bytes, but fewer multibyte characters. Use any character except the following:

    , & # % \ / : * ? < > | "

  9. Click OK to save your changes.

13.3.3.4 Deleting an Unstructured User Interface Template

When you delete an unstructured UI template, the default template is automatically applied to any components that used the deleted template. The default unstructured UI template is the one at the top of the pick list of unstructured UI templates.

To delete an unstructured UI template:

  1. Log in to OracleAS Portal.

  2. Click the Navigator link at the top of the page.

  3. Click the Providers tab to bring it forward.

  4. Click the Locally Built Providers link.

  5. Click the Shared Components link.

  6. Click the User Interface Templates link.

  7. Click the Delete link next to the UI template to be deleted.

  8. On the resulting page, click Yes to confirm the deletion.

13.3.4 Copying HTML Templates

A quick way to create a new HTML template is to copy an existing one. The procedures for copying HTML templates differs between unstructured user interface templates and the other types of HTML templates. This section describes both procedures. It includes the following subsections:

13.3.4.1 Copying an HTML Page Skin or Content Layout Template

To copy an HTML page skin or content layout template:

  1. Log in to OracleAS 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 HTML template to be copied.

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

  4. In the Layout & Appearance section, click the Browse link next to HTML Templates.

  5. On the resulting Portal Navigator page, click the Copy link next to the HTML template to be copied.

  6. In the New Template Name field, provide a new name for the template.

    The New Template Name must be unique within its page group. Use up to 50 characters. Multibyte characters are allowed. Use any character except the following:

    , & # % \ / : * ? < > | "

    Although Template Name is not case-sensitive, the portal stores it in uppercase.


    Note:

    For additional information on the rules governing object naming in OracleAS Portal, see Appendix D, "Object Naming Rules in OracleAS Portal".

  7. Click OK to save your change and exit the Copy Template page.

13.3.4.2 Copying an Unstructured User Interface Template

To copy an unstructured UI template:

  1. Log in to OracleAS Portal.

  2. Click the Navigator link at the top of the page.

  3. Click the Providers tab to bring it forward.

  4. Click the Locally Built Providers link.

  5. Click the Shared Components link.

  6. Click the User Interface Templates link.

  7. Click the Copy link next to the UI template to be copied.

  8. Edit the value in the New Template Name field.

  9. Click OK to save your change.

13.4 Deleting Templates from OracleAS Portal

When you delete a template, the results vary depending on the type of template you delete. This section discuss these different results and list the steps to take to delete different kinds of templates. It includes the following subsections:


Note:

To delete a template, you must have at least one of the privileges outlined in the Intended Audience section of this chapter, or the page privilege Manage on the template.

13.4.1 Deleting a Portal Template

When you delete a Portal Template for pages, any pages that were based on the template are automatically detached from the template. The layout, look and feel, and objects provided by the template remain on the pages that used the template. But they now belong to those pages.

For example, if the deleted template provided two item regions and a company logo, once the template is deleted all pages that were based on that template continue to display two item regions and a company logo. The layout and the logo are now owned by the page to which the deleted template was applied.

If your goal is to detach a page from its template, deleting a template is not the best way to do this. Rather, simply detach the page from its template. For more information on detaching a page from its template, see Section 13.2.1.4, "Detaching a Portal Template from a Page" and Section 13.3.1.4, "Detaching an HTML Page Skin from a Page".

When you delete a Portal Template for items, none of the template's objects nor the page layout or look and feel are retained. When users click an item link that used to render the item within a template, just the item content displays. Any images, additional regions, or look and feel that were provided by the template no longer display.

To delete a Portal Template:

  1. Log in to OracleAS Portal.

  2. Click the Build tab to bring it forward.

  3. From the Page Groups portlet Work In drop-down list, choose the page group that owns the Portal Template to be deleted.

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

  4. In the Layout & Appearance section, click the Browse link next to the Portal Templates heading.

  5. On the resulting Portal Navigator page, click the Delete link next to the relevant Portal Template.


    Tip:

    If the template is used by more than one page group, it will be under the Shared Objects page group.

  6. On the confirmation page, click Yes.

13.4.2 Deleting an HTML Template

When you delete an HTML content layout, any formatting or layout that was provided by the template is removed. When you delete an HTML page skin, affected pages display without the surrounding border that was provided by the template. Nothing of an HTML template remains on the pages or regions that used it.

To delete an HTML template:

  1. Log in to OracleAS Portal.

  2. Click the Build tab to bring it forward.

  3. From the Page Groups portlet's Work In drop-down list, choose the page group that owns the HTML template to be deleted.

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

  4. In the Layout & Appearance section, click the Browse link next to the HTML Templates heading.

  5. On the resulting Portal Navigator page, click the Delete link next to the relevant HTML template.


    Tip:

    If the template is used by more than one page group, it will be under the Shared Objects page group.

  6. On the confirmation page, click Yes.

13.5 Troubleshooting Templates

The Browse Users icon does not display on the Access tab

The portal administrator may have run the script serlacl.sql to enforce role-based security. Role-based security limits privilege grantees to groups; individual users cannot be granted privileges. The script does not affect privileges granted to users before it was run, only after. Once this script is run, the Browse Users icon does not display next to the Grantee field on Access tabs. Additionally, the Privileges tab does not display on the Edit Portal User Profile page.

For more information, see Oracle Application Server Portal Configuration Guide.

I created a page and did not apply a template, yet a template is attached when I click Finish.

It's likely that a default template has been selected at the page group level. You can find this control on the Configure tab of page group properties, under Page Defaults. If Use Default Properties When Creating Page is selected, and a default template is selected under Default Template, that template is automatically applied to every new page, unless it is explicitly de-selected when you create or edit the page.

One way around this is to take every step of the page creation wizard, rather than clicking Finish once you've entered the essentials. When you get to the template selection step, de-select the default template by choosing Do not use a template.

Another way around this, once the page is created, is to edit page properties, and select Do not use a template on the Template tab of page properties.

Why can't I add content to a region?

You may not have sufficient privileges to add content. You must have at least the page (or tab) privilege Manage Content or Manage Items with Approval on the page or on the tab that contains the region.

If the page is based on a Portal Template, and the template region is locked, no one can add content to the region, unless they do so through a WebDAV client. If the default item region in a template is set not to allow users to add content, this setting is ignored by WebDAV when adding content to pages that are based on the template.

To unlock a region:

  1. Open the page or Portal Template in Edit mode, and edit the region.

  2. Select Enable Users To Included Content In This Region.

  3. Click OK to save your changes and return to the page or Portal Template.

My template is not displaying on the template pick lists in my page group.

For a template to be available for use, the option Make available for use in this page group must be selected. You will find this option on the Main tab of template properties.

A template is not listed in the Page Groups portlet or the Portal Navigator.

For a template to display in either of these locations, you must, at minimum, have the View privilege on the template. Ask the template owner or the page group or portal administrator for access privileges on the template.

I cannot change the style of my personal view of the page.

If the page is based on a template, it could be that the template designer or did not select Enable Pages To Use Different Style. When this option is not selected for the template, the Style tab does not display when users personalize the page.

It could also be that the page group property, Allow Privileged Users To Personalize Page Style is not selected. For more information, see Section 4.3.2, "Controlling Who Can Apply a Different Style to a Page".

I cannot change the access settings for my page.

If the page is based on a template, the template designer my have prevented users from setting their own page access by clearing the option Enable Pages to Have Different Access. Clearing this option prevents users from choosing different access control settings when they create or edit pages that are based on a template. Such pages always use the template access control settings.

This option is available on the Access tab of template properties.

Some of the objects on my template are not displaying.

It could be that the template is being used on a translated page and that objects on that template have not been translated. When a template that was created in the portal's default language is applied to a translated page, only the template objects that have also been translated display on the template.

Add translations for all template content. For more information, see Chapter 20, "Translating Portal Content".

If the template is a Portal Template for items, it could be that the item placeholder is in a non-active state, such as Draft, Pending, Rejected, Hidden, Expired, and so on. The item placeholder must be active for it, or the content that replaces it, can be displayed on the rendered page.

I created an HTML page skin; now I can't find it.

If you're sure you have the right page group selected in the Page Groups portlet, click the Browse link next to the HTML Templates heading under Layout & Appearances. This takes you to the Portal Navigator, specifically to the HTML Templates node under the page group selected in the Page Groups portlet Work In drop-down list. Scroll through the listed templates.

If you still cannot find your template, enter the template name in the Portal Navigator Find field and click Go. The HTML template you are looking for should be listed in the search results.

I uploaded a draft item and now cannot see it on my page in Pending Items Preview.

When a page or template is cached at the system level, and Approvals and Notifications are enabled for the page group, unpublished items, such as Draft, Pending, Rejected, and Deleted Rejected items, do not display as expected. For this reason, do not cache approval-enabled pages or templates at the system level. For more information, see Chapter 22, "Improving Page Performance".

For information on which items are accessible in what states, see Section 18.9.3, "Item URL Security".

I published a page as a portlet, placed it on a page, and displayed selected regions. Now it is displaying blank.

This involves the source page and a Portal Template. When you edit or personalize the Page portlet to display selected regions, and a change is made to the portlet's source page regarding the template—either a template is added or detached or a template region equivalent to a region selected for display on the portlet is deleted—the portlet cannot resolve such changes with its Display Selected Regions setting. The result is that the portlet displays without content—or blank. To resolve this situation, re-edit or personalize the portlet's region display settings.

To personalize a portlet, in page View mode click the Personalize link in the portlet header. For more information on restricting the display of regions in a page portlet, see Section 9.5.3, "Selecting Page Portlet Regions for Display".

My style specifies a page background color, but no color displays.

When a page uses an HTML page skin template, the page background color is taken from the template and any background color specified in a defined style is ignored.

An exception to this is when the page skin uses a class generated by an OracleAS Portal style. For example, you can place an OracleAS Portal style element class in the <body> HTML tag: <BODY style="margin:0px" class="Bodyid2siteid0">. Should you change the style declaratively, through the OracleAS Portal user interface, the change is reflected as well in the template that references the style class.

This enables you to change the Background Color of all pages that use the page skin through the declarative style. (For more information on OracleAS Portal style element classes, see Chapter 12, "Using Portal Style Element Classes in HTML Templates and CSSs".)

I cannot delete a tab/region from my Portal Template.

You can delete tabs and regions from Portal Templates only if you have sufficient privileges to delete tab content on the pages that are based on the template.