0% found this document useful (0 votes)
145 views

DotCMS Cheat Sheet

This document contains a list of common macros, Velocity tags, viewtool methods, file/image field values, global variables, Velocity tools, container variables, Lucene syntax, category object fields, and other content map fields that are commonly used in dotCMS templates and code. It also includes brief descriptions and examples of how to use some of these items.

Uploaded by

christhefruit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views

DotCMS Cheat Sheet

This document contains a list of common macros, Velocity tags, viewtool methods, file/image field values, global variables, Velocity tools, container variables, Lucene syntax, category object fields, and other content map fields that are commonly used in dotCMS templates and code. It also includes brief descriptions and examples of how to use some of these items.

Uploaded by

christhefruit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Common Macros

#comment($inode)
#crumbtrail()
#decrypt($encryptedStr) $decryptedStr
#dotParse($path)
#editContentlet($inode)
#encrypt($string) $encryptedStr
#fileRepository($path)
#getContent($id) $content
#mpPlayer($song!r"#$%R$)
#na&igation($start$e&el $le&els'oSho()
#pageContent($)uery $sort*y
$numPerPage numCurrentPage) $list
#permalin+($id)
#photo,allery($path)
#pullRSS-eed($path) $list
#pullContent($)uery $limit $sort*y) $list
#pullRelatedContent($relationship.ame
$inode $limit $sort*y) $list
#submitContent($structure.ame)
#tagCloud($structure $url $ma/.um)
#title0mage($string)
#&ideoPlayer($url)
Servlets
1resi2e3image45path or id67amp855h 71or (6 or
5ma/h and ma/(66
1thumbnail45path or id67amp85h 71or (67amp85r
7 g 7 b6
1dotC#S1do(nload9Calendar4id:5id6
Useful Viewtool Methods
$categories;getCategory*y0node($inode)
$date;format($date< $pattern)
$date&ie(api;friendly($date)
$list;si2e()
$re)uest;get=eader(>http=eaderParameter>)
$re)uest;getParameter(>uriParameter>)
$response;sendRedirect($urlString)
$session;get?ttribute(>+ey>)
$session;set?ttribute(>+ey>< >&alue>)
$%til#ethods;encode%R$($urlString)
$%til#ethods;isSet($&ar)
$%til#ethods;prettyShortenString($string< len)
$%til#ethods;random(min9al< ma/9al)
Template
#parseContainer( inode )
Velocity
## single line comment
#@ multi line comment @#
A# escaped hash
#set($&ar : &alue)
#foreach($item in $list)B #end
#foreach($&alue in 5C;;D6)B #end
#if($condition);;; #elseif($conditionE);;; #end
#macro(name $&arF $&arE $&ar.);;; #end
#parse($ser&er-ilePath)
$&elocityCount foreach loop counter
Extra File/Imae Field Values
-ileG/tension 0mageG/tension
-ile-riendly.ame 0mage-riendly.ame
-ile0dentifier 0mage0dentifier
-ile0node 0mage0node
-ile.ame 0mage.ame
-ilePath 0magePath
-ile'itle 0mage'itle
-ile%R0 0mage%R0
0mage=eight
0mageHidth
!lo"al #ae Varia"les
$GI0'3#!IG
$friendly.ame
$='#$P?,G3-R0G.I$J3.?#G
$='#$P?,G30.!IG
$='#$P?,G3#G'?
$='#$P?,G3RGI0RGC'
$='#$P?,G3SGC%RG
$='#$P?,G3'0'$G
$='#$3P?,G3$?S'3#!I3I?'G
$pageChannel
$page'itle
$'G#P$?'G30.!IG
$9'$SGR9$G'3%R0
Common Velocity Tools
Iate'ool K $date
Gscape'ool K $esc
$ist'ool K $list
#ath'ool K $math
Render'ool K $render
Sort'ool K $sort
Container Varia"les
$?II3C!.'G.'3PGR#0SS0!.
$container0node
$C!.'?0.GR30IG.'0-0GR30.!IG
$C!.'?0.GR30.!IG
$C!.'?0.GR3#?"3C!.'G.'$G'S
$C!.'?0.GR3.?#G
$C!.'?0.GR3.!'GS
$C!.'?0.GR3.%#3C!.'G.'$G'S
$C!.'?0.GR3S'R%C'%RG3.?#G
$C!.'G.'$G'S
$C!.'G.'S3PGR3P?,G
$C%RRG.'3P?,G
$GI0'3C!.'G.'3PGR#0SS0!.
$$%CG.G3L%GRJ
$SGR9GR3.?#G
$S!R'3P?,G
$S'?'0C3C!.'?0.GR
$ucene Syntax
M K re)uired
K K e/clude
4 K (ildcard (single character)
@ K (ildcard (F or more)
(note: wildcards can't be the first character)
M(colFN" colENJ colNO) K F or more re)uired
)uery'ermP K fu22y search
)uery'ermPC;Q K fu22y search (1 similarity
termF termEPFC K pro/imity search
fieldN5&alF '! &alE6 K range search
Cateory %"&ect Field Values
;Category.ame
;getRey()
%ther Content Map Fields
;contentletCategories
;contentletCategoriesReys
;contentletCategories.ames
;content$ast#odIate
;content$ast#od%ser0d
;detailPage%R0
;identifier
;inode
;structure0node
'())* Michael Fienen
michael+doraduswe",com
Sheet v-,) . dotCMS v-,/a

You might also like