Custom template methods can be added to the FreeMarker language
for use on template pages. The default model provides the following
methods:
- cropContentcropContent(content, length) returns the first N characters of a content stream from the specified node.
- dateComparedateCompare methods that return a value based on how two dates compare, with an optional milliseconds offset.
- hasAspecthasAspect(node, aspect) returns whether a TemplateNode has a particular aspect applied to it. The aspect name can be either the fully qualified QName or the short prefixed name string.
- hasPermissionhasPermission(node, permission) returns whether a TemplateNode has the specified permission applied to it.
- incrementDateincrementDate(date, increment) returns a date incremented by the specified amount.
- messagemessage(id) returns an I18N message resolved for the current locale and specified message ID.
- shortQNameshortQName(longQName) returns the shortQName equivalent of the specified longQName.
- xmldatexmldate these methods return a converted date. The date can be specified either as a Date object or an ISO6801 string.
Parent topic: SkyVault Repository FreeMarker Template reference