webCOMAND

#INSERT

#INSERT processes and outputs a template in the context of an object that matches the specified content type and unique value. If a Content Type contains more than one object with the same unique value, the object closest to the Publication Content Folder will be used.

Prototype

#INSERT($content_type, $unique_identifier, $template = 'default', ...)

Parameters

  • content_type - The content type of the object to insert.
  • unique_identifier - A value or field=value pair to uniquely identify the content object to insert. If a single value is provided, it will be matched against the first Unique/Key field of the content type (or the OID if no Unique/Key field exists). If a field=value pair is given, the specified Unique/Key field of the content type will be matched to the specified value.
  • template - Optional identifier associated with a template of the specified content type. If this parameter is not specified, the "default" template will be used. It is common to leave this parameter empty to use the default template, even if there are following parameters.  If no Template is specified or named default, the first template defined will be used.
  • ... - Optional list of additional parameters that are passed to the specified template as variables ($A for the first, $B for the second, $C for the third, and so on).  Each parameter will be evaluated as cTemplate and the result passed in as a string.  It will not be evaluated as an expression, even without quotes.  Wrap the parameter in #CALC or similar to evaluate as an expression.

Example

Process and output the Image Content Type's HTML template in the context of the Logo Image, and pass 'Alternate Text' in to the HTML template as $A.

#INSERT(Image, Logo, HTML, 'Alternate Text')

Related

#INCLUDE is similar to #INSERT, except that it inserts content from the file system or a URL.