From 511180c0da019a6d9d136aed5f8738e7e962da87 Mon Sep 17 00:00:00 2001 From: jensp Date: Sun, 3 Nov 2019 09:30:09 +0000 Subject: [PATCH] Documentation for the FTL libs provided by ccm-themedirectory git-svn-id: https://svn.libreccm.org/ccm/trunk@6287 8810af33-2d31-482b-a856-94f89814c4df --- .../web/themes/freemarker/language.ftl | 2 +- .../web/themes/freemarker/utils.ftl | 23 +++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ccm-themedirector/web/themes/freemarker/language.ftl b/ccm-themedirector/web/themes/freemarker/language.ftl index c429a1fd1..bb1877f26 100644 --- a/ccm-themedirector/web/themes/freemarker/language.ftl +++ b/ccm-themedirector/web/themes/freemarker/language.ftl @@ -5,7 +5,7 @@ "ui": "http://www.arsdigita.com/ui/1.0"} > -<#--- +<#--doc Retrieves the languages in which the content of the current page is available. diff --git a/ccm-themedirector/web/themes/freemarker/utils.ftl b/ccm-themedirector/web/themes/freemarker/utils.ftl index cf60e7e33..0911de52c 100644 --- a/ccm-themedirector/web/themes/freemarker/utils.ftl +++ b/ccm-themedirector/web/themes/freemarker/utils.ftl @@ -5,7 +5,7 @@ "ui": "http://www.arsdigita.com/ui/1.0"} > -<#--- +<#--doc Gets the application of the page served from the model. @return The current application. @@ -14,7 +14,7 @@ <#return model["/bebop:page/@application"]> -<#--- +<#--doc Get the title of the current page. This will only work of the current page is a navigation page with a category @@ -26,15 +26,19 @@ <#return model["//nav:categoryMenu/nav:category/@title"]> -<#--- +<#--doc Get the hostname from the sitebanner data. + + @return The host name of the site. --> <#function getSiteHostName> <#return model["/bebop:page/ui:siteBanner/@hostname"]> -<#--- +<#--doc Get the name of the site from the sitebanner data. + + @return The name of the site. --> <#function getSiteName> <#return model["/bebop:page/ui:siteBanner/@sitename"]> @@ -44,6 +48,12 @@ Internal function. Not for public use. Internal function for coverting several string values like `yes`, `true`, `no` etc. to a boolean value. + + @param fromNode An XML node + + @param The attribute to convert to boolean. + + @return A boolean representation of the value of the attribute. --> <#function getBooleanAttrValue fromNode attrName> <#assign path='@' + attrName> @@ -55,7 +65,7 @@ -<#--- +<#--doc 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 @@ -64,7 +74,10 @@ component. @param style The date format style from the theme manifest to use. + @param date the date to format. + + @return The formatted date. --> <#function formatDateTime style date> <#assign year = (date["./@year"]?size > 0)?then(date["./@year"]?number, 0)>