diff --git a/ccm-themedirector/doc/freemarker/ccm-themedirector/language.md b/ccm-themedirector/doc/freemarker/ccm-themedirector/language.md new file mode 100644 index 000000000..61e1586f8 --- /dev/null +++ b/ccm-themedirector/doc/freemarker/ccm-themedirector/language.md @@ -0,0 +1,23 @@ +# Freemarker functions for language related tasks. + +Import Path + :`/ccm-themedirector/language.ftl` + +### `getAvailableLanguages(): Sequence ` + +Returns the available languages for the current document as sequence. This +sequence can be used for creating links for selecting the language: + + + +This example uses the `list` directive from Freemarker to iterate over +the available languages returned by `getAvailableLanguages` The +Freemarker build-in `?then` is used together with the +`negotiatedLanguage` variable to check if the curent language is the +selected language. If this is the case a CSS class is added to the +HTML. + diff --git a/ccm-themedirector/doc/freemarker/ccm-themedirector.md b/ccm-themedirector/doc/freemarker/ccm-themedirector/utils.md similarity index 69% rename from ccm-themedirector/doc/freemarker/ccm-themedirector.md rename to ccm-themedirector/doc/freemarker/ccm-themedirector/utils.md index 176d2b48b..9e3f75a96 100644 --- a/ccm-themedirector/doc/freemarker/ccm-themedirector.md +++ b/ccm-themedirector/doc/freemarker/ccm-themedirector/utils.md @@ -1,48 +1,23 @@ -# Freemarker functions provided by ccm-themedirector - -## Language utilities - -Provides functions for gettign the available languages for the current page. - -Import Path - :`/ccm-themedirector/language.ftl` - - -### `getAvailableLanguages(): Sequence ` - -Returns the available languages for the current document as sequence. This -sequence can be used for creating links for selecting the language: - - - -This example uses the `list` directive from Freemarker to iterate over the available languages returned by `getAvailableLanguages` The Freemarker build-in `?then` is used together with the `negotiatedLanguage` variable to -check if the curent language is the selected language. If this is the case -a CSS class is added to the HTML. - -## Utility functions +# Utility functions Import Path :`/ccm-themedirectory/utils.ftl` -### `String getPageApplication()` +## `getPageApplication(): String` Return the application of the current page. -### `String getPageTitle()` +## `getPageTitle(): String` Return the title of the current page as provided by the _Category Menu_ Component of the _ccm-navigation_ module. -### `String getSiteHostName()` +## `getSiteHostName(): String` Returns the host name of the CCM installation as provided by the _SiteBanner_ component of the _ccm-core_ module. -### `String getSiteName()` +## `getSiteName(): String` Returns the host name of the CCM installation as provided by the _SiteBanner_ component of the _ccm-core_ module. @@ -61,9 +36,7 @@ section. It is possible to define different styles for different languages. The style definition in the theme manifest must be in the format expected by the Java [DateTimeFormatter](https://docs.oracle.com/javase/8/docs/api/index.html?java/time/format/DateTimeFormatter.html) class. - - -#### Example +### Example In the theme manifest in the following format is defined: @@ -102,6 +75,4 @@ In this example the `getNewsDate` function was used to retrieve the date of a ne and for english: - 4/1/19 - - + 4/1/19 \ No newline at end of file