Velocity Templates

CMS Fiona uses Velocity templates (file name extension .vm) to display the views of the Content Navigator. Velocity is an interpreter that can be used in servlet environments to output content by means of templates (see http://velocity.apache.org/). Administrators can write and adapt templates to have their own sets of CMS file fields displayed, and to change the appearance of these sets.

Along with the templates for displaying the details, the GUI always loads the template macros.vm. You can put your own macros into this file. However, when migrating to a new Fiona version, this file is not automatically copied to the new location. Therefore, it is safer to maintain macros in the contentInspectors.xml file located in the config directory of the instance concerned. An example:

<contentInspectors>
  ...
  <templates>
    <template name="macros.vm">
      <![CDATA[
        ## my macros
      ]]>
    </template>
  </templates>
  ...
</contentInspectors>

By means of the keywords below you can determine values from various contexts. Keywords that refer to the CMS entities file, version, link, field und field group can also be queried via Tcl and are explained in the Tcl reference.

Keywords in the context of the current CMS file

Keyword Type Meaning
content ContentTool Returns editedContent or releasedContent, depending on the user's preference and the availability of these versions
editedContent ContentTool The draft version of the file if it exists
icons String Scheme-based determination of icon URLs. Example:
<img src="$icons.get("image.png")"/>
lang String The language identifier of the user: "de", "en", …. Use an if-clause to localize your own strings: #if ($lang == "de") Hallo #elseif ($lang == "en") Hello #else Hi #end
localizer String Used internally to determine strings localized in the user's language
object ObjectTool The file currently to be displayed
releasedContent ContentTool The released version of the file, if it exists
role String The user interface assigned to or selected by the user. Query this key to hide or display fields depending on the user interface.

Keywords in the ObjectTool ($object.key)

Keyword Type Meaning
hasMirrors AttributeTool
id AttributeTool
isDeactivated AttributeTool
isMirror AttributeTool
mirrors LinkListTool
name AttributeTool
original AttributeTool For mirror files the path of the original file
path AttributeTool
reminder AttributeTool Reminder
type AttributeTool
visiblePath AttributeTool
objClass AttributeTool
isExportSuppressed AttributeTool
isExportable AttributeTool
isEdited AttributeTool
isReleased AttributeTool
editedContent ContentTool
releasedContent ContentTool
content ContentTool Version displayed according to the current display mode
workflow AttributeTool
version AttributeTool
superlinks LinkListTool
state AttributeTool State of the file depending on its existing versions (released edited committed)
hasPermissionRead AttributeTool
hasPermissionWrite AttributeTool
hasPermissionRoot AttributeTool
hasPermissionCreateChildren AttributeTool
permissionRead AttributeTool Outputs group names
permissionCreateChildren AttributeTool Outputs group names
permissionLiveServerRead AttributeTool Outputs group names
permissionRoot AttributeTool Outputs group names
permissionWrite AttributeTool Outputs group names

Keywords in the ContentTool

Keyword Type Meaning
title AttributeTool
contentType AttributeTool
validFrom AttributeTool
validUntil AttributeTool
lastModified AttributeTool
lastChanged AttributeTool Synonym for lastModified
thumbnail AttributeTool img-Link to the thumbnail
preview AttributeTool Inline preview for images, otherwise a-href link to the preview page
getAttributeGroup(name) AttributeGroupTool
attributeGroups List of AttributeGroupTool
sourceCode AttributeTool Source view
blobLength AttributeTool
width AttributeTool
height AttributeTool
bodyTemplateName AttributeTool
mimeType AttributeTool
isComplete AttributeTool
reasonsForIncompleteState AttributeTool
channels AttributeTool
textLinks LinkListTool Links in the main content
body AttributeTool The main content
blob AttributeTool Synonym for main content
sortOrder SortOrderTool
Names of custom version fields AttributeTool

Keywords in the AttributeGroupTool

Keyword Type Meaning
editButton String HTML code for edit button
editMarkupOpen String Opening HTML code for edit marker
editMarkupClose String Closing HTML code for edit marker
title String Localized title of the field group
name String Name of the field group
identifier String Identifier of the field group
isDefaultGroup boolean
isEmpty boolean
attributes List of AttributeTools

Keywords in the SortOrderTool

Keyword Type Meaning
editButton String HTML code for edit button
editMarkupOpen String Opening HTML code for edit marker
editMarkupClose String Closing HTML code for edit marker
label String Localized label Sorting
getLabel(i) String Sort criterion with the index 1 ≤ i ≤ 3
getType(i) AttributeTool The type of the sort criterion with the index 1 ≤ i ≤ 3
getKey(i) AttributeTool The sort kriterion field with the index 1 ≤ i ≤ 3
getKeyLength(i) AttributeTool The length of the sort criterion field with the index 1 ≤ i ≤ 3
direction(i) AttributeTool Sort direction ascending or descending

Keywords in the AttributeTool

Keyword Type Meaning
editButton String HTML code for edit button
editMarkupOpen String Opening HTML code for edit marker
editMarkupClose String Closing HTML code for edit marker
displayValue String Formatted display value
helpText String Help text of the field (from version 6.10)
label String Localized label
placeholderForEmpty String The value which is output instead of the empty value
type String date, enum, multienum, html, generic, image, linklist, signature, string, text, boolean, integer, href
isMandatory boolean 1 for obligatory fields, otherwise 0

Keywords in the LinkListTool

Keyword Type Meaning
editMarkupOpen String Opening HTML code for edit marker
editMarkupClose String Closing HTML code for edit marker
editButton String HTML code for edit button
label String Localized label
isEmptyAndEditingAllowed boolean true, if the link list is empty and can be edited (this is not true for textlinks and superlinks)
placeholderForEmpty String The value displayed instead of the empty value
type String Always returns linklist
isMandatory boolean 1 for obligatory fields, otherwise 0
links List of LinkTool The links in the link list

Keywords in the LinkTool

Keyword Type Meaning
iconMarkup String HTML code that includes an icon
isComplete boolean Specifies whether the links is complete
displayUri String The URI of the link, quoted as HTML text
title String The title of the link, can be zero
followLinkMarkup String HTML code for a link navigating to the link target when followed, can be zero
sourceObject ObjectTool Source of the link
targetObject ObjectTool Destination of the link