Incorporating Sub-Templates

When designing a template, you can incorporate one or more sub-templates into your primary template.

You must use specific syntax to:

  • Create sub-templates.

  • Import sub-templates.

  • Call sub-templates.

See Maintaining Sub-Templates.

Creating Sub-Templates

Within a single sub-template file, multiple sub-template components can be available. Start and end template indicators must exist to distinguish these various components.

<?template:component_name?>
<?end template?>

For example, syntax of a sub-template file containing two components could be:

<?template:peoplesoft?>
Pleasanton Campus
500 Oracle Lane
Pleasanton, CA  94488 
<?end template?>

<?template:logo2x.5?>
 Oracle_Logo
<?end template?>

where <?template:peoplesoft?> is the start template indicator of the component peoplesoft and<?template:logo2x.5?> is the start template indicator of the component logo2x.5. Each<?end template?> tag indicates the end of its respective component.

Importing Sub-Templates

To import a sub-template file that is stored in the Content Library, place the following syntax at the top of the primary template file:

<?import:psxmlp://sub-template_NAME?>

where sub-template_NAME is the registered sub-template ID in the Content Library.

For example:

<?import:psxmlp://STDHEADER?>

This syntax must be in Normal text.

Note:

The sub-template reference is defined only in the RTF template. The sub-template must be defined in Content Library; however, the relationship to templates using the sub-template is not defined in the database. Developers must be aware of the sub-template relationships when modifying the RTF sub-template.

See Maintaining Sub-Templates.

Calling Sub-Templates

Place the following syntax in the primary template file in the location where the desired text or XSL instructions from the sub-template file should appear:

<?call-template:peoplesoft?>

In the preceding sample code peoplesoft is the name of the component that you want to use in the sub-template file.

Note:

Primary templates calling nonexistent or inactive sub-templates cause an error message to be issued indicating the reason for the problem. This error information is incorporated into Process Scheduler error handling as well as into online viewing or previewing of the report.

See Running BI Publisher PeopleSoft Query Reports.

Testing a Sub-Template in Microsoft Word

You should test your template and sub-template using Template Builder before uploading to PeopleTools to make your sub-template is accessible to your template on the file system.

Use the following syntax when importing:

<?import:file:C:///Template_Directory/subtemplate_file.rtf?>

Notice the triple slashes and the use of the actual file name instead of template ID.

When your design is complete, you can change the import statement back to make the sub-template available to the main template in PeopleTools environment:

Note:

In order to successfully import the sub-template file in Word, select BI Publisher menu, Options, Preview tab, and open the Properties table. Search for and set the property xdk-secure-io-mode to False. This property is set to True by default, as a security precaution.