On Tue, Dec 4, 2012 at 12:08 PM, Desire_cat <c.len...@kelway.co.uk> 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#HAllacceptedvalues
) 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
> 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