Template Engine > Connecting templates to Template Engine > Template Engine Process > Referencing a template

Referencing a template
You can reference a template in the Template Engine Process in three different ways:
Using a text template resource
If you have created the template as a Text template resource or other type of plain text resource, you can link this template to the Template Engine Process tool.Click to enlarge
Figure 1
When you use a text template resource to reference a template, the template is read once by Template Engine when you start the StreamServer application. If you want to modify the template, you must edit the template resource, export the Design Center Project, deploy and restart the StreamServer application.
Using a static file or http reference
If the template is stored on a file system, web server or in a Content Management System (CMS), you can use a static file or http reference to the template.Click to enlarge
Figure 2
When you use a static file or http reference to a template, the template is read once by Template Engine when you start the StreamServer application. If you want to modify the template, you must edit the template file and restart the StreamServer application.
Using a dynamic file or http reference
You can use a dynamic reference to one or more templates stored on a file system, web server or in a CMS.Click to enlarge
Figure 3
To be able to use this type of reference you must first create a StreamServe script variable that evaluates to a file or http reference, and then use this variable as reference in the Template Engine Process tool.
Example 1
$template=”C:\templates\invoice.txt”;
 
Example 2
switch ($countryCode)
{
    case "USA":
        $template = "C:\templates\invoiceUSA.txt";
    break;
    case "Canada":
        $template = "C:\templates\invoiceCanada.txt";
    break;
    case "UK":
        $template = "C:\templates\invoiceUK.txt";
    break;
    default:
        $template = "C:\templates\invoiceUK.txt"
}
 
When you use a dynamic file or http reference to a template, the template is read by Template Engine during runtime. If you want to modify a template, you only have to edit the template file and do not need to restart the StreamServer application.
OpenText StreamServe 5.6 Updated: 2013-03-01