Appendix: Creating Custom Templates for Web Magazines

This appendix discusses how to:

See Also

iScripts Used to Assemble and Present Web Magazines

Click to jump to parent topicConstructing Templates for Cover Pages

To construct a template for a Web Magazine cover page:

  1. Design the template in HTML markup.

    Before creating a template, decide on the page design and break it up into table cells.

    Code example:

    <HTML> <HEAD><TITLE> PeopleTalk: Home Page </TITLE></HEAD> <BODY LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"> <TABLE BORDER="1" CELLPADDING="0" CELLSPACING="0" WIDTH="760"> <!-- Header --> <TR><TD height=34>%BIND(:1)</TD></TR> <!-- Navigation Bar 1 --> <TR><TD height=25 bgcolor=gray>%BIND(:2)</TD></TR> </Table> (code deleted) <table border="0" cellpadding="0" cellspacing="0" width="760"> <tr><td valign="bottom"> <!-- <a href="/en/new/peopletalk/jun2000/ceo/index.html"> --> <IMG SRC="/peoplesoft8/images/webpublishing/PWSYBONQO8C.gif" ALT="Mark Hoffman" width="155" height="217" ALIGN="top" border="0"hspace="0"> <!-- </a>--> </td> <td valign="top" bgcolor="#C6E39E"> <table border="0" cellpadding="0" cellspacing="0" width="166"> <tr valign="top"> <td> <a href="%BIND(:6)?ICType=Script&ICScriptProgramName=WEBLIB_ WEBPUB.EO_PE_TEMPLATES.Field Formula.IScript_SectionArticleTemplate&PUB=PEOPLETALK&ISSUE=%BIND(:7)&SECTION= NEWS"> <img src="/peoplesoft8/images/webpublishing/PWS5JA6S59C.gif" width="56" height="35" vspa ce="0" hspace="3" border="0"> </a> </td> </tr> <tr valign="top"> <td> %BIND(:3) </td> </tr> </table> </td> <td valign="top" bgcolor="#FFFFCC"> <a href="%BIND(:6)?ICType=Script&ICScriptProgramName=WEBLIB_WEBPUB.EO_PE_ TEMPLATES.FieldFormula.IScript_S ectionArticleTemplate&PUB=PEOPLETALK&ISSUE=%BIND(:7)&SECTION=INDUSTRY"> <IMG SRC="/peoplesoft8/images/webpublishing/PWS24J8F44C.gif" ALT="Industry Focus" width="439" height="32" ALIGN="top" border="0" hspace="0" vspace="Variables.ivspace"> </a> <table width="100%" border="0" cellspacing="5" cellpadding="0"> <tr valign="top"> <font face="Arial, Helvetica, sans-serif" size="1" color="#000066"> <td> %BIND(:4) </td> </font> </tr> </table> </td> </tr> </table> <!-- Footer --> <TABLE BORDER="1" CELLPADDING="0" CELLSPACING="0" WIDTH="760"> <TR> <TD> %BIND(:5) </TD> </TR> </TABLE> </BODY> </HTML>

  2. Place this HTML code within an HTML object in PeopleTools, and save the object.

  3. Add the appropriate BIND parameters to each cell in the HTML object for your template.

  4. Save the HTML object in PeopleTools.

  5. Open the record WEBLIB_WEBPUB in PeopleTools.

  6. Navigate to the record PeopleCode for the field EO_PE_TEMPLATES.

    Edit this PeopleCode as needed.

  7. Call functions to get the values for the bind variables.

    1. Under the function IScript_WebPublishing, add the appropriate functions to bind values to the values that you have set up in your HTML object (the cover page template).

      In the following example, we show how to bind a value to the fourth bind variable. The fourth bind variable in the article template represents the articles for the section INDUSTRY. A function is delivered with Web Magazine feature to get the article listing for a section. This function is called IScript_GetSectionArticles.

    2. From the PeopleCode in IScript_WebPublishing, call the function IScript_GetSectionArticles and set it to a string variable.

      In our example, we set the return value of the function to the variable &IndustryFocus.

      Example:

      rem; rem Get the Articles for the INDUSTRY; rem; rem Parameters Values for the Function Call; rem Number Description Value rem ---------- ------------------- --------- rem 1 Number of Columns 3 rem 2 FontSize 1 rem 3 Section Title On 0 (FALSE) rem 4 Category Title On 1 (TRUE) rem 5 ArticleSummary On 0 (FALSE) rem 6 More... On 0 (FALSE) rem 7 Section Name "INDUSTRY" rem; &IndustryFocus = IScript_GetSectionArticles(3, 1, 0, 1, 0, 0, "INDUSTRY");

  8. Bind function values to the HTML object (cover page template).

    Specifically, bind &IndustryFocus into our HTML object (cover page template) using the function GetHTMLText.

    This function takes our HTML object (cover page template), which was saved as EO_PE_FRONTPAGETEMPLATE, and binds the bind values into it. These values must occur in the order in which they were specified in the HTML object. The variable &IndustryFocus is listed fourth because it is the fourth bind variable.

    Example:

    &HTMLText = GetHTMLText(HTML.EO_PE_FRONTPAGETEMPLATE, &HTMLHeader, &HTMLNav1, &CompanyNews, &IndustryFocus, &H TMLFooter, &articleURL, &sectionURL, IScript_GetImage("PWSH507PO8C"), IScript_Get Image("PWSEP6SXO8C"), IScript _GetImage("PWSPS3TQO8C"), IScript_GetImage("PWS4MT7QO8C"), IScript_GetImage ("PWSTRUTPO8C"), IScript_GetImage(" PWSPB7CPO8C"), IScript_GetImage("PWSYBONQO8C"), IScript_GetImage("PWS5JA6S59C"), IScript_GetImage("PWS24J8F44C "));

  9. Include the cover page template in the portal.

  10. Repeat the process and bind additional cells within the HTML object (cover page template).

    For each bind value, you can add a function, another HTML object, or static text or images. Continue until all the cells of the HTML object have values.

