Template Engine language reference > Composition Center interface

Composition Center interface
Sections and resources in a document definition published in Composition Center are accessed by $docdef references in the Template Engine template.
References to sections in a document definition
If you, in your Template Engine template, want to access a section in a document definition you must specify the name of the section. Use the following syntax:
$docdef.<sectionName>
For example, $docdef.Section1
References to resources in a document definition
If you, in your Template Engine template, want to access a resource (text or image) in a document definition you must specify the name of the section that contains the resource as well as the name of the resource itself. Use the following syntax:
$docdef.<sectionName>.<resourceName>
For example, $docdef.Section1.Text1
Base64 encoding image resources
Images can be embedded in HTML output as base64 encoded data. To base64 encode images in a Template Engine template you must use the toBase64() function. For example:
$docdef.Section1.Image1.toBase64()
See toBase64() for more information.
Attaching text and image resources to emails
If the output is intended for email delivery, you can let Template Engine generate attachments for text and image resources in a document definition. To attach a resource to an email you must use the toAttachment() function. For example:
$docdef.Section1.Image1.toAttachment()
This allows you to, for example, reference attached images and have them displayed in the email body, instead of base64 encoding and embedding the images.
See toAttachment() for more information. See also $attachments.addAttachment for information about how to attach a file, referenced by a URI, to an email.
References are case sensitive
Docdef references are case sensitive. For example, $docdef.MySection and $docdef.mysection are not references to the same section. If the document definition contains the section MySection, and you use $docdef.mysection to reference this section, an error is generated.
References to object names that contain white space
If a document definition has section names and resource names that contain white space you must use {object name} to reference the section/resource. For example, if a document definition contains the text resource Welcome Text in the section Greetings you must use $docdef.Greetings.{Welcome Text} to reference the text resource.
Template Engine and Ad Hoc Correspondence
Document definitions based on Template Engine Processes can be used in Ad Hoc Correspondence. The purpose is to generate documents with dynamic areas that can be edited by an Ad Hoc Correspondence user. The Ad Hoc Correspondence user can change the content of dynamic areas as follows:
All these changes are done without changing the actual Template Engine template. To make this work, the Template Engine template must be written in a generic way. See Enabling dynamic areas in Ad Hoc Correspondence.
In this section
OpenText StreamServe 5.6.2 Updated: 2018-01-26