Documentation for the Freemarker function libs provided by ccm-themedirectory
git-svn-id: https://svn.libreccm.org/ccm/trunk@6279 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
717e51d750
commit
404b91129e
|
|
@ -6,7 +6,8 @@
|
||||||
>
|
>
|
||||||
|
|
||||||
<#---
|
<#---
|
||||||
Retrieves the languages in which the content of the current page is available.
|
Retrieves the languages in which the content of the current page is
|
||||||
|
available.
|
||||||
|
|
||||||
@return A sequence of the available languages (as ISO language codes)
|
@return A sequence of the available languages (as ISO language codes)
|
||||||
#-->
|
#-->
|
||||||
|
|
|
||||||
|
|
@ -5,26 +5,46 @@
|
||||||
"ui": "http://www.arsdigita.com/ui/1.0"}
|
"ui": "http://www.arsdigita.com/ui/1.0"}
|
||||||
>
|
>
|
||||||
|
|
||||||
<#--
|
<#---
|
||||||
Gets the application of the page served from the model
|
Gets the application of the page served from the model.
|
||||||
|
|
||||||
|
@return The current application.
|
||||||
-->
|
-->
|
||||||
<#function getPageApplication>
|
<#function getPageApplication>
|
||||||
<#return model["/bebop:page/@application"]>
|
<#return model["/bebop:page/@application"]>
|
||||||
</#function>
|
</#function>
|
||||||
|
|
||||||
|
<#---
|
||||||
|
Get the title of the current page.
|
||||||
|
|
||||||
|
This will only work of the current page is a navigation page with a category
|
||||||
|
menu.
|
||||||
|
|
||||||
|
@return The title of the current page
|
||||||
|
-->
|
||||||
<#function getPageTitle>
|
<#function getPageTitle>
|
||||||
<#return model["//nav:categoryMenu/nav:category/@title"]>
|
<#return model["//nav:categoryMenu/nav:category/@title"]>
|
||||||
</#function>
|
</#function>
|
||||||
|
|
||||||
|
<#---
|
||||||
|
Get the hostname from the sitebanner data.
|
||||||
|
-->
|
||||||
<#function getSiteHostName>
|
<#function getSiteHostName>
|
||||||
<#return model["/bebop:page/ui:siteBanner/@hostname"]>
|
<#return model["/bebop:page/ui:siteBanner/@hostname"]>
|
||||||
</#function>
|
</#function>
|
||||||
|
|
||||||
|
<#---
|
||||||
|
Get the name of the site from the sitebanner data.
|
||||||
|
-->
|
||||||
<#function getSiteName>
|
<#function getSiteName>
|
||||||
<#return model["/bebop:page/ui:siteBanner/@sitename"]>
|
<#return model["/bebop:page/ui:siteBanner/@sitename"]>
|
||||||
</#function>
|
</#function>
|
||||||
|
|
||||||
<#-- Internal function -->
|
<#--
|
||||||
|
Internal function. Not for public use.
|
||||||
|
Internal function for coverting several string values like `yes`, `true`,
|
||||||
|
`no` etc. to a boolean value.
|
||||||
|
-->
|
||||||
<#function getBooleanAttrValue fromNode attrName>
|
<#function getBooleanAttrValue fromNode attrName>
|
||||||
<#assign path='@' + attrName>
|
<#assign path='@' + attrName>
|
||||||
<#if (fromNode[path]?size > 0)>
|
<#if (fromNode[path]?size > 0)>
|
||||||
|
|
@ -35,6 +55,17 @@
|
||||||
</#if>
|
</#if>
|
||||||
</#function>
|
</#function>
|
||||||
|
|
||||||
|
<#---
|
||||||
|
A wrapper for the `_formatDateTime` function which adds missing numbers.
|
||||||
|
`_formatDateTime` uses Java APIs for formatting which don't work well with
|
||||||
|
incomplete dates. This function takes a date from the data model and checks
|
||||||
|
if a component (year, month, day, hour, minute, second) is missing. If the
|
||||||
|
the component is missing the function adds uses a default value of that
|
||||||
|
component.
|
||||||
|
|
||||||
|
@param style The date format style from the theme manifest to use.
|
||||||
|
@param date the date to format.
|
||||||
|
-->
|
||||||
<#function formatDateTime style date>
|
<#function formatDateTime style date>
|
||||||
<#assign year = (date["./@year"]?size > 0)?then(date["./@year"]?number, 0)>
|
<#assign year = (date["./@year"]?size > 0)?then(date["./@year"]?number, 0)>
|
||||||
<#assign month = (date["./@month"]?size > 0)?then(date["./@month"]?number, 0)>
|
<#assign month = (date["./@month"]?size > 0)?then(date["./@month"]?number, 0)>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue