I am trying to build a livetable which will display only pages that are tagged with a certain tag. But, given that different users will use similar but different tags, I would like to connect my conditions as “OR”.
Which means, if a page carries either tag “blue” OR tag “turquoise”, I would like them to show up.
I have been able to build a livetable that gives me pages with BOTH tags using
'extraParams' : '&tag=tag1&tag=tag2'
but that’s obviously not what I was going for.
Anyone there to help? Thanks a lot!
You cannot do an OR by using the tag value in extraParams.
Technically, if you don’t specify a custom results page, the XWiki.LiveTableResults page is used (you can check it in your wiki). Internally this calls the XWiki.LiveTableResultsMacro page which contains some definition of velocity macros and especially the #gridresultwithfilter macro, which will end up calling this code, which says what to do if tag is specified:
As you can see this behavior is hardcoded.
What you could do is provide a custom results page.
Now, AFAIK, the filters only allow filtering on properties and not on tags (this BTW one of the last missing feature of LiveData to completely replace LiveTable).
Thus for @Julia LiveData is the solution but for @matt.kintsugi a custom results page for LiveTable is the solution.
shows all entries with value2 AND value5 in their specific fieldName (only possible if it is a multi select value).
filters='&fieldName=value2&fieldName=value5'
shows all entries with value2 OR value5 in their specific fieldName (for a radio selected value). Of corse “value2 OR value5” means all entries with value2 AND all entries with value5.
The results of both lines are different and the second line does exactly what I was looking for
It would mean that we have a different behavior in LD and LT. BTW you’ve used the filters parameter. I think you can also use the extraParams parameter in the sourceParameters property since if you’ve used a livetable source for LD, the sourceParameters contains the LT parameters (something like sourceParameters="...extraParams=...).