Appendix: Using Bind Variables

This appendix provides an example of branding using bind variables from previous releases of Enterprise Portal, and contains an example for creating and configuring custom branding headers with bind variables.

Click to jump to parent topicUnderstanding Bind Variables

Branding system elements are simply the bind variables embedded in the HTML that are used for Branding headers and footers. The bind variables are replaced with actual values at run time to generate HTML.

The PeopleCode example below shows how dynamic content is embedded into static content using a bind variable:<a href="%bind(:1)"><img src="/images/home.gif" border=0 ></a> The value of the bind number can be found in the calling PeopleCode program that binds the object to the HTML definition. &HTML = GetHTMLText(HTML.TEST,”www.peoplesoft.com”)

By providing a set of predefined bind variables as system elements, the Branding PeopleCode program will know how to assemble the HTML syntax according to the system element assigned. Keep in mind that any changes to the system element number and type are not allowed. You should also include all non-configurable system JavaScript/HTML %binds, as they reference JavaScript files (TimeOut warnings, for example), forms, or additional HTML that enable the system to work properly.

Click to jump to parent topicExample: Creating and Configuring Custom Branding Headers with Bind Variables

This section provides an example for creating and configuring a custom header, using the steps discussed earlier in this chapter, and describes how to:

This example demonstrates how to create the following header.

Header created in this example

Click to jump to top of pageClick to jump to parent topicGenerating the Header HTML

PeopleSoft Enterprise Portal delivers the EPPBR_HDRHTML_BASE HTML HTML object as the base for creating any new header for use with branding.

To generate the HTML for the header:

  1. In Application Designer, open the EPPBR_HDRHTML_BASE HTML definition.

  2. The object opens and you can view the object HTML.

    <html> <head> %bind(:21) <title></title> <!-- title is generated by Tools--> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!--system generated HTML %bind22, %bind23, %bind24, %bind25, %bind26, %bind27--> <script language='javascript' src='%bind(:22)'></script> <script language='javascript' src='%bind(:23)'></script> %bind(:24) %bind(:25) %bind(:26) %bind(:27) <!--%bind16, %bind17--> <LINK REL="stylesheet" HREF="%bind(:16)" TYPE="text/css"> <LINK REL="stylesheet" HREF="%bind(:17)" TYPE="text/css"> <style type="text/css"> ​<!--ADD CUSTOM STYLES HERE--> </style> </head> <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0"marginheight="0"> <!--custom HTML begins--> ​<!--ADD CUSTOM HTML HERE--> <!--custom HTML ends--> <!--system generated HTML %bind28, %bind29, %bind30--> %bind(:28) %bind(:29) %bind(:30) <!--system reserved elements HTML %bind19, %bind20--> %bind(:19) %bind(:20) </body> </html>

  3. Save the HTML object with the name PLANET_PSFT_HDR_HTML.

  4. Copy your custom HTML and insert into the <!--ADD CUSTOM HTML HERE--> section of the previously displayed HTML object. It is assumed that you have already created the basic HTML for your interface outside of the PeopleSoft system.

  5. Remove all scripts and functions, if any, from the custom HTML you pasted into the HTML object in the previous step.

    Make note of any additional custom scripts and functions within the header. Branding takes care of reinserting all delivered scripts and functions. This is performed by system elements 21 to 30. You will allocate additional system elements for custom scripts and functions. You can also choose to leave custom scripts and functions in the HTML object. Keep layout reusability and ease of maintenance in mind when making this decision.

  6. Save the file.

Click to jump to top of pageClick to jump to parent topicIdentifying HTML Syntax to Replace with Branding System Elements

This section discusses identifying HTML syntax to replace by system elements.

To identify custom HTML syntax to replace with branding system elements:

  1. In the PeopleSoft Pure Internet Architecture, select Portal Administration, Branding, Define Elements, Enable HTML Layouts.

  2. Add a new value and set the HTML Layout ID to PLANET_PSFT_HDR_LAYOUT, and then do the following:

    1. Enter a description.

    2. Select an HTML Object name of PLANET_PSFT_HDR_HTML.

    3. Select a layout type of Header.

      A list of applicable branding elements displays.

  3. Analyze the custom HTML from step 1, according to the element list.

    To make this task easier, you may want to use an external text editor, highlighting the syntax that you want to convert to system elements. In addition, highlight the attributes and styles that go along with the system elements.

  4. The more HTML syntax you move out of the layout HTML object and into system elements, the fewer changes you will likely need to make to the layout HTML object.

    For example, instead of changing the layout HTML object, you can use system elements on the fly to change the look and feel of a portal header. Using system elements makes your HTML layout more reusable and flexible.

    Identifying potential system elements in your header

  5. On the HTML Layouts and Element Selection page, select the applicable system elements for the header and enter custom labels.

