webCOMAND

Rich Text cTemplate Codes

Text entered into a Rich Text Editor may be processed to recognize and resolve cTemplate Codes when published, or as part of other processes.  cTemplate Codes are special instructions that can appear inline within plain or formatted text.

Example

This page was last published on #FORMAT($SystemDate,"%B %e, %Y").

cTemplate Codes always start with a # or $, as can be seen in the example above.

  • cTemplate Directives like #FORMAT start with # followed by a letter
  • cTemplate Variables like $SystemDate start with a $ followed by a letter.

cTemplate Codes that will be recognized and resolved depend on how the rich text field and publish process are set up.

Potential Issues

In most cases, content creators and editors do not need to be aware of or work with cTemplate Codes.  However, in some cases text may be entered that includes a # or $ immediately before a letter.  When that happens, the text will be misinterpreted as a cTemplate Code.

For example, if $dollar appears in text, it may result in a publish error like "undefined variable $dollar" because $dollar is recognized as a cTemplate Code, but a corresponding variable is not defined at publish time.

Resolution

When text contains a # or $ followed by a letter, which should not be recognized and resolved as a cTemplate Code, two # or $ should be used instead.  For example, $$dollar will be processed and publish as $dollar, without producing a publish error.