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-94f89814c4dfmaster
parent
2dd13c92d2
commit
c9e75ccb0d
|
|
@ -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)>
|
||||
<div class="mpa-toc">
|
||||
<h3>${getLocalizedText("mpa.toc")}</h3>
|
||||
<ul class="mpa-toc">
|
||||
<#items as section>
|
||||
<li>
|
||||
<a href="${Toc.getSectionLink(section)}"
|
||||
class="${Toc.isActiveSection(item, section)?then('active', '')}">
|
||||
${Toc.getSectionTitle(section)}
|
||||
</a>
|
||||
</li>
|
||||
</#items>
|
||||
</ul>
|
||||
</div>
|
||||
</#list>
|
||||
|
||||
## `getSections(item: Node): Sequence<Node>`
|
||||
|
||||
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.
|
||||
|
|
@ -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<Node>`
|
||||
|
||||
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.
|
||||
Loading…
Reference in New Issue