Following is the original HTML. Text highlighted in bold denotes style class code.

<table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr valign="top"> <td valign="top" rowspan="2"><a proxied="false" href="http://my.company.com⇒ /servlets/psportal/peoplesoft8/?cmd=start"><img name="logo" src="http:⇒ //planetx.peoplesoft.com/planet_content/images/planet/logos/myplanetps.gif" border=⇒ ⇒ "0"></a> </td> <td rowspan="2" width="100%"></td> <td valign="top" align="right"> <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0"> <tr valign="top"> <td valign="top" width="87" align="right"><img src="http://planetx.peoplesoft.com⇒ /planet_content/images/planet/planet_header_corner_fade.jpg" width="112" height=⇒ "21" border="0"> </td> <td bgcolor="#000000" nowrap valign="middle" align="right"><font color="#FFFFFF"><a⇒ ⇒ proxied="false" href="http://my.company.com/servlets/psportal/peoplesoft8/?cmd=⇒ start" target="_parent" ​class="EBIZ_WHITE_HYPERLINK">Home</a> | <a href="http:⇒ //my.company.com/servlets/psportal/peoplesoft8/?url=http%3a%2f%2fmy.company.com%2fs⇒ ⇒ ervlets%2ficlientservlet%2fpeoplesoft8%2f%3fICType%3dScript%26target%3dmain%26ICScr⇒ ⇒ iptProgramName%3dWEBLIB_EBIZ_LNK.ISCRIPT1.FieldFormula.IScript_⇒ Dir%26ID%3d0000000001" target="_parent" ​class="EBIZ_WHITE_HYPERLINK">Map</a> | <a⇒ href="http://my.company.com/servlets/psportal/peoplesoft8/?url=⇒ http%3a%2f%2fmy.company.com%2fservlets%2ficlientservlet%2fpeoplesoft8%2f%3f⇒ ICType%3dPanel%26Menu%3dADMINISTER_EBIZ%26Market%3dGBL%26PanelGroupName%3dEBIZ_⇒ CONTACT_US" target="_parent" ​class="EBIZ_WHITE_HYPERLINK">Contact Us</a> | <a⇒ href="http://my.company.com/servlets/psportal/peoplesoft8/?url=⇒ http%3a%2f%2fwww.peoplesoft.com" target="_parent" ​class="EBIZ_WHITE_HYPERLINK"⇒ >PeopleSoft.com</a> | <a href="javascript:void window.open('http:⇒ //my.company.com/servlets/iclientservlet/peoplesoft8/?ICType=Script&amp;target=⇒ main&amp;ICScriptProgramName=WEBLIB_EBIZ_LNK.ISCRIPT1.FieldFormula.IScript_⇒ Hlp&amp;ID=0000000004', 'Help','width=800,height=600,resizable=⇒ yes,directories=no,toolbar=no,menubar=no,location=no,copyhistory=no');" target="_⇒ parent" ​class="EBIZ_WHITE_HYPERLINK" style="cursor:help">Help</a> | <a proxied=⇒ "false" href="http://my.company.com/servlets/psportal/peoplesoft8/?cmd=⇒ logout" target="_parent" ​class="EBIZ_WHITE_HYPERLINK">Sign Off</a>&nbsp;</font> </td> </tr> </table> </td> </tr><tr valign="top"> <td align="right" valign="top"><img name="peoplepowertheinternet" src="http:⇒ //planetx.peoplesoft.com/planet_content/images/planet/logos⇒ /peoplepowertheinternet.gif" width="390" height="35" border="0"> </td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr valign="top"> <td valign="top" bgcolor="#B2B2CB"><img src="http://planetx.peoplesoft.com/planet_⇒ content/images/planet/shim.gif" width="100%" height="1" border="0"></td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr height="100%" valign="top"> <td width="100%" ​class="STRONG"><!--Begin iclientcomponent: Greeting URL: http:⇒ //my.company.com/servlets/iclientservlet/peoplesoft8/?ICType=Script&ICScript⇒ ProgramName=WEBLIB_EBIZ.TEMPLATE_FUNC.FieldFormula.IScript_Greeting--⇒ ><span>Welcome User</span><!--End iclientcomponent: Greeting --> </td> <td align="right" nowrap><!--Begin iclientcomponent: PSFT%20Stock URL: http:⇒ //my.company.com/servlets/iclientservlet/peoplesoft8/?ICType=Script&ICScript⇒ ProgramName=WEBLIB_EBIZ.ISCRIPT1.FieldFormula.IScript_PSFT_Stock--><span> <table border="0" cellpadding="0" cellspacing="0" width='100%'> <tr> <td nowrap><a href='http://my.company.com/servlets/psportal/peoplesoft8/?url=⇒ http%3a%2f%2ffinance.yahoo.com%2fq%3fs%3dPSFT%26d%3dt' title='Last updated on 3⇒ /12/2003 at ET' ​class='PSHYPERLINK'>PSFT</a> &nbsp;&nbsp;15.352&nbsp;&nbsp; <font⇒ color='#008000'>+0.032</font>&nbsp;&nbsp;<br> <center><font size="1"><a href='http://my.company.com/servlets/psportal⇒ /peoplesoft8/?url=http%3a%2f%2fplanetx.peoplesoft.com%2fdisclaimer%2fstockquote.htm⇒ ⇒ '>Quote delayed 20 minutes</a></font></center> </td> </tr> </table> </span><!--End iclientcomponent: PSFT%20Stock --> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="20%" height="100%"> <tr height="100%" valign="top"> <td></td> <td valign="top" ​class="EBIZ_STDTEXT" nowrap> <!--======================== BEGIN: PERSONALIZATION ========================== -->Personalize <a href="http://my.company.com/servlets/psportal/peoplesoft8/?url=⇒ http%3a%2f%2fmy.company.com%2fservlets%2ficlientservlet%2fpeoplesoft8%2f%3f⇒ ICType%3dPanel%26Menu%3dPORTAL_PERS_HOMEPAGE%26Market%3dGBL%26PanelGroupName%3d⇒ PORTAL_HOMEPAGE%26PORTALPARAM_PAGE%3dCONTENT"><img border="0" src="http:⇒ //planetx.peoplesoft.com/planet_content/images/planet/content.gif" align="middle"⇒ width="55" height="15"></a> <a href="http://my.company.com/servlets/psportal⇒ /peoplesoft8/?url=http%3a%2f%2fmy.company.com%2fservlets%2ficlientservlet%2fpeoples⇒ ⇒ oft8%2f%3fICType%3dPanel%26Menu%3dPORTAL_PERS_HOMEPAGE%26Market%3dGBL%26PanelGroup⇒ Name%3dPORTAL_HOMEPAGE%26PORTALPARAM_PAGE%3dLAYOUT"><img border="0" src="http:⇒ //planetx.peoplesoft.com/planet_content/images/planet/layout.gif" align="middle"⇒ width="55" height="15"></a><br> <!--======================== END: PERSONALIZATION ==========================--> <!-- </td> </tr> </table>

