It’s a pure fine list of articles the user liked. Top is the page I liked last. At the bottom the page I liked first. But I would prefer to sort it alphabetically.
How can I sort the list or how can I get the list sorted already?
Regards, Simpel
{{velocity}}
#if($request.user)
#set ($userReference = $request.user)
#else
#set ($userReference = $services.user.currentUserReference)
#end
#set($offset = 0)
#set($limit = 1000)
#set ($likedPages = $services.like.getUserLikes($userReference, $offset, $limit))
#set ($likedPagesCounter = $likedPages.size())
#if ($likedPagesCounter == 1)
1 Seite habe ich mit einem Like versehen:
#else
${likedPagesCounter} Seiten habe ich mit einem Like versehen:
#end
#set ($likedPagesSort = $sorttool.sort($likedPages))
#foreach($likedPage in $likedPagesSort)
#set ($likedDoc = $xwiki.getDocument($likedPage))
#set ($label = $likedDoc.getPageReference())
#set ($labelString = "$label")
## PageReference has a leading "xwiki:". This I want to omit.
#set( $labelTruncate = $labelString.replace("xwiki:", ""))
## $labelTruncate can have two or more underscores. XWiki converts them to underlined style normally.
## To avoid this I must wrap this label in 3 curly brackets.
## But this calls the class "wikimodel-verbatim" automatically with font-family sans-serif.
## To overrule it I had to introduce class "myLikesLinks".
(% class="myLikesLinks" %)
* [[{{{${labelTruncate}}}}>>${likedDoc}]]
#end
{{/velocity}}