You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

how to create sub template in xmlp

3 replies [Last post]
Guest's picture
Guest

Hi,

How can we create a sub template and call in main template. please give me an example on sub templates.

Thanks in advance.

Guest's picture
Guest (not verified)
Re: how to create sub template in xmlp

You have to create sub templates in a similar way, after that register the sub template in sub template liabrary.

Coming to the usage of sub templates, you have to include the subtemplate at the top and then use it wherever you want in the main template.
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?>

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.

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 subtemplate
file.

nagarjun.2389's picture
User offline. Last seen 1 year 11 weeks ago. Offline
Joined: 08/05/2010
Posts: 4
Re: how to create sub template in xmlp

HI,

can u please explain me this sentence "Coming to the usage of sub templates, you have to include the subtemplate at the top and then use it wherever you want in the main template."

and other doubt is that what changes we should to the XML doc(generated during the data source) while working with sub-template.

thanks in advance

Guest's picture
Guest (not verified)
Re: how to create sub template in xmlp

using the sub template means calling sub template after imporitng it at the top (please note we have to register/upload the template in content liabrary).

In XML data source you w'd have to include the extra fields mappings if form fileds are there in your subtemplate also. But usually we have static/fixed data in sub templates.

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.