Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | DSPs and building output templates | Using Output Templates to Format Service Output | %include%
 
%include%
You use the %include% tag to reference a text file. When you %include% a text file, the server inserts the contents of the specified file (processing any tags it contains) at run time. If you use template and/or DSPs extensively, you may want to build a library of standard “code fragments” that you reference using %include% tags as needed.
Syntax
%include FileName%
Arguments
FileName specifies the name of the text file that you want to insert. If the text file is not in the same directory as the template or DSP that references it, FileName must specify its path relative to the template or DSP file.
Effect on Scope
None. If the inserted file contains tags, they inherit the scope that is in effect at the point where the %include% tag appears.
Examples
The following example inserts a file called “TMPL_ShipToBlock.html” into the code. Because path information is not provided, the server expects to find this file in the same directory as the file containing the template or DSP.
.
.
.
%scope buyerInfo%
<p>Shipped To:<br>
%include TMPL_ShipToBlock.html%</p>
%end%
.
.
.
The following example inserts a file called “TMPL_ShipToBlock.html” into the code. At run time, the server expects to find this file in a subdirectory called “StandardDSPs” in the directory where the template or DSP resides.
.
.
.
%scope buyerInfo%
<p>Shipped To:<br>
%include StandardDSPs/TMPL_ShipToBlock.html%</p>
%end%
.
.
.
The following example inserts a file called “TMPL_ShipToBlock.html” into the code. At run time, the server expects to find this file in the template or DSPs parent directory.
.
.
.
%scope buyerInfo%
<p>Shipped To:<br>
%include ../TMPL_ShipToBlock.html%</p>
%end%
.
.
.