Click to jump to top of pageClick to jump to parent topicReplacing Identified HTML Syntax With Bind Variables

In this example, the following bind variables will replace the sections of custom HTML in italics in the previous examples as indicated here:

%bind(:31)

This bind variable replaces the following custom HTML in the previous section:

<a proxied="false" href="http://my.company.com/servlets/psp ortal/peoplesoft8/?cmd=start"><img name="logo" src="http:// planetx.peoplesoft.com/planet_content/images/planet/logos/m yplanetps.gif" border="0"></a>

%bind(:32)

This bind variable replaces the following custom HTML in the previous section:

<img src="http://planetx.peoplesoft.com/planet_content/imag es/planet/planet_header_corner_fade.jpg" width="112" height ="21" border="0">

%bind(:33)

This bind variable replaces the following custom HTML in the previous section:

<img name="peoplepowertheinternet" src="http://planetx.peop lesoft.com/planet_content/images/planet/logos/peoplepowerth einternet.gif" width="390" height="35" border="0">

%bind(:34)

This bind variable replaces the following custom HTML in the previous section:

<img src="http://planetx.peoplesoft.com/planet_content/imag es/planet/shim.gif" width="100%" height="1" border="0">

%bind(:6)

This bind variable replaces the following custom HTML in the previous section:

