# Livetable displaying pages with tag 1 OR tag 2 OR …

**URL:** <https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632>\
**Category:** Help / Discuss\
**Tags:** livetable, xwiki, tags\
**Created:** [March 17, 2019, 10:02pm UTC](https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632 "2019-03-17T22:02:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt.kintsugi](https://forum.xwiki.org/user_avatar/forum.xwiki.org/matt.kintsugi/32/1684_2.png) [@matt.kintsugi](https://forum.xwiki.org/u/matt.kintsugi)\
**Post date:** [March 17, 2019, 10:02pm UTC](https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632/1 "2019-03-17T22:02:14Z")

</div>

Hi,

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!

---

<div class="post-metadata">

**Author:** ![Rostyslav\_Fitsyk](https://forum.xwiki.org/user_avatar/forum.xwiki.org/rostyslav_fitsyk/32/1427_2.png) [@Rostyslav\_Fitsyk](https://forum.xwiki.org/u/Rostyslav_Fitsyk)\
**Post date:** [March 18, 2019, 7:58am UTC](https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632/2 "2019-03-18T07:58:34Z")

</div>

[http://xwiki.475771.n2.nabble.com/Filter-a-livetable-tp7579401p7579421.html](http://xwiki.475771.n2.nabble.com/Filter-a-livetable-tp7579401p7579421.html)

---

<div class="post-metadata">

**Author:** ![Julia](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@Julia](https://forum.xwiki.org/u/Julia)\
**Post date:** [August 5, 2024, 4:11pm UTC](https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632/3 "2024-08-05T16:11:50Z")

</div>

I’m trying to do the same with `'extraParams': '&fieldName=value2&fieldName=value5'`

AND is what I get - OR is what I’m searching for. The Link by @Rostyslav_Fitsyk is not available anymore.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [August 6, 2024, 8:38am UTC](https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632/4 "2024-08-06T08:38:54Z")

</div>

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:

> <https://github.com/xwiki/xwiki-platform/blob/f487c7c4c3b2cb05afd355fbd94170b36c77e54b/xwiki-platform-core/xwiki-platform-livetable/xwiki-platform-livetable-ui/src/main/resources/XWiki/LiveTableResultsMacros.xml#L92-L111>

As you can see this behavior is hardcoded.

What you could do is provide a custom results page.

Or, even better, is to move away from the now deprecated LiveTable to use LiveData: [https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/](https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/)

You can pass a configuration inside the livedata macro, see [https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HParameters](https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HParameters) which points to [https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HLiveDataJSON](https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HLiveDataJSON) which should allow you to specify some `filters`.

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.

---

<div class="post-metadata">

**Author:** ![Julia](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@Julia](https://forum.xwiki.org/u/Julia)\
**Post date:** [August 6, 2024, 11:28am UTC](https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632/5 "2024-08-06T11:28:11Z")

</div>

So the LiveTable syntax

```auto
'extraParams': '&fieldName=value2&fieldName=value5'

```

has to be transformed to the LiveData syntax

```auto
filters='&fieldName=value2&fieldName=value5'

```

to get both entries.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [August 6, 2024, 11:38am UTC](https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632/6 "2024-08-06T11:38:29Z")

</div>

Sure, but that’s not what you asked 🙂 You asked for an OR.

> [@vmassol](#):
>
> You can pass a configuration inside the livedata macro, see [https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HParameters](https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HParameters) which points to [https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HLiveDataJSON](https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HLiveDataJSON) which should allow you to specify some `filters`.

See ^^

---

<div class="post-metadata">

**Author:** ![Julia](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/j/2bfe46/32.png) [@Julia](https://forum.xwiki.org/u/Julia)\
**Post date:** [August 6, 2024, 2:09pm UTC](https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632/7 "2024-08-06T14:09:49Z")

</div>

> [@vmassol](#):
>
> Sure, but that’s not what you asked 🙂 You asked for an OR.

Now I’m a little confused. At my XWiki instance…  
…the first line (LiveTable) is an AND  
…the second line (LiveData) is an OR

```auto
'extraParams': '&fieldName=value2&fieldName=value5'

```

shows all entries with value2 AND value5 in their specific fieldName (only possible if it is a multi select value).

```auto
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 😉

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [August 6, 2024, 2:45pm UTC](https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632/8 "2024-08-06T14:45:11Z")

</div>

haha, that’s interesting and something new to me 🙂

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=...`).

cc @mflorea and @mleduc who have worked on the implementation of LD. I’m curious to know if it’s something wanted or not and if it was wanted, we need to document it on [https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/](https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/)

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [August 6, 2024, 3:20pm UTC](https://forum.xwiki.org/t/livetable-displaying-pages-with-tag-1-or-tag-2-or/4632/9 "2024-08-06T15:20:36Z")

</div>

So here’s a nice solution proposed by @MichaelHamann that allows to use an OR on tags with LD to list documents containing a `XWiki.TagClass` xobject:

```auto
{{liveData
  id="documents"
  properties="tags,doc.name"
  source="liveTable"
  filters="tags=a&tags=b"
  sourceParameters="className=XWiki.TagClass&translationPrefix=platform.index."
}}
  {
  "meta": {
    "propertyDescriptors": [
      {
        "id": "tags",
        "visible": false
      }
    ]
  }
}
{{/liveData}}

```

EDIT: Added to [https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HExamples](https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HExamples)
