Freemarker has two collection datatypes, lists and hashmaps Is there a way to iterate over hashmap keys just as we do with lists?
So if I have a var with data lets s
For completeness, it's worth mentioning there's a decent handling of empty collections in Freemarker since recently.
So the most convenient way to iterate a map is:
<#list tags> <#items as tagName, tagCount> {$tagName} (${tagCount}) #items> <#else> No tags found. #list>
No tags found.
No more <#if ...> wrappers.
<#if ...>