Applying Template Types

This section provides an overview of template types and discusses how to:

  • Use page-based static templates.

  • Use frame-based static templates.

  • Use frame-based dynamic templates.

  • Use iframe-based dynamic templates.

Each portal template is either page-based, frame-based, or inline frame-based (iframe-based), and each template is either static or dynamic. Template types come in five possible combinations:

  • Page-based static templates.

    These are content references with a usage type of HTML template and a storage type of Local (in HTML Catalog).

  • Page-based dynamic templates.

    These are content references with a usage type of HTML template and a storage type of Remote by URL.

  • Frame-based static templates.

    These are content references with a usage type of Frame template and a storage type of Local (in HTML Catalog).

  • Frame-based dynamic templates.

    These are content references with a usage type of Frame template and a storage type of Remote by URL.

  • iFrame-based dynamic templates.

    These are content references with a usage type of Inline frame template and a storage type of Remote by URL.

A page-based template uses HTML tables to generate a page. Content is placed in each table cell that is defined by the template. The portal servlet uses the page-assembly process to retrieve documents for each cell. The assembled page is then sent as a single unit to the user’s browser.

A frame-based template uses frames, rather than HTML tables, to divide the page into parts. The portal servlet constructs the appropriate URL for each frame (<src> tag in the frameset) and sends the entire frameset to the browser. The browser then retrieves the content for each frame.

An iframe-based template uses HTML with embedded inline frames to divide the page into parts. The portal servlet constructs the appropriate URL for each section of the page and sends the HTML to the browser. The browser then retrieves the content for each section and each inline frame.

A static template is based on HTML code that is entered into the HTML area of a template content reference (a content reference that exists in the Portal Objects\Templates folder of the portal registry). Bind variables cannot be used within the HTML area. The HTML includes any HTML that is required for the template itself, plus tags that specify the URLs for template pagelets. You can view and update the contents of a static template on the portal administration pages.

A dynamic template is retrieved from the web in real time, as part of the page-assembly process, rather than stored in the database with the content reference. A dynamic template can use bind variables. You cannot view the HTML contents of the dynamic template directly on the portal administration pages. Instead, the portal administration pages enable you to identify the URL that points to the resource that provides the template content. If the dynamic template is implemented by an iScript, you can use PeopleSoft Application Designer to navigate to the record and field where the iScript exists. The content provided by the URL is the HTML that is used for the dynamic template at runtime.

See Managing Portal Objects.

This static template example combines a universal navigation header with target content. It is based on HTML tables, not frames.

<html>
<head>
</head>
<body>
<table>
<tr><td>
<Pagelet Name="UniversalNavigation">
    <SOURCE Node="LOCAL_NODE" href="s/WEBLIB_PORTAL.PORTAL_HEADER.FieldFormula.
			IScript_UniHeader" />
</Pagelet>
</td></tr>
<tr><td>
<Target Name="TargetContent"/>
</td></tr>
</table>
</body>
</html>

This template is composed of HTML for three items:

  • The template itself.

    Some HTML is required for the overall template. The code for this template is represented in the preceding example by all the nonemphasized text. This HTML code remains on the assembled page that is sent to the user’s browser after the page-assembly process.

  • A template tag for the universal navigation header pagelet.

    This is the first block of HTML code that is emphasized in the preceding example. At runtime, the portal servlet replaces the Pagelet tag with the navigation header in the template for the final assembled page.

  • A template tag for target content.

    At runtime, the portal servlet replaces the Target tag—the second block of emphasized HTML code in the previous example—with whatever content the user requested by clicking a link or button.

Image: Content reference definition for a frame-based static template

The following screenshot is an example of content reference definition for a frame-based static template.

Content reference for a frame-based static template

The Content Ref Administration page shows how the HTML exists within the context of the whole content reference. Note that the usage type is set to Frame template. In the previous example of a page-based template, which uses HTML tables, the usage type would have been set to HTML template.

