webCOMAND

cTemplate Global Variables

When cTemplates are processed, a number of global variables are set to provide convenient access to system and publication information.

System Variables

The following global variables are always available when processing cTemplate.

  • $SystemDate - Date from the server's system clock at the time cTemplate processing started.
  • $SystemYear - The Year part of the $SystemDate
  • $SystemMonth - The Month part of the $SystemDate, without a leading zero.
  • $SystemDay - The Day part of the $SystemDate, without a leading zero.
  • $SystemTime - Time from the server's system clock at the time publication began
  • $SystemTimestamp - Timestamp from the server's system clock at the time publication began.
  • $SystemTitle - Title of the system.  This is typically "webCOMAND", but may be customized.
  • $SystemVersion - COMAND software version (useful for version-specific #IF() conditions)

Publication Variables

When a cTemplate is processed in the context of a publication, such as during a publish or preview, publication-specific variables are available.

  • $Publication - The Publication object, with the additional field:
    • FullPublishPath - Corresponds to the Publication Publish Path, but it is fully qualified (full path from the root folder/URL).
  • $PublicationProcedure - The Publication Procedure Object, with the additional field:
    • ProcessedFilename - Corresponds to the resolved Filename, after cTemplate has been processed.
  • $PublicationObject - If the Publication Procedure has a List, this variable will be set to the object within the list.  Otherwise it will be NULL.

webCOMAND 2 Backward-Compatibility

The following predefined variables are also available for backward compatibility with webCOMAND 2.

  • $DistributionName - Corresponds to the Publication Content Type Title or Identifier if no Title is specified.  Should now use ${Publication.Type.Title}.
  • $VersionName - Corresponds to the Publication Title.  Should now use ${Publication.Title}.
  • $VersionFileURL - Corresponds to the Publication URL.  Should now use ${Publication.URL}.
  • $VersionFilePath - Corresponds to the Publication Publish Path, but it is fully qualified (full path from the root folder/URL).  Should now use ${Publication.FullPublishPath}.
  • $PageFilePath - Filesystem folder path relative to the Publication Destination.  Should now use ${PublicationProcedure.ProcessedFilename}.
  • $PageFileName - Filesystem file name, which comes after the PageFilePath.

Publication Field Variables

In addition to the predefined variables, a global variable that corresponds to each Publication field Identifier and value will be defined.  For this reason, it is a common practice to create a custom Content Type that extends Publication to define and populate new global variables for specific Publications.