Hello,

you can use the velocity $sorttool, bundled by default with XWiki.

http://platform.xwiki.org/xwiki/bin/view/DevGuide/Scripting#HXWiki27sVelocityAPI
http://velocity.apache.org/tools/releases/velocity-tools-1.2/javadoc/org/apache/velocity/tools/generic/SortTool.html

AFAIR, I'd try something like :

#foreach($subdoc in $sorttool.sort($xwiki.getSpaceDocsName("$doc.web")))

Jerome.

On 10/13/09 9:19 PM, Alexandre Souza wrote:
> Hi,
>
> I want to sort the items in a panel by name.
> I'm using as follows, but the items in the panel are not in alphabetical
> order.
> How can I do this with the same code below?
>
> #set($web = $doc.web)
>    #panelheader('Name')
>      #foreach($subdoc in $xwiki.getSpaceDocsName("$doc.web"))
>          #if($subdoc!='WebPreferences'&&  $subdoc!='WebHome')
>              - [${doc.web}.${subdoc}]
>          #end
>      #end
>    #panelfooter()
>
>
> Thanks,
> Alexandre Souza
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users

_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to