All dynamic frame-based templates are retrieved from a URL rather than from an HTML document. Most commonly, the URL for dynamic templates is an iScript URL. As with static templates, the template content reference must be defined as a template on the portal administration pages. However, instead of including specific HTML content, the dynamic template references an iScript. The iScript is associated with a specified field in a specified record.

Image: Defining a frame-based dynamic template

The following screenshot illustrates a frame-based dynamic template named PT_85X_FRAMES_TEMPLATE in the Portal Objects, Templates folder:

Defining a frame-based dynamic template on the portal administration pages

The content reference storage type is set to Remote by URL. This setting is required for dynamic templates. Additionally, no HTML area displays the associated HTML code for the template, as you would expect with a static template. Instead, when the URL type for this example is set to PeopleSoft Script, an iScript parameters area appears on the page, in which you can define the record name, field name, PeopleCode event name, and PeopleCode function name that specify the iScript to use for the template.

Image: Opening the WEBLIB_PT_NAV record associated with a dynamic template

In this example, an iScript that dynamically generates the template is located in the WEBLIB_PT_NAV record in the ISCRIPT1 field, as shown in PeopleSoft Application Designer in this example:

The following screenshot focuses on a iScript that dynamically generates the template.

WEBLIB_PT_NAV record

Additionally, the iScript function is associated with the FieldFormula PeopleCode event. The PeopleCode function name is IScript_PT_Frames_Template.

You can select the PeopleCode Display view to see which fields have PeopleCode programs defined for which PeopleCode events. By convention, function libraries have PeopleCode defined for the FieldFormula event.

Image: Selecting the PeopleCode Display view

The following screenshot illustrates which fields have PeopleCode programs defined for which PeopleCode events.

Opening the record and field associated with a dynamic template

Once you open the appropriate record and field in PeopleSoft Application Designer, you can view the FieldFormula PeopleCode. The iScript is referenced by the PeopleCode function name in the template’s definition. An easy way to find the exact reference is to copy the PeopleCode function name from the template definition and paste it into the Find dialog box of the PeopleCode editor once you open the corresponding record and field.

Image: The iScript upon which the dynamic template is based

The following screenshot illustrates the code of the iScript that is referenced by the portal template.

The iScript upon which the dynamic template is based

The following code calls an HTML definition called PT_DEFAULT_FRAME_TEMPLATE from the HTML catalog and passes the definition bind variables:

%Response.Write(GetHTMLText(HTML.PT_DEFAULT_FRAME_TEMPLATE, &frameRows, &encryptedUserId, &params3, &headerFrameTitle, 
     &navFrameTitle, &contentFrameTitle, &relatedContentFrameTitle, &charSet, &ptCommonJS, &ptUtilJS, &ptEventJS, &ptRCMenuJS, 
     &ptRCServiceJS, &ptRCJS, &saveWarnJS));

Image: Using bind variables with a dynamic template

The resulting HTML code forms the basis for the dynamic portal template at runtime. You can open the HTML definition PT_DEFAULT_FRAME_TEMPLATE in PeopleSoft Application Designer, as shown in this example, and see where the bind variable is passed in (note that this is a frame-based template, as frame tags are present):

The following screenshot is an example of frame-based dynamic template.

Using bind variables with a dynamic template

All dynamic iframe-based templates are retrieved from a URL rather than from an HTML document. Most commonly, the URL for dynamic templates is an iScript URL. As with other templates, the template content reference must be defined as a template on the portal administration pages. However, instead of including specific HTML content, the dynamic template references an iScript. The iScript is associated with a specified field in a specified record.

Important! HTML templates are deprecated as of PeopleTools 8.50. PeopleSoft applications require iframe templates to function as designed. Features that are unsupported in HTML templates experience significant or total loss of functionality; such features include:

• Modal windows used for prompts, secondary pages, and grid zoom.

• Main Menu drop-down navigation.

• Related content.

• WorkCenter pages.

• Global search header.

Image: Defining an iframe-based dynamic template on the Content Ref Administration page

