From c9e75ccb0dcecb39ac81608a06e6583b43be6258 Mon Sep 17 00:00:00 2001 From: jensp Date: Sat, 8 Jun 2019 09:04:34 +0000 Subject: [PATCH] Documentation for the Freemarker functions provided by ccm-cms-types-multiparticle git-svn-id: https://svn.libreccm.org/ccm/trunk@6115 8810af33-2d31-482b-a856-94f89814c4df --- .../ccm-cms-types-multiparticle-toc.md | 46 +++++++++++++++ .../freemarker/ccm-cms-types-multiparticle.md | 58 +++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 ccm-cms-types-mparticle/doc/freemarker/ccm-cms-types-multiparticle-toc.md create mode 100644 ccm-cms-types-mparticle/doc/freemarker/ccm-cms-types-multiparticle.md diff --git a/ccm-cms-types-mparticle/doc/freemarker/ccm-cms-types-multiparticle-toc.md b/ccm-cms-types-mparticle/doc/freemarker/ccm-cms-types-multiparticle-toc.md new file mode 100644 index 000000000..db51f26cb --- /dev/null +++ b/ccm-cms-types-mparticle/doc/freemarker/ccm-cms-types-multiparticle-toc.md @@ -0,0 +1,46 @@ +# Freemarker functions for generating the table of contents of a MultiPartArticle + +Import Path +: `/ccm-cms-types-multiparticle-toc.ftl` + +These functions can be used to generate the table of contents (toc) for +a multi part article. An example: + + ... // Other imports + <#import "/ccm-cms-types-multiparticle-toc.ftl" as Toc> + + ... // Other things + + <#list Toc.getSections(item)> +
+

${getLocalizedText("mpa.toc")}

+ +
+ + +## `getSections(item: Node): Sequence` + +Returns the sections of the provided MultiPartArticle item. The +sections can be further be processed using the other functions +provided by this file. + +## `getSectionTitle(section: Node): String` + +Gets the title of the provided section. + +## `getSectionLink(section: Node): String` + +Gets the link for displaying the provided section. + +## `isActiveSection(section: Node): String` + +Returns `true` if the provided section is the active section. \ No newline at end of file diff --git a/ccm-cms-types-mparticle/doc/freemarker/ccm-cms-types-multiparticle.md b/ccm-cms-types-mparticle/doc/freemarker/ccm-cms-types-multiparticle.md new file mode 100644 index 000000000..2814d5b80 --- /dev/null +++ b/ccm-cms-types-mparticle/doc/freemarker/ccm-cms-types-multiparticle.md @@ -0,0 +1,58 @@ +# Freemarker functions for MultiPartArticles + +Import Path +: `/ccm-cms-types-multiparticle.ftl` + +## `getSummary(item: Node): String` + +Returns the summary of the provided MultiPartArticle item. + +## `getSections(item: Node): Sequence` + +Returns the currently displayed sections of the multipart article. +The sections can be processed further by some of the other funtions +provided by this library. + +## `getSectionTitle(section: Node): String` + +Returns title title of the provided section. + +## `getSectionTitle(section: Node): HtmlString` + +Gets the content of the provided section. + +## `getSectionRank(section: Node): String` + +Gets the value of the `rank` property of the provided section. + +## `getPageNumber(item: Node): String` + +Gets the number of the page of the multipart article displayed. + +## `getNumberOfPages(item: Node): String` + +Returns the number of pages of the provided multipart article. + +## `hasPreviousPage(item: Node): boolean` + +Returns `true` if the provided multipart article has previous pages. + +## `hasPreviousPage(item: Node): boolean` + +Returns `true` if the provided multipart article has more pages. + +## `hasMultiplePages(item: Node): boolean` + +Returns `true` if the provided multipart article has more than one page. + +## `getLinkToPreviousPage(item: Node): String` + +Returns the link to the previous page if any. + +## `getLinkToNextPage(item: Node): String` + +Returns the link to the next page if any. + +## `getAllSectionsLink(item: Node): String` + +Returns the link for showing the complete multipart article on a single page. \ No newline at end of file