diff --git a/ccm-cms-types-newsitem/web/themes/freemarker/ccm-cms-types-newsitem.ftl b/ccm-cms-types-newsitem/web/themes/freemarker/ccm-cms-types-newsitem.ftl index 98551ee98..c762ce33d 100644 --- a/ccm-cms-types-newsitem/web/themes/freemarker/ccm-cms-types-newsitem.ftl +++ b/ccm-cms-types-newsitem/web/themes/freemarker/ccm-cms-types-newsitem.ftl @@ -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)> +<#--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)> +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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 @@ +<#--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"]>