A really helpful macro looking forward to 3.5 Final to migrate to it. One more macro that would be useful is list of attachments on the page (an analogue to {attachments} in confluence). Sometimes it's useful to have that list embedded directly into page instead of having to navigate to the bottom and click on the tab.
add the following code the the code of XWiki.WikiMacroClass after line 22 #if ("$!xcontext.macro.params.sort-col" != "") #set($dummy = $options.put("selectedColumn", $!xcontext.macro.params.sort-col)) #end #if ("$!xcontext.macro.params.sort-order" != "") #set($dummy = $options.put("defaultOrder", $!xcontext.macro.params.sort-order)) #end
Now you could have the Livetable sorted on the specified col by default. {{documents id="example" count="5" actions="false" columns="doc.title, doc.location" sort-col="doc.location" sort-order="desc"/}}
A really helpful macro looking forward to 3.5 Final to migrate to it.
One more macro that would be useful is list of attachments on the page (an analogue to {attachments} in confluence). Sometimes it's useful to have that list embedded directly into page instead of having to navigate to the bottom and click on the tab.
Is it possible to specify inverse ordering by page column?
It would be interesting to be able to sort asc|desc by one of the columns specified when calling the macro.
I agree. Could you create a JIRA issue at https://jira.xwiki.org/browse/XWIKI/component/12040? Thanks
It could be done by the following:
#if ("$!xcontext.macro.params.sort-col" != "")
#set($dummy = $options.put("selectedColumn", $!xcontext.macro.params.sort-col))
#end
#if ("$!xcontext.macro.params.sort-order" != "")
#set($dummy = $options.put("defaultOrder", $!xcontext.macro.params.sort-order))
#end
Now you could have the Livetable sorted on the specified col by default.
{{documents id="example" count="5" actions="false" columns="doc.title, doc.location" sort-col="doc.location" sort-order="desc"/}}
I created a issue here:
https://jira.xwiki.org/browse/XWIKI-16688
There's also a limitation or a bug - when I add several macros on the page - the content for all of them is the same as the content of the first one.