Documentation for the Freemarker functions provided by ccm-cms-types-contact, ccm-cms-types-event, ccm-cms-types-externallink and ccm-cms-types-filestorageitem
git-svn-id: https://svn.libreccm.org/ccm/trunk@6112 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
d0fad42274
commit
39ff11d5d8
|
|
@ -0,0 +1,32 @@
|
|||
# Freemarker functions for Contact items
|
||||
|
||||
Import path
|
||||
: `/ccm-cms-types-contact.ftl`
|
||||
|
||||
## `getAddress(item: Node): Node`
|
||||
|
||||
Returns the address associated wit the provided contact item. The
|
||||
address can be processed further using the functions provided by the
|
||||
ccm-cms-types-address module.
|
||||
|
||||
## `getPerson(item: Node): Node`
|
||||
|
||||
Returns the person associated with the provided contact. The returned
|
||||
person item can be processed further using functions provided by the
|
||||
ccm-cms module.
|
||||
|
||||
## `getContactEntries(item: Node): Sequence<Node>`
|
||||
|
||||
Returns the contact entries of the provided contact.
|
||||
|
||||
## `getContactEntry(item: Node, keyId: String): Node`
|
||||
|
||||
Returns the contact entry with the provided `keyId` if the provided contact has a matching contact entry. If not `null` is returned.
|
||||
|
||||
## `getContactEntryLabel(entry: Node): String`
|
||||
|
||||
Returns the label of the provided contact entry.
|
||||
|
||||
## `getContactEntryValue(entry: Node): String`
|
||||
|
||||
Returns the value of the provided contact entry.
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
# Freemarker functions for Event items
|
||||
|
||||
Import path
|
||||
: `/ccm-cms-types-event.ftl`
|
||||
|
||||
## `getLead(item: Node): String`
|
||||
|
||||
Returns the lead text of the event.
|
||||
|
||||
## `getMainText(item: Node): String`
|
||||
|
||||
Returns the main text of the event.
|
||||
|
||||
## `getEndDate(item: Node): DateTimeNode`
|
||||
|
||||
Returns the end date of the provided event item. To format the date
|
||||
the `formatDateTime` function provided by the ccm-cms module should be used.
|
||||
|
||||
## `getEndDateYear(item: Node): String`
|
||||
|
||||
Returns the year part of the end date of the event.
|
||||
|
||||
## `getEndDateMonth(item: Node): String`
|
||||
|
||||
Returns the month part of the end date of the event.
|
||||
|
||||
## `getEndDateShortMonth(item: Node): String`
|
||||
|
||||
Returns the the short name of month part of the end date of the event.
|
||||
|
||||
## `getEndTime(item: Node): String`
|
||||
|
||||
Gets the end time of the event.
|
||||
|
||||
## `getEndTimeHour(item: Node): String`
|
||||
|
||||
Gets the hour part of the end time of the event.
|
||||
|
||||
## `getEndTimeMinute(item: Node): String`
|
||||
|
||||
Gets the minute part of the end time of the event.
|
||||
|
||||
## `getEndTimeSecond(item: Node): String`
|
||||
|
||||
Gets the second part of the end time of the event.
|
||||
|
||||
## `getStartDate(item: Node): DateTimeNode`
|
||||
|
||||
Returns the start date of the provided event item. To format the date
|
||||
the `formatDateTime` function provided by the ccm-cms module should be used.
|
||||
|
||||
## `getStartDateYear(item: Node): String`
|
||||
|
||||
Returns the year part of the start date of the event.
|
||||
|
||||
## `getStartDateMonth(item: Node): String`
|
||||
|
||||
Returns the month part of the start date of the event.
|
||||
|
||||
## `getStartDateShortMonth(item: Node): String`
|
||||
|
||||
Returns the the short name of month part of the start date of the event.
|
||||
|
||||
## `getStartTime(item: Node): String`
|
||||
|
||||
Gets the start time of the event.
|
||||
|
||||
## `getStartTimeHour(item: Node): String`
|
||||
|
||||
Gets the hour part of the start time of the event.
|
||||
|
||||
## `getStartTimeMinute(item: Node): String`
|
||||
|
||||
Gets the minute part of the start time of the event.
|
||||
|
||||
## `getStartTimeSecond(item: Node): String`
|
||||
|
||||
Gets the second part of the start time of the event.
|
||||
|
||||
## `getLocation(item: Node): String`
|
||||
|
||||
Gets the location of the event.
|
||||
|
||||
## `getMainContributor(item: Node): String`
|
||||
|
||||
Gets the value of the `mainContributor` property of the event.
|
||||
|
||||
## `getEventType(item: Node): String`
|
||||
|
||||
Returns the value of the `eventType` property of the event.
|
||||
|
||||
## `getCost(item: Node): String`
|
||||
|
||||
Returns the value of the `cost` property of the event.
|
||||
|
||||
## `getMapLink(item: Node): String`
|
||||
|
||||
Returns the value of the `mapLink` property of the event.
|
||||
|
||||
## `getEventDateAddendum(item: Node): String`
|
||||
|
||||
Returns the value of the addendum property of the event.
|
||||
|
|
@ -15,7 +15,6 @@
|
|||
<#return Article.getMainText(item)>
|
||||
</#function>
|
||||
|
||||
|
||||
<#function getEndDate item>
|
||||
<#if (item["./endDate"]?size > 0)>
|
||||
<#return item["./endDate"]>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
# Freemarker functions for ExternalLink items
|
||||
|
||||
Import path
|
||||
: `/ccm-cms-types-externallink.ftl`
|
||||
|
||||
## `getDescription(item: Node): String`
|
||||
|
||||
Gets the description of the external link item.
|
||||
|
||||
## `getComment(item: Node): String`
|
||||
|
||||
Gets the value of the `comment` property of the link item.
|
||||
|
||||
## `isTargetNewWindow(item: Node): String`
|
||||
|
||||
Returns `true` if the link should be opened in a new window/tab.
|
||||
|
||||
## `getUrl(item: Node): String`
|
||||
|
||||
Returns the URL of the external link.
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# Freemarker functions for File Storage Items
|
||||
|
||||
Import path
|
||||
: `/ccm-cms-types-filestorageitem.ftl`
|
||||
|
||||
## `getDescription(item: Node): String`
|
||||
|
||||
Gets the description of the file storage item.
|
||||
|
||||
## `getFileId(item: Node): String`
|
||||
|
||||
Returns the ID for the file represented by the file storage item.
|
||||
|
||||
## `getFileName(item: Node): String`
|
||||
|
||||
Returns the name of the file represented by the file storage item.
|
||||
|
||||
## `getFileLink(item: Node, mode: String="download", useFileName: boolean = true): String`
|
||||
|
||||
Returns the link for downloading or viewing the file. The optional
|
||||
parameter `mode` controls if the link for downloading or for viewing
|
||||
the file is generated. The supported values are `download` (default
|
||||
value) and `stream`. Unknown values are interpreted as `download`.
|
||||
|
||||
The optional `useFileName` parameter controls if the name of the file (see `getFileName`) is included in the link. The default value is `true`.
|
||||
Loading…
Reference in New Issue