<td bgcolor="#000000" nowrap valign="middle" align="right"> <font color="#FFFFFF"><a proxied="false" href="http://my.co mpany.com/servlets/psportal/peoplesoft8/?cmd=start" target= "_parent" class="EBIZ_WHITE_HYPERLINK">Home</a> | <a href=" http://my.company.com/servlets/psportal/peoplesoft8/?url=ht tp%3a%2f%2fmy.company.com%2fservlets%2ficlientservlet%2fpeo plesoft8%2f%3fICType%3dScript%26target%3dmain%26ICScriptPro gramName%3dWEBLIB_EBIZ_LNK.ISCRIPT1.FieldFormula.IScript_Di r%26ID%3d0000000001" target="_parent" class="EBIZ_WHITE_HYP ERLINK">Map</a> | <a href="http://my.company.com/servlets/p sportal/peoplesoft8/?url=http%3a%2f%2fmy.company.com%2fserv lets%2ficlientservlet%2fpeoplesoft8%2f%3fICType%3dPanel%26M enu%3dADMINISTER_EBIZ%26Market%3dGBL%26PanelGroupName%3dEBI Z_CONTACT_US" target="_parent" class="EBIZ_WHITE_HYPERLINK" >Contact Us</a> | <a href="http://my.company.com/servlets/p sportal/peoplesoft8/?url=http%3a%2f%2fwww.peoplesoft.com" t arget="_parent" class="EBIZ_WHITE_HYPERLINK">PeopleSoft.com </a> | <a href="javascript:void window.open('http://my.comp any.com/servlets/iclientservlet/peoplesoft8/?ICType=Script& amp;target=main&amp;ICScriptProgramName=WEBLIB_EBIZ_LNK.ISC RIPT1.FieldFormula.IScript_Hlp&amp;ID=0000000004', 'Help',' width=800,height=600,resizable=yes,directories=no,toolbar=n o,menubar=no,location=no,copyhistory=no');" target="_⇒ parent" class="EBIZ_WHITE_HYPERLINK" style="cursor:help">Help</a>⇒ | <a proxied="false" href="http://my.company.com/servlets/psp ortal/peoplesoft8/?cmd=logout" target="_parent" class="EBIZ _WHITE_HYPERLINK">Sign Off</a>&nbsp;</font>

%bind(:4)

This bind variable replaces the following custom HTML in the previous section:

<a href="http://my.company.com/servlets/psportal/peoplesoft 8/?url=http%3a%2f%2fmy.company.com%2fservlets%2ficlientserv let%2fpeoplesoft8%2f%3fICType%3dPanel%26Menu%3dPORTAL_PERS_ HOMEPAGE%26Market%3dGBL%26PanelGroupName%3dPORTAL_HOMEPAGE% 26PORTALPARAM_PAGE%3dCONTENT"><img border="0" src="http://p lanetx.peoplesoft.com/planet_content/images/planet/content. gif" align="middle" width="55" height="15"></a> <a href="ht tp://my.company.com/servlets/psportal/peoplesoft8/?url=http %3a%2f%2fmy.company.com%2fservlets%2ficlientservlet%2fpeopl esoft8%2f%3fICType%3dPanel%26Menu%3dPORTAL_PERS_HOMEPAGE%26 Market%3dGBL%26PanelGroupName%3dPORTAL_HOMEPAGE%26PORTALPAR AM_PAGE%3dLAYOUT"><img border="0" src="http://planetx.peopl esoft.com/planet_content/images/planet/layout.gif" align="m iddle" width="55" height="15"></a><br>

%bind(:7)

This bind variable replaces the following custom HTML in the previous section:

Welcome User

%bind(:51)

This bind variable replaces the following custom HTML in the previous section:

