I am trying to use SortTool from Velocity Generic Tools inside a decorator that handles the search results.
The code is:
<div id="search-results-body">
<ul class="search-results">
#foreach($searchResult in $sorter.sort($results,
"lastModificationDate:desc"))
<li >
$action.newSearchResult($searchResult, $showExcerpts, $queryString)
</li>
#end
</ul>
</div>
Where $results is the collection of search results and $sorter is a handle to the Sorter class as explained in SortTool.
But the foreach loop is not executed since nothing is displayed, this is because $sort is null which means that confluence default velocity context don't know about that class.
How can I use those generic tools inside the decorators?
Thank you.