There are a number of variables which are available to you from containers, templates, or contentlets.
Velocity Variables
The following lists are grouped by scope.
Usable anywhere in dotCMS
$EDIT_MODE | $HTMLPAGE_SECURE |
$host | $HTMLPAGE_REDIRECT |
$HTML_PAGE_LAST_MOD_DATE | $HTMLPAGE_TITLE |
$HTMLPAGE_INODE | $quote |
$HTMLPAGE_FRIENDLY_NAME | $TEMPLATE_INODE |
$HTMLPAGE_META | $VTLSERVLET_URI |
Usable from a container
$ADD_CONTENT_PERMISSION | $containerInode |
$CONTAINER_IDENTIFIER_INODE | $CONTENTLETS |
$CONTAINER_INODE | $EDIT_CONTAINER_PERMISSION |
$CONTAINER_MAX_CONTENTLETS | $SERVER_NAME |
$CONTAINER_NUM_CONTENTLETS | $SORT_PAGE |
$CONTAINER_NAME | $STATIC_CONTAINER |
$CONTAINER_STRUCTURE_NAME |
Content properties
$content.identifier | $content.permission |
$content.inode | $content.title |
$content.modDate | $content.titleImage |
Other Reserved Words or 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.
If dotCMS detects an attempt to assign one of these values to the variable of a content field, it will automatically append an incrementing number to the result. For example, if the user attempts to assign a field the variable host
, the result will be host1
. For more information on how the variable names of fields are generated, see the Field Properties documentation.
While past versions have regarded these case sensitively, current practice is to evaluate them case insensitively when validating new variables.
archived | baseType | class |
conFolder | conHost | contentType |
deleted | disabledWYSIWYG | file |
form | host | identifier |
inode | languageId | live |
locked | modDate | modUser |
number | owner | ownerCanPublish |
ownerCanRead | ownerCanWrite | permissions |
string | stInode | type |
website | working |
Additionally, the following words 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:
if | else | end |
foreach | parse |