The following screenshot illustrates an iframe-based dynamic template named DEFAULT_TEMPLATE in the Portal Objects, Templates folder:

Defining an iframe-based dynamic template on the Content Ref Administration page

The content reference storage type is set to Remote by URL. This setting is required for dynamic templates. Additionally, no HTML area displays the associated HTML code for the template, as you would expect with a static template. Instead, when the URL type for this example is set to PeopleSoft Script, an iScript parameters area appears on the page, in which you can define the record name, field name, PeopleCode event name, and PeopleCode function name that specify the iScript to use for the template.

The iScript that dynamically generates the template is located in the WEBLIB_PT_NAV record in the ISCRIPT1 field, as shown in this example:

Image: Opening the WEBLIB_PT_NAV record associated with a dynamic template

The following screenshot illustrates a WEBLIB_PT_NAV record associated with a dynamic template.

WEBLIB_PT_NAV record

Additionally, the iScript function is associated with the FieldFormula PeopleCode event. The PeopleCode function name is IScript_PT_Frames_Template.

Image: Selecting the PeopleCode Display view

You can select the PeopleCode Display view to see which fields have PeopleCode programs defined for which PeopleCode events. By convention, function libraries have PeopleCode defined for the FieldFormula event.

Opening the record and field associated with a dynamic template

Once you open the appropriate record and field in PeopleSoft Application Designer, you can view the FieldFormula PeopleCode. The iScript is referenced by the PeopleCode function name in the template’s definition. An easy way to find the exact reference is to copy the PeopleCode function name from the template definition and paste it into the Find dialog box of the PeopleCode editor once you open the corresponding record and field.

Image: The iScript upon which the dynamic iframe template is based

The following screenshot illustrates the e code of the iScript that is referenced by the portal template, as shown in this example:

The iScript upon which the dynamic iframe template is based

The following code calls the PT_IFRAME_TEMPLATE HTML definition from the HTML catalog and passes the definition bind variables:

   Return GetHTMLText(HTML.PT_IFRAME_TEMPLATE, &charSet, &requiredToolsSS, &sysDefaultSS, &domainJS, &expireJS, &ptCommonJS, &ptEventJS, &ptUtilJS, &ptAjaxJS, &crossDomainJS, &saveWarnJS, &iframeHdrJS, &iframeJS, &rcJS, &navHeader.HTML, &nav2JS, &ptPopupJS, &params1, &encryptedUserId, &rcMenuJS, &rcHTML1, &tgtIframeTitle, &rcServiceJS, &cssOverride);

Image: PT_IFRAME_TEMPLATE HTML definition showing inline frames

The resulting HTML code forms the basis for the dynamic portal template at runtime. You can open the PT_IFRAME_TEMPLATE HTML definition in PeopleSoft Application Designer, as shown in this example, and see where the bind variable is passed in (note that this is an iframe-based template, as <iframe> tags are present):

The following screenshot illustrates an example of iframe-based template (HTML) that contains inline frames.

PT_IFRAME_TEMPLATE HTML definition showing inline frames

Inline frame-based, or iframe-based, templates enable you to embed a frame within an HTML document rather than as a frameset. You can use the iframe <source> attribute to load content into the template. PeopleSoft applications use this attribute for target content only. The header and navigation content are in the HTML document itself as you see in the preceding PT_IFRAME_TEMPLATE HTML definition:

Note the following points about the standard iframe template:

  • The Usage Type is set to Inline frame template; this is a requirement for all iframe-based templates.

  • The iframe HTML definition supports only the <pagelet> and <target> meta-tags.

    Important! The IClientComponent meta-tag is not supported.

  • Using inline frames enables you to click the navigation and see only the target content change. The entire page does not refresh. This approach allows for much more flexibility and facilitates the header and navigation working together.

  • When you navigate to different content within the iframe template, the URL in the browser address bar may not be up to date.

  • If you create your own iframe-based template, include the !DOCTYPE at the top of the code.