If you’re looking for detailed description on how meta attributes are used head over to using meta attributes.
1 Baseobjects
1.1 Page
Property name |
Description |
id |
id of the actual page |
url |
address of the actual page |
template |
template of the actual page |
name |
name of the actual page |
filename |
filename of the actual page |
description |
description of the actual page |
priority |
priority of the actual page |
tags |
tags of the actual page |
publishtimestamp |
UNIX timestamp of the last time a user clicked “publish” |
publishdate |
date of the last time a user clicked “publish” |
creationtimestamp |
UNIX timestamp of the creationdate (taken from customCdate, if set, or the cdate) |
creationdate |
date of the page creation (taken from customCdate, if set, or the cdate) |
edittimestamp |
UNIX timestamp of last page update (taken from customEdate, if set, or the edate) |
editdate |
date of last page update (taken from customEdate, if set, or the edate) |
folder |
reference to pages folder |
creator |
reference to pages creator |
editor |
reference to last editor of the page |
publisher |
reference to the last publisher of the page |
language |
reference to the language of the page |
languageset.id |
id of the pages languageset. A languageset is a collection that groups pages of the same contents but with different translations together. So an English version and a German version of a page have the same languageset.id |
languageset.pages |
reference to other language layouts of the page |
online |
true, in case page is online, else false |
ispage |
returns true |
versions |
version history of the page (see ‘version’ attribute) |
version |
last version of the page |
version.number |
version (e.g. 3.0) |
version.date |
creationdate of the page |
version.editor |
editor of the version |
version.major |
true, if its major version |
object |
object properties of the page |
pagevariants |
returns all page layouts (independent of the page status |
ismaster |
true, if its a master page, false if the page is a localized copy |
inherited |
true, if the page is inherited from a master node, false if not |
1.2 Template
Property name |
Description |
id |
id of the template |
name |
name of the template |
tags |
list of all available tags of the template |
ml |
markup language of the template (e.g. php3, php4, etc.) |
1.3 Folder
Property name |
Description |
id |
id of the folder |
name |
name of the folder |
description |
description of the folder |
node |
reference to the folders node |
parent |
reference to parent folder or NULL on top level |
path |
publish path of the folder |
creator |
the folders creator |
editor |
the last user who edited the folder |
creationtimestamp |
see file.createtimestamp |
creationdate |
see file.createdate |
edittimestamp |
see file.edittimestamp |
editdate |
see file.editdate |
folders |
list of all subfolders or NULL |
pages |
list of pages in this folder or NULL |
files |
list of files of files in this folder or NULL |
images |
list of images in this folder or NULL |
filesandimages |
list of all files and images in this folder or NULL |
children |
list of all subfolders, images and files or NULL |
isfolder |
true |
folders |
list of all subfolders or NULL |
object |
prefix to access object properties of this folder |
ismaster |
true, if its a master folder, false if the folder is a localized copy |
inherited |
true, if the folder is inherited from a master node, false if not |
1.4 File
Property name |
Description |
id |
id of this file |
name |
filename |
description |
description of the file |
size |
size in bytes (int). same as sizeb |
sizeb |
size in bytes (int) |
sizekb |
size in kb (double) |
sizemb |
size in mb (double) |
folder |
reference to the files folder |
extension |
file extension (eg. “jpg”) |
creator |
the user who created the file |
editor |
last user who edited the file |
createtimestamp |
UNIX timestamp of creation time |
createdate |
creation date |
edittimestamp |
UNIX timestamp of last edit |
editdate |
last editdate |
type |
MIME-type of the file |
url |
link to file |
width* |
image width (int) |
height* |
image height (int) |
dpix* |
horizontal dpi resolution (int) |
dpiy* |
vertical dpi resolution (int) |
dpi* |
dpi resolution (int) |
fpx* |
Focal Point position, relative to the width (float, between 0. and 1.) |
fpy* |
Focal Point position, relative to the height (float, between 0. and 1.) |
isfile |
true, in case its a file, false (e.g. file is an image). The system will check the MIME-type of the file. If it starts with “image” isfile will return false. |
isimage |
analog to isfile only for images. If the MIME-type of the file starts with “image” isimage will return true. |
object |
object properties of the file |
ismaster |
true, if its a master file, false if the file is a localized copy |
inherited |
true, if the file is inherited from a master node, false if not |
* these properties are only available for images
1.5 Node
Property name |
Description |
id |
id of the node |
https |
Whether https is enabled (true) for the node or not (false) |
host |
hostname of the node |
folder |
the nodes root folder |
path |
path of the node (alias for pub_dir) |
pub_dir |
Publish directory for pages |
pub_dir_bin |
Publish directory for binary files and images |
master |
The master node of the current node, if it is a channel or null if the current node is not a channel |
utf8 |
True if utf8 encoding is enabled, false otherwise |
alohaeditor |
True if Aloha Editor is enabled for editing, false otherwise |
languages |
list of references of languages of the node |
1.6 Tag
Property name |
Description |
TAGNAME |
references to the tag |
tag |
references to the current tag |
id |
id of the tag |
name |
name of the tag |
parts |
list of parts of the tag |
parts.PARTNAME |
references a single part of a tag |
empty |
1 in case the tag does not render any output, 0 otherwise |
visible |
1 if the tag is active, else 0 |
istag (since Gentics CMS 5.1.3) |
will always return true for tags |
1.7 Rendermode
Property name |
Description |
publish |
true if the page is rendered during a publish process |
live |
true in case of using the Live Preview |
edit |
true in case of using the Edit Mode |
preview |
true in case of using the Preview Mode |
real |
true in case of using the Real Edit Mode |
frontend |
true when rendering in frontend mode. The return value is valid in edit mode only. |
backend |
true when rendering in backend mode. The return value is valid in edit mode only. |
1.8 Imps
The String Formatter Imp provides methods for escaping and other string manipulation:
Syntax |
Description |
$cms.imps.string.escapeHTML(string) |
Escape special characters (like ‘<’, ‘>’, ‘&’) with entities. |
$cms.imps.string.escapeJS(string) |
Escapes special javascript characters (like ‘\’, ‘’’, ‘"’) with \ to make them save for output in javascript strings. |
$cms.imps.string.stripML(string) |
Remove the embedded HTML tags from user input string to prevent potential problems (in fact it removes anything beginning with < and ending with > ). |
$cms.imps.string.trim(string, length) |
Trim the given string to be no longer than length characters. |
$cms.imps.string.regexp(string, pattern, replacement) |
Replace all occurances of the pattern with replacement. |
$cms.imps.string.testRegex(string, regex) |
Test whether the string matches the regex. |
$cms.imps.string.trimWords(string, length) |
Trim all words in string to be no longer than length . Longer words are trimmed using … as ellipsis. |
$cms.imps.string.trimWords(string, length, ellipsis) |
Trim all words in string to be no longer than length . Longer words are trimmed using ellipsis . |
$cms.imps.string.trimWords(string, length, ellipsis, template) |
Trim all words in string to be no longer than length . Longer words are replaced by template , where $trimmedword will be replaced by the trimmed word and $word with the original one. |
$cms.imps.string.encodeURL(string[, string]) |
URL – encode the specified string and return it. The encoding used to get the bytes for unsafe characters defaults to “utf-8” but may be given as second parameter (e.g. “iso-8859-1”). |
$cms.imps.string.implode(Array/Collection, seperator) |
Convert the given array or collection into a string separating the items with the given string separator. |
$cms.imps.string.implode(Array/Collection, separator, prefix, postfix) |
See above. In addition the items will be pre- and postfixed. |
$cms.imps.string.toUpper(string) |
Convert the given string to all uppercase. |
$cms.imps.string.md5(string) |
Compute the md5 hash of the given String. |
The DateFormatterImp allows you to format date strings and date objects.
Example: using the DateFormatterImp
// Format the date using the given pattern and the english locale
$cms.imps.date.format($date, "dd MMM yyyy HH:mm:ss", "en")
// Format the date using the given pattern. The local is deduced by inspecting the page language.
$cms.imps.date.format($date, "dd MMM yyyy HH:mm:ss")
// Create a date by using a timestamp
$cms.imps.date.fromTimestamp($timestamp)
// Parse a date string and create a date object
$cms.imps.date.parse("22 MAR 1984 12:30:00", "dd MMM yyyy HH:mm:ss", "EN")
// Calculate difference in years between dateA and dateB
$cms.imps.date.dateDiff($dateA, $dateB, "y")
// Example of using the imp with edittimestamps
$cms.imps.date.format($cms.imps.date.fromTimestamp($cms.page.edittimestamp), "MMMM dd, yyyy", "en")
1.8.3 Sort Imp
Sort the given collection (might also be an array or a map) by the given list of properties.
Syntax of the Sort Imp
$cms.imps.sorter.sort(Collection collection, String[] properties[, boolean caseSensitive][, String languageCode])
Sort the given collection (might also be an array or a map) by the given list of properties. The sortorder can be independently set for each property in the list. When sorting by only one property, one can also pass a single String instead of an array of Strings as value for the parameter properties.
collection |
Collection to be sorted. |
properties |
Array of sorted properties. The general syntax for a sorted property is [path.to.property][:asc][:desc] . If neither :asc nor :desc are given, the sorting is done ascending. |
caseSensitive |
Optional boolean flag to sort case sensitive (default is false ). |
languageCode |
Optional language code. Must be a lower-case, two-letter code as defined by ISO-639-1. |
1.8.4 Loader Imp
The Loader Imp can be used to retrieve content objects by id.
Syntax |
Description |
$cms.imps.loader.getObject(type, id) |
Load the object of type with id . type can be one of “page”, “folder”, “image”, “file”, “node” |
$cms.imps.loader.getPage(id) |
Load the page with id . |
$cms.imps.loader.getFolder(id) |
Load the folder with id . |
$cms.imps.loader.getImage(id) |
Load the image with id . |
$cms.imps.loader.getFile(id) |
Load the file with id . |
$cms.imps.loader.getNode(id) |
Load the node with id . |
1.8.5 URL Include Imp
The URLIncludeImp allows you to include contents from other URLs.
Example: using the URLIncludeImp
$cms.imps.url.include(url, cache, timeout, default)
url |
URL to be requested |
cache |
cache lifetime in secs, defaults to 300 secs (5 mins) |
timeout |
timeout for accessing the URL and getting the contents in ms, defaults to 2000 ms (2 secs) |
default |
default content to be returned, if the URL cannot be accessed (default: null, will result in an error if URL cannot be accessed) |
2 Childobjects
2.1 Language
Property name |
Description |
id |
id of current language |
code |
code of current language (e.g. “de”) |
name |
name of current language (e.g. “Deutsch”) |
2.2 Pagetag/Templatetag Parttype
Property name |
Description |
id |
id of the pagetag |
tag |
reference to the tag itself |
container |
page or template the tag is referencing to |
2.3 Markuplanguage
Property name |
Description |
id |
id of the markuplanguage |
extension |
fileextension for this markuplanguage |
name |
name of the markuplanguage |
contenttype |
MIME type of the content |
feature |
Optional feature, the markuplanguage is bound to |
excludeFromPublishing |
true if pages using templates with this markuplanguage are excluded from publishing |
2.4 User
Property name |
Description |
id |
id number of the user |
firstname |
the users first name |
lastname |
the users last name |
login |
login name of the user |
email |
mail address of the user |
active |
true, in case user is active now |
creator |
creator of the user |
creationdate |
date of the creation of the user |
creationtimestamp |
timestamp (time in seconds since 1.1.1970) of the creation of the user |
editor |
editor of the user |
editdate |
date where the user was edited last time |
edittimestamp |
timestamp (time in seconds since 1.1.1970) where the user was edited last time |
description |
description of the user |
3 Parttypes
3.1 Overview Parttype
3.1.1 Velocity Properties
Properties available when rendering an overview using velocity:
Property name |
Description |
items |
Collection, viewable objects of the overview |
listType |
Type of objects listed in the overview. One of PAGE, FOLDER, IMAGE, FILE, UNDEFINED |
selectType |
Object selection type. One of FOLDER, AUTO, MANUAL, UNDEFINED |
orderBy |
Ordered attribute. One of CDATE, EDATE, FILESIZE, ALPHABETICALLY, PDATE, PRIORITY, SELF, UNDEFINED |
orderDirection |
Order direction. One of ASC, DESC, UNDEFINED |
maxItems |
Maximum number of listed items |
recursive |
True to select items recursively (when selectType is either FOLDER or AUTO) |
Example: iterating an overview using velocity
#foreach($item in $cms.page.tags.overviewtag.overviewpart.items)
$item.key $item.value
#end
3.1.2 <node> Template Properties
These placeholders are available in overview templates (when the overview part is rendered directly, without the use of velocity):
Property name |
Description |
<node ds.nr> |
iteration counter |
<node ds.count> |
item count for this overview |
<node ds.container> |
container object of the overview (eg. a page) |
3.2 Datasource/Select (Single)/Select (Multiple) Parttype
3.2.1 Velocity Properties
Property name |
Description |
items |
Collection of all entries in the database |
selection |
Collection of all selected entries in the database |
nr |
id of the entry |
key |
entry name |
value |
value of the entry |
keys |
name of the dataset in the database |
values |
values of the database |
dsid |
internal id of the element |
Example: list items of a multiselect part
#foreach( $item in $cms.tag.parts.multiselect.items )
$item.key - $item.value
#end
3.2.2 <node> Template Properties
These placeholders are available in datasource templates (when the part is rendered directly, without the use of velocity).
Property name |
Description |
<ds value> |
the selected value |
<ds name> |
name of the selected value |
<ds nr> |
id of the selected value |
<ds dsid> |
internal id of the element |
3.3 Pageurl/Fileurl/Imageurl/Folderurl Parttype
Property name |
Description |
id |
id of the parttype |
internal |
true if an internal link, false otherwise. Only available for Pageurl Parttype. |
target |
reference to the target object |
size |
Get the formatted size (in KB or MB) of the target file. Only available for Fileurl or Imageurl Parttypes |
url |
url of the target, only available for internal links |
node |
node for which the target was selected, only available for internal links (may be empty) |
nodeId |
ID of the node for which the target was selected, may be 0 but never empty |
Example: Output of the id of the url parttype
Node-Style: <node page.tags.tlink1.href.id>
VTL-Style: $cms.page.tags.tlink1.href.id
3.4 Checkbox Parttype
Property name |
Description |
checked |
true, in case checkbox was checked, else false |
3.5 Text Parttypes
Property name |
Description |
text |
textual contents of the part |
3.6 Node Parttype
In addition to the properties exposed by nodes in general the parttype can resolve the name of the node directly.
Property name |
Description |
name |
The name of the node |