DynamicTemplate

DynamicTemplate (string  template name, object  object)

or

DynamicTemplate (string  template name, string  text)

Returns a string containing the requested text, based on the object or string passed in.

You can pass in multiple objects. If you only pass in one, you can refer to it using the variable “object”. Otherwise you can use “object1”, “object2” etc.

See Using Templates

Example: We want to provide a templated message about a blocked exit.

First the dynamic template is defined as:

<dynamictemplate name="BlockedExit">"Your exit "+object.alias+" is blocked"</dynamictemplate>

Now we could add a message expesssion to the script in an exit, something like:

msg (DynamicTemplate("BlockedExit",this))

NOTE: As the script is defined in the script attribute of the exit, we use the “this” keyword to reference the current exit object

NOTE: This a hard-coded function.