Hello, I have an additionnal remark on this. Passing "tag=mytag" in the "extraParams" to the livetable macro works well, ie the livetable then displays items having passed tag(s). But I see some limitations, mainly due to the fact that this specific "extraParam" param "tag" is not linked with the "tagCloud" parameter of the livetable macro: - you don't see, if tagCloud is displayed, what tag(s) was(were) used for filtering it by default. Tag cloud is displayed as if no tags were selected. - in that case you might want to really "restrict" that specific livetable to showing that specific tag(s), and forbid users changing it (but still display it), but you can't display a "read-only" tag cloud. In fact it's worse, as ideally, I think we should restrict the list of tags displayed/selectable in the tag cloud, to the list of tags provided in "extraParam" + list of tags "dependent" on any tag of the first list. BR, Jeremie 2012/12/4 Marius Dumitru Florea <[email protected]>
On Tue, Dec 4, 2012 at 12:08 PM, Desire_cat <[email protected]> wrote:
Hi Everyone,
I am new to Xwiki and I am stuck with a little problem and I was wondering if any of you lovely people could help?
What I am trying to do is generate a Livetable similar to the documents macro but only showing a group of selected tags.
Is this possible? and if so how would I go about doing this?
Sure. You can use the "extraParams" live table parameter (see
http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro#HAllacc... ) to filter documents by tags. It's very easy to extend the documents macro to add a new "tags" parameter and pass its value to the "extraParams". Here's what I did:
(1) I edited XWiki.DocumentsMacro page with the objects editor and I added a new optional "tags" parameter (a comma-separated list of tags) (2) From the objects editor, I added this to the macro content, before the "$!extraParams" != "" test:
#if ("$!xcontext.macro.params.tags" != "") #set ($tags = $!xcontext.macro.params.tags.split('\s*,\s*')) #foreach ($tag in $tags) #set ($extraParams = "${extraParams}&tag=$escapetool.url($tag)") #end #end
To better understand this you should read http://platform.xwiki.org/xwiki/bin/view/DevGuide/WikiMacroTutorial .
Hope this helps, Marius
Thanks
-- View this message in context:
http://xwiki.475771.n2.nabble.com/Livetable-problem-tp7582689.html
Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users