# Problem making a Comments table

**URL:** <https://forum.xwiki.org/t/problem-making-a-comments-table/9681>\
**Category:** Help / Discuss\
**Created:** [January 12, 2022, 12:54pm UTC](https://forum.xwiki.org/t/problem-making-a-comments-table/9681 "2022-01-12T12:54:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarantis](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/s/e99b99/32.png) [@Sarantis](https://forum.xwiki.org/u/Sarantis)\
**Post date:** [January 12, 2022, 12:54pm UTC](https://forum.xwiki.org/t/problem-making-a-comments-table/9681/1 "2022-01-12T12:54:24Z")

</div>

Hello all.  
I have the following problem:  
I’m new in XWiki and i want to make a table like _Xwiki.XWikiComments_ page, but i don’t know how to do this.

1. I have to use Documents Macro or Livetable Macro?
2. And where i can find a **how to** for calling the comments or/and comments count in a column?

- I have already found informations for authors, attachments, tags, etc. but not for comments.

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [January 12, 2022, 1:19pm UTC](https://forum.xwiki.org/t/problem-making-a-comments-table/9681/2 "2022-01-12T13:19:06Z")

</div>

Hello @Sarantis,

Please describe further your usecase if you wish to have a more precise answer 🙂  
Also, which XWiki version are you running?

I’ve pasted below the Live Data macro declaration to list the comments. For me details, please refer to the [Live Data macro documentation](https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/).

```auto
{{liveData 
  id="classEntries"
  properties="doc.title,doc.location,doc.date,doc.author,doc.objectCount,_actions"
  source="liveTable"
  sourceParameters="className=XWiki.XWikiComments&translationPrefix=platform.index.&queryFilters=unique"
}}
{
  "meta": {
    "propertyDescriptors": [
      {
        "id": "doc.title",
        "editable": false
      },
      {
        "id": "doc.objectCount",
        "editable": false,
        "filterable": false,
        "sortable": false
      }
    ]
  }
}
{{/liveData}}

```

---

<div class="post-metadata">

**Author:** ![Sarantis](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/s/e99b99/32.png) [@Sarantis](https://forum.xwiki.org/u/Sarantis)\
**Post date:** [January 12, 2022, 4:22pm UTC](https://forum.xwiki.org/t/problem-making-a-comments-table/9681/3 "2022-01-12T16:22:33Z")

</div>

Thank you for your reply, that almost solve my problem. I use XWiki 13.8 .  
I have missed out the **Live Data Macro** and also the

```auto
translationPrefix=platform.index.

```

I try to make two tables:

1. like the XWiki.XWikiComments with comment count
2. With all comments of my wiki, sorting by date, with the text of comments on one column of the table(I have also try this but i get only the first comment per page, but “n” times where “n” the number of comments per page)  
 ![comments_table](https://forum.xwiki.org/uploads/default/original/2X/6/6164b27e794cfeb9be7c7e9a29b411ebdf0f72e6.png)

![comments_table1](https://forum.xwiki.org/uploads/default/original/2X/9/9bec2b66171cdfeac5d1ed94f69ea6b4be25f11d.png)

---

<div class="post-metadata">

**Author:** ![mleduc](https://forum.xwiki.org/user_avatar/forum.xwiki.org/mleduc/32/2328_2.png) [@mleduc](https://forum.xwiki.org/u/mleduc)\
**Post date:** [January 14, 2022, 8:20am UTC](https://forum.xwiki.org/t/problem-making-a-comments-table/9681/4 "2022-01-14T08:20:55Z")

</div>

I believe the example proposed above matches the requirements for your first table, see the `doc.objectCount` property contains the number of comments of each page.  
For you second table, you simple have to:

- remove the `doc.objectCount` property
- remove the `source=unique` source parameter (which allows to group the object per page and to count them)
- add a `comment` property

See the result below:

```auto
{{liveData
  id="classEntries"
  properties="doc.title,doc.location,doc.date,doc.author,comment,_actions"
  source="liveTable"
  sourceParameters="className=XWiki.XWikiComments&translationPrefix=platform.index."
}}
{
  "meta": {
    "propertyDescriptors": [
      {
        "id": "doc.title",
        "editable": false
      }
    ]
  }
}
{{/liveData}}

```

---

<div class="post-metadata">

**Author:** ![Sarantis](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/s/e99b99/32.png) [@Sarantis](https://forum.xwiki.org/u/Sarantis)\
**Post date:** [January 20, 2022, 10:29am UTC](https://forum.xwiki.org/t/problem-making-a-comments-table/9681/5 "2022-01-20T10:29:57Z")

</div>

Hello @mleduc,thank you for your reply and sorry for the delay. I had a full week.  
I had made that changes and the result was the [above](https://forum.xwiki.org/t/problem-making-a-comments-table/9681/3), i think that on XwikiComments class properties must need some changes. But this is beyond my knowledge so i’ll go with my first option for now.  
Thank you very much for your help!

---

<div class="post-metadata">

**Author:** ![hrapitan](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/h/f19dbf/32.png) [@hrapitan](https://forum.xwiki.org/u/hrapitan)\
**Post date:** [February 12, 2025, 11:09am UTC](https://forum.xwiki.org/t/problem-making-a-comments-table/9681/6 "2025-02-12T11:09:43Z")

</div>

Hi everyone!

I’m trying the [second recipe by mleduc](https://forum.xwiki.org/t/problem-making-a-comments-table/9681/4), but there is a problem: it does not differentiate between reply comments by date, author or content.  
Example:

 ![photo_2025-02-12_14-07-47](https://forum.xwiki.org/uploads/default/original/2X/f/fdf5ce78c460aed94db178999a0c816b3814ce51.jpeg)

As you can see, there are 4 comments (including 2 replies) on the page from two users, and in the macro they are displayed as four instances of one comment, created at the same time by one author (User\_01).

XWIKI version 16.10.3

Can anyone help with this, please?
