#macro (replaceEntities $str)
## Define the entities to replace, and their corresponding replacement.
#set ($replacementMap = {
"’": "'",
" ": " "
})
## Re-encode the ampersands before replacing the entities.
#set ( $str = $str.replaceAll("&", "&") )
## Loop over the keys in the replacement map.
#set ($keys = $replacementMap.keySet().toArray())
#foreach ($k in $keys)
## Replace the key with the corresponding value.
#set ( $str = $str.replaceAll($k, $replacementMap.get($k)) )
#end
## Output the resulting string.
$str
#end
Events Calendar
## grab all news items from RSS feed
#set ( $articles = $_XPathTool.selectNodes($contentRoot,"channel//item") )
#set($count = 0)
#foreach ( $article in $articles )
#set ( $title = $_SerializerTool.serialize($article.getChild("title"),true) )
#set ( $url = $article.getChild("link").text )
#set ( $description = $article.getChild("description").value )
## extracts a string containing everything after the first occurrence of "-"
#set ( $dateText = $_StringTool.substringAfter($article.getChild("guid").value,"-") )
## get Date object from date text
#set ( $dateObj = $_DateTool.toDate("yyyy-MM-dd",$dateText) )
## gets Date representing current system time
#set ( $today = $_DateTool.getDate() )
#if ( $dateObj.getTime() >= $today.getTime() )
#set($count = $count + 1)
#if ($count <= 4)
${title}
${_DateTool.format("EEEE, MMMM dd, yyyy",$dateObj)}
#replaceEntities($description)
#end
#end
#end
// See More Upcoming Events