Hi Nicolas,

The velocity tools are not currently configured in XWiki. We need to either configure them or better allow the user to configure them.

If someone submits a patch for this I could apply it :)

Thanks
-Vincent

On Jul 3, 2007, at 1:29 PM, Nicolas Réau wrote:

Hi!

In the same way, velocity SortTool seems to allow sorting objects by a property. I tried to use it to sort the blog categories like this (i just modified 2 lines):

#set ($objects = $catdoc.getObjects(" Blog.Categories"))
#set ($objects = $xwiki.sort($objects, "name"))
#foreach ($catobj in $objects) ....

But it does not work. It still displays the categories in a "disorder".
I know it's only available since velocity-tools 1.2 version, does it come from that? Or is it simply not available in XWiki environment ? Or am i wrong in how i wrote it?

Thanks!

(and sorry to digg up this old thread)

-Nicolas-


2007/4/12, Esbach, Brandon <Esbachb@tycoelectronics.com>:
Thanks,
Wasn't aware there was an xwiki.sort function; will be useful elsewhere too.
 


From: ping@familyng.org [mailto:ping@familyng.org] On Behalf Of Melv Ng
Sent: 11 April 2007 21:24
To: xwiki-users@objectweb.org
Subject: Re: [xwiki-users] Order of classes?

Hi,

I'm not sure if this is what you want, but in the case of the class page (XWiki.XWikiClasses), you can make the list sorted by simply sorting the class list. Replace the bottom code of the page to something like this:

1.1 Existing Classes
#set( $list = $xwiki.sort( $xwiki.classList ) )
#foreach ($classname in $list)
   * [$classname]
#end

Best regards
Melv

On 4/11/07, Esbach, Brandon <Esbachb@tycoelectronics.com> wrote:

Hi all,

When viewing a list of classes (both in the class editor and when attaching a class manually to a document via class list dropdown) the order of classes seems a bit random. Is there any way to select the sort order?

The userlist property type also seems to be a bit random (in my case, selecting value or id makes no difference).