#set ($months = $_XPathTool.selectNodes($contentRoot, "/system-index-block/system-folder")) #set ($currentDate = $_XPathTool.selectSingleNode($contentRoot, "/system-index-block/@current-time").value) #set ($eventsArticles = $_XPathTool.selectNodes($contentRoot, "/system-index-block/system-page[name != 'index']")) ## sort articles by start-date $_SortTool.addSortCriterion("system-page/start-date", "", "number", "ascending", "upper-first") $_SortTool.sort($eventsArticles) ## sort Months by start-date $_SortTool.addSortCriterion("system-page/start-date", "", "number", "descending", "upper-first") $_SortTool.sort($months)

News Yearly Index

#foreach ($month in $months) #set ($monthName = $month.getChild("title")) #set ($newsArticles = $_XPathTool.selectNodes($month, "system-page[name!='index'][system-data-structure/end-date > $currentDate] | system-page[name != 'index'][system-data-structure/end-date != ''][path != '/_internal/base_assets/news/news']")) #if ($newsArticles.size() > 0)

$_SerializerTool.serialize($monthName, true)

#foreach ($newsArticle in $newsArticles) #set ($articleTitle = $newsArticle.getChild("title")) #set ($articlePath = $newsArticle.getChild("path").value) #set ($articleStartDate = $_DateTool.getDate($newsArticle.getChild("start-date").value)) #set ($articleEndDate = $_DateTool.getDate($newsArticle.getChild("end-date").value)) #set ($articleImage = $newsArticle.getChild("system-data-structure").getChild("image").getChild("thumbnail").getChild("path").value) #set ($articleSummary = $newsArticle.getChild("summary")) #set ($articleName = $newsArticle.getChild("name")) #if ($articleStartDate != "")
$_DateTool.format('MMMM dd, yyyy', $articleStartDate)
#end #if ($articleTitle != "")

$_SerializerTool.serialize($articleTitle, true)

#else

$_SerializerTool.serialize($articleName, true)

#end ## #if ($articleImage != "/") ## ## #end #if ($articleSummary != "") $_SerializerTool.serialize($articleSummary, true) #end
#end #end #end