Click to jump to parent topicDisplaying Articles in a Section

Use the section page layout to display the articles in a particular section of the publication. On the section page, the title bar and navigation bar appear with the section navigation bar.

You can use the section navigation bar to access all sections in the publication. In the following example, the navigation bar appears only on the section page and the article page. However, you can also place it in the cover page layout.

To construct a template for a Web magazine section:

  1. Design the template in HTML.

    Before creating the template, decide on the page design and break it up into table cells.

    Code example:

    <HTML> <HEAD> <TITLE> PeopleTalk: Home Page </TITLE> <meta name="keyword" content="PSA Professional Services Automation"> <style type="text/css"> A:HOVER { font-family : Arial, Helvetica, sans-serif; color: #FF0066; } A:LINK { font-family : Arial, Helvetica, sans-serif; color: #0000FF; } A:VISITED { font-family : Arial, Helvetica, sans-serif; color: #0000FF; } .bodytext { font-family : Arial, Helvetica, sans-serif; font-size : 10pt; color : #000000; background-color : #FFFFCC; } </style> </HEAD> <BODY> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="760"> <!-- Header --> <TR> <TD> %BIND(:1) </TD> </TR> <!-- Navigation Bar 1 --> <TR> <TD> %BIND(:2) </TD> </TR> <!-- Navigation Bar 2 --> <TR> <TD BACKGROUND="%BIND(:3)"> %BIND(:4) </TD> </TR> <!-- Section Image --> <TR> <TD> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="760" BGCOLOR=⇒ "#FFFFCC"> <TR> <TD class="bodytext"> %BIND(:5) </TD> </TR> </TABLE> </TD> </TR> <!-- Section Articles --> <TR> <TD> <TABLE class="bodytext" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH= "760" BGCOLOR="#FFFFCC"> <TR> <TD> %BIND(:6) </font> </TD> </TR> </TABLE> </TD> </TR> <!-- Footer --> <TR> <TD> %BIND(:7) </TD> </TR> </TABLE> </BODY> </HTML>

  2. Place this HTML code within an HTML object in PeopleTools.

  3. Add the appropriate BIND parameters to each cell in the HTML object for the template.

  4. Save the HTML object in PeopleTools.

  5. Open the record WEBLIB_WEBPUB in PeopleTools.

  6. Navigate to the record PeopleCode for the field EO_PE_TEMPLATES.

    Edit the PeopleCode as appropriate.

  7. Call functions to get the values for the BIND variables.

    1. Under the function IScript_SectionArticleTemplate, add the appropriate functions to bind values to the values that you have set up in your HTML object (the article template).

      In the following example, we show you how to bind a value to the sixth bind variable. The sixth cell in the article template represents an article listing for all articles in the section. A function is included with Web Magazine that gets all the articles for a section. This function is called IScript_GetSectionArticles.

    2. From the PeopleCode in IScript_SectionArticleTemplate, call the function IScript_GetSectionArticles and set it to a string variable.

      In our example, we set the return value of the function to the variable &HTMLBody.

      Example:

      rem; rem Get the Articles for the DEFAULT; rem; rem Parameters Values for the Function Call; rem Number Description Value; rem ---------- ------------------- ---------; rem 1 Number of Columns 3; rem 2 FontSize 2; rem 3 Section Title On 0 (FALSE); rem 4 Category Title On 1 (TRUE); rem 5 ArticleSummary On 1 (TRUE); rem 6 More... On 0 (FALSE); rem 7 Section Name ""; rem; &HTMLBody = IScript_GetSectionArticles(3, 2, 0, 1, 1, 0, "");

  8. Bind function values to the HTML object (section template).

    Bind &HTMLBody into HTML object (section template) using the function GetHTMLText.

    Function GetHTMLText takes our HTML object (section template), which was saved as EO_PE_SECTIONTEMPLATE, and binds into it the six bind values. These values must occur in the order that they were specified in the HTML object. The variable &HTMLBody is listed fifth because it is the fifth bind variable.

    Example:

    rem; rem Build The Web Page; rem; &HTMLText = GetHTMLText(HTML.EO_PE_SECTIONTEMPLATE, &HTMLHeader, &HTMLNav1, IScript_GetImageFileSpec("PWSA19OE85C"), &HTMLNav2, &HTMLSectionImg, &HTMLBody, &HTMLFooter);

  9. Section the template within the portal.

  10. Repeat the process and bind additional cells within the HTML object section template.

    For each bind value, you can add a function, another HTML object, or static text or images. Continue until all the cells of the HTML object have values.

See Also

iScripts Used to Assemble and Present Web Magazines

Enterprise PeopleTools 8.50 PeopleBook: PeopleSoft Application Designer

Click to jump to parent topicDisplaying Articles

Use the article page layout to display an article within the publication. You have the freedom to arrange this page as desired. In the following illustration, the article is shown with a title and a side navigation bar that shows all the articles within this section.

To construct a template for a Web magazine article:

  1. Design the template in HTML.

    Before creating a template, decide on the page design and break it up into table cells.

    Code example:

    <HTML> <HEAD> <TITLE> PeopleTalk: Home Page </TITLE> <meta name="keyword" content="PSA Professional Services Automation"> <style type="text/css"> A:HOVER { font-family : Arial, Helvetica, sans-serif; color: #FF0000; text-decoration: none; } A:LINK { font-family : Arial, Helvetica, sans-serif; color: #0000FF; text-decoration: none; } A:VISITED { font-family : Arial, Helvetica, sans-serif; color: #0000FF; text-decoration: none; } A:HOVER.leftnavlink { font-family : Arial, Helvetica, sans-serif; color: #FF0000; text-decoration: none; } A:LINK.leftnavlink { font-family : Arial, Helvetica, sans-serif; color: #0000FF; text-decoration: none; } A:VISITED.leftnavlink { font-family : Arial, Helvetica, sans-serif; color: #0000FF; } .bodytext { font-family : Arial, Helvetica, sans-serif; font-size : 10pt; color : #000000; background-color : #FFFFFF; } .blocktext { font-family : Arial, Helvetica, sans-serif; font-size : 10pt; color : #000000; background-color : #FFFFFF; } </style> </HEAD> <BODY> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="760"> <!-- Header --> <TR> <TD COLSPAN=2> %BIND(:1) </TD> </TR> <!-- Navigation Bar 1 --> <TR> <TD COLSPAN=2> %BIND(:2) </TD> </TR> <!-- Navigation Bar 2 --> <TR> <TD COLSPAN=2 BACKGROUND="%BIND(:3)"> %BIND(:4) </TD> </TR> <!-- Category Picture --> <TR> <TD WIDTH="140" HEIGHT="130"> %BIND(:5) </TD> <!-- Article Title Picture --> <TD WIDTH="620"> %BIND(:6) </TD> </TR> <!-- Section Articles Navigation Bar --> <TR> <TD WIDTH="140" BGCOLOR="#CCFFCC" VALIGN="TOP"> %BIND(:7) </TD> <!-- Article Body --> <TD> <table width="100%" border="0" cellspacing="0" cellpadding="8"> <tr> <td class="bodytext"> %BIND(:8) </td> </tr> </table> </TD> </TR> <!-- Footer --> <TR> <TD COLSPAN=2> %BIND(:9) </TD> </TR> </TABLE> </BODY> </HTML>

  2. Place this HTML code within an HTML object in PeopleTools.

  3. Add the appropriate BIND parameters to each cell in the HTML object for your template.

  4. Save the HTML object in PeopleTools.

  5. Open the record WEBLIB_WEBPUB in PeopleTools.

  6. Navigate to the record PeopleCode for the field EO_PE_TEMPLATES.

    Edit this PeopleCode to suit your needs.

  7. Call functions to get the values for the bind variables.

    1. Under the function IScript_ArticleTemplate, add the appropriate functions to bind values to the values you have set up in your HTML object (the article template).

      In our example, we will bind a value to the fifth bind variable. The fifth cell in the article template represents the category image. The function IScript_GetCategoryImg is delivered with Web Magazine to get the category image.

    2. From the PeopleCode in IScript_ArticleTemplate, call the function IScript_GetCategoryImg and set it to a string variable.

      In our example, set the return value of the function to the variable &HTMLCategoryImage.

      Example:

      rem; rem Category Image; rem; &HTMLCategoryImage = IScript_GetCategoryImg();

  8. Bind function values to the HTML object (article template).

    Bind &HTMLCategoryImage into the HTML object (article template) using the function GetHTMLText.

    This function takes our HTML object (article template), which was saved as EO_PE_ARTICLETEMPLATE, and binds into it the bind values. These values must occur in the order in which they were specified in the HTML object. The variable &HTMLCategoryImage is listed fourth because it is the fourth bind variable.

    Example:

    &HTMLText = GetHTMLText(HTML.EO_PE_ARTICLETEMPLATE, &HTMLHeader, &HTMLNav1, IScript_GetImageFileSpec("PWSA19OE 85C"), &HTMLNav2, &HTMLCategoryImage, &HTMLTitle, &HTMLNav3, &HTMLBody, &HTMLFooter);

  9. Register Article Template within the portal.

  10. Repeat the process and bind additional cells within the HTML object (article template).

    For each bind value, you can add a function, another HTML object, or static text/images. Continue until all the cells of the HTML object have values. When you finish, the page should look like the PeopleTalk page shown in the previous illustration.

See Also

Enterprise PeopleTools 8.50 PeopleBook: PeopleSoft Application Designer, “Creating HTML Definitions.”