Documentation for the worlds leading Java Based Open Source Web Content Management System

dotCMS

Built-in Velocity Variables & Reserved Words

There are a number of variables which are available to you from Containers, Templates, or Contentlets.

From anywhere in the dotCMS you can use the following Velocity variables.

 $quote
 $HTMLPAGE_INODE
 $HTMLPAGE_TITLE
 $HTMLPAGE_FRIENDLY_NAME
 $TEMPLATE_INODE
 $HTMLPAGE_META
 $HTMLPAGE_META
 $HTMLPAGE_SECURE
 $VTLSERVLET_URI
 $HTMLPAGE_REDIRECT
 $pageTitle
 $pageChannel
 $friendlyName
 $HTML_PAGE_LAST_MOD_DATE
 $EDIT_MODE

From a Container

 $SERVER_NAME
 $CONTAINER_IDENTIFIER_INODE
 $CONTAINER_INODE
 $CONTAINER_MAX_CONTENTLETS
 $CONTAINER_STRUCTURE_NAME
 $STATIC_CONTAINER
 $SORT_PAGE
 $containerInode
 $EDIT_CONTAINER_PERMISSION
 $ADD_CONTENT_PERMISSION
 $CONTENTLETS
 $CONTAINER_NUM_CONTENTLETS
 $CONTAINER_NAME
 $CONTAINER_STRUCTURE_NAME

If the Container has notes

  $CONTAINER_NOTES

If the container is dynamic

  $CONTENTS_PER_PAGE
  $CONTENTS_PER_PAGE
  $CURRENT_PAGE
  $CURRENT_PAGE
  $LUCENE_QUERY

The following properties are available on Content

  $content.permission
  $content.inode
  $content.identifier
  $content.contentTitle
  $content.contentLastModDate

For examples on how to use Velocity in the dotCMS and for some helpful tips see the Examples, Tips, and Tricks documentation.

Reserved Words/Variable names:

The following reserved words should not be used for velocity variable names, form fields, or dotCMS object names. They are reserved words that are in use by dotCMS methods.

class
conFolder
conHost
deleted
file
form
identifier
inode
languageId
ownerCanPublish
modUser
live
locked
modDate
modUser
owner
ownerCanPublish
ownerCanRead
ownerCanWrite
permissions
structureInode
type
website
working
if, else, end, foreach, parse, ... may not be used as anchor names because they are velocity commands that are preceded by a hash(#) in the same way as wysiwyg anchors
2

Subscribe to dotcms

Visit this group