Documentation for ccm-cms-types-newsitem.ftl

git-svn-id: https://svn.libreccm.org/ccm/trunk@6295 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2019-11-03 11:22:48 +00:00
parent def48dcb3e
commit 974a9f6fc3
1 changed files with 81 additions and 0 deletions

View File

@ -6,14 +6,39 @@
>
<#import "/ccm-cms-types-article.ftl" as Article>
<#--filedoc
Functions for News items
-->
<#--doc
Gets the lead text of a news item
@param item The news item to use.
@return The lead text of the news item.
-->
<#function getLead item>
<#return Article.getLead(item)>
</#function>
<#--doc
Gets the main text of a news item
@param item The news item to use.
@return The main of the news item.
-->
<#function getMainText item>
<#return Article.getMainText(item)>
</#function>
<#--doc
Gets the date of a news item
@param item The news item to use.
@return The date of the news item.
-->
<#function getNewsDate item>
<#if (item["./newsDate"]?size > 0)>
<#return item["./newsDate"] />
@ -22,6 +47,13 @@
</#if>
</#function>
<#--doc
Gets the year of the news date.
@param item The news item to use.
@return The year of the news date.
-->
<#function getNewsDateYear item>
<#if (item["./newsDate"]?size > 0)>
<#return item["./newsDate/@year"]>
@ -30,6 +62,13 @@
</#if>
</#function>
<#--doc
Gets the month of the news date.
@param item The news item to use.
@return The month of the news date.
-->
<#function getNewsDateMonth item>
<#if (item["./newsDate"]?size > 0)>
<#return item["./newsDate/@month"]>
@ -38,6 +77,13 @@
</#if>
</#function>
<#--doc
Gets the day of the news date.
@param item The news item to use.
@return The day of the news date.
-->
<#function getNewsDateDay item>
<#if (item["./newsDate"]?size > 0)>
<#return item["./newsDate/@day"]>
@ -46,6 +92,13 @@
</#if>
</#function>
<#--doc
Gets the short name of the day of the news date.
@param item The news item to use.
@return The short name of the day of the news date.
-->
<#function getNewsDateDayNameShort item>
<#if (item["./newsDate"]?size > 0)>
<#return item["./newsDate/@dayNameShort"]>
@ -54,6 +107,13 @@
</#if>
</#function>
<#--doc
Gets the hour of the news date.
@param item The news item to use.
@return The hour of the news date.
-->
<#function newsDateHour item>
<#if (item["./newsDate"]?size > 0)>
<#return item["./newsDate/@hour"]>
@ -62,6 +122,13 @@
</#if>
</#function>
<#--doc
Gets the minute of the news date.
@param item The news item to use.
@return The minute of the news date.
-->
<#function newsDateMinute item>
<#if (item["./newsDate"]?size > 0)>
<#return item["./newsDate/@minute"]>
@ -70,6 +137,13 @@
</#if>
</#function>
<#--doc
Gets the second of the news date.
@param item The news item to use.
@return The second of the news date.
-->
<#function newsDateSecond item>
<#if (item["./newsDate"]?size > 0)>
<#return item["./newsDate/@second"]>
@ -78,6 +152,13 @@
</#if>
</#function>
<#--doc
Gets the news date in ISO format (`yyyy-mm-dd HH:mm:ss`).
@param item The news item to use.
@return The in ISO format.
-->
<#function getNewsDateIso item>
<#if (item["./newsDate"]?size > 0)>
<#return item["./newsDate/@iso"]>