<!--Begin iclientcomponent: PSFT%20Stock URL: http://my.com pany.com/servlets/iclientservlet/peoplesoft8/?ICType=Script &ICScriptProgramName=WEBLIB_EBIZ.ISCRIPT1.FieldFormula.IScr ipt_PSFT_Stock--><span> <table border="0" cellpadding="0" cellspacing="0" width='10 0%'><tr><td nowrap><a href='http://my.company.com/servlets/ psportal/peoplesoft8/?url=http%3a%2f%2ffinance.yahoo.com%2f q%3fs%3dPSFT%26d%3dt' title='Last updated on 3/12/2003 at E T' class='PSHYPERLINK'>PSFT</a> &nbsp;&nbsp;15.352&nbsp;&nb sp; <font color='#008000'>+0.032</font>&nbsp;&nbsp;<br><cen ter><font size="1"><a href='http://my.company.com/servlets/ psportal/peoplesoft8/?url=http%3a%2f%2fplanetx.peoplesoft.c om%2fdisclaimer%2fstockquote.htm'>Quote delayed 20 minutes< /a></font></center></td></tr></table></span><!--End iclient component: PSFT%20Stock -->

To replace custom HTML with bind variables:

Add custom JavaScript Functions or scripts. The following two options are available:

Save the PLANET_PSFT_HDR_HTML_HTML object.

The following example shows the final HTML object code:

<html> <head> %bind(:21) <title></title> <!-- title is generated by Tools--> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!--system generated HTML %bind22, %bind23, %bind24, %bind25, %bind26, %bind27--> <script language='javascript' src='%bind(:22)'></script> <script language='javascript' src='%bind(:23)'></script> %bind(:24) %bind(:25) %bind(:26) %bind(:27) <!--%bind16, %bind17--> <LINK REL="stylesheet" HREF="%bind(:16)" TYPE="text/css"> <LINK REL="stylesheet" HREF="%bind(:17)" TYPE="text/css"> <style type="text/css"> ​<!--custom style begins--> .EBIZ_WHITE_HYPERLINK {font-family: "Verdana","Arial","sans-serif"; font-size:8pt; font-weight: normal; font-Style: normal; font-variant: normal; color: rgb(255,255,255); word-spacing: normal; letter-spacing: normal; line-height: normal; white-space: normal;} .EBIZ_WHITE_HYPERLINK:HOVER {font-family: "Verdana","Arial","sans-serif"; font-size: 8pt; font-weight: normal; font-Style: normal; font-variant: normal; color: rgb(178,178,208); word-spacing: normal; letter-spacing: normal; line-height: normal; white-space: normal;} .EBIZ_STDTEXT {font-size: 10pt; padding-right: 3px; padding-left: 3px} .EBIZ_STDTEXT_NO_UL {font-size: 10pt; text-decoration: none; } ​<!--custom style ends--> </style> </head> <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> ​<!--custom style begins--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr valign="top"> <td valign="top" rowspan="2">%bind(:31)</a> </td> <td rowspan="2" width="100%"></td> <td valign="top" align="right"> <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0"> <tr valign="top"> <td valign="top" width="87" align="right">%bind(:32) </td> <td>%bind(:6)</td> </tr> </table> </td> </tr> <tr valign="top"> <td align="right" valign="top">%bind(:33)</td> </tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr valign="top"> <td valign="top" bgcolor="#B2B2CB">%bind(:34)</td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr height="100%" valign="top"> <td width="100%" class="STRONG">%bind(:7)</td> <td align="right" nowrap>%bind(:51)</td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="20%" height="100%"> <tr height="100%" valign="top"> <td></td> <td valign="top" class="EBIZ_STDTEXT" nowrap> ​%bind(:4) </td> </tr> </table> ​<!--custom HTML ends--> <!-- system generated HTML %bind28--> <!--system generated HTML %bind29, %bind30--> %bind(:29) %bind(:30) <!--system reserved elements HTML %bind19, %bind20--> %bind(:19) %bind(:20) </body> </html>

Click to jump to top of pageClick to jump to parent topicConfiguring the Header

To configure the header:

  1. Click the Add New Value tab.

  2. In the Header ID field, enter PLANET_PSFT_NDR.

  3. In the Description field, enter a description.

  4. In the HTML Layout ID field enter PLANET_PSFT_HDR_LAYOUT.

  5. Save the changes.

Access the Images, Bars and HTML Area tabs and set values based on the styles you added when you replaced custom HTML with bind variables in the previous section. For example:

  1. Images—Use the Images tab to move images into the database or specify a URL as the image source.

  2. Bars—Use the Bars tab to specify style classes for the bars and individual bar items as necessary.

  3. HTML areas—The system does not support iScripts, there you have to convert the iScript into application class code (PLANET_APP_PACKAGE:GetStockInfo:GetStockHTML) to generate the stock quote.