Parentschildrenlivetable displays nothing

Note that a very simple workaround FTM could be to use the following content in the page for which you wish to display its children:

{{template name="children.vm"/}}

And if you need customizations you could copy the children.vm content into the page or into a new wiki macro…

{{velocity}}
{{html}}
#set ($collist = ['doc.title', 'doc.location', 'doc.date', 'doc.author', '_actions'])
#set ($colprops = {
  'doc.title'    : { 'link' : 'view' },
  'doc.author'   : { 'link' : 'author', 'type': 'text', 'filterable': true},
  'doc.location' : { 'type': 'text', 'filterable': true, 'html': true},
  '_actions'     : { 'actions': ['copy', 'rename', 'rights', 'delete'] }
})
#set ($urlParameters = "xpage=getdocuments&childrenOf=$escapetool.url($doc.space)&queryFilters='unique'")
#set ($options = {
  'url' : "$doc.getURL('get', $urlParameters)",
  'selectedColumn' : 'doc.location',
  'translationPrefix' : 'platform.index.',
  'outputOnlyHtml' : true
})
#livetable('childrenIndex' $collist $colprops $options)
{{/html}}
{{/velocity}}

EDIT: I took the content of children.vm and make it minimal for you in the pasted code above.

1 Like

Thanks. Tried the {{template}} idea, but it created a messy copy of the children viewer page inside the page, looked really bad.

The other idea with the velocity macro is much better, except it includes a “page administration” (WebPreferences) entry in the list as well as the children. Must be something funny with the query…

Got it to work. Needed the ‘hidden’ parameter in there.
Was able to create a global macro to do what I needed.
Thanks for the hints.

Hello @vmassol :slight_smile: how to ignore hidden pages ?

I tried this but doesn’t work (WebPreference page are displayed)

{{velocity}}
{{html}}
#set ($collist = ['doc.title', 'doc.location', 'doc.date', 'doc.author', '_actions'])
#set ($colprops = {
  'doc.title'    : { 'link' : 'view' },
  'doc.author'   : { 'link' : 'author', 'type': 'text', 'filterable': true},
  'doc.location' : { 'type': 'text', 'filterable': true, 'html': true},
  '_actions'     : { 'actions': ['copy', 'rename', 'rights', 'delete'] }
})
#set ($urlParameters = "xpage=getdocuments&childrenOf=$escapetool.url('MyWiki.Section1.Category1')&queryFilters='unique'&queryFilters='hidden'")
#set ($options = {
  'url' : "$doc.getURL('get', $urlParameters)",
  'selectedColumn' : 'doc.location',
  'translationPrefix' : 'platform.index.',
  'outputOnlyHtml' : true
})
#livetable('childrenIndex' $collist $colprops $options)
{{/html}}
{{/velocity}}

This code works but I can’t specify specific page, it take current page :

{{velocity}}
## Source : https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/children.vm
{{html wiki='true'}}  

  
    ##
    ## List the children documents using a livetable
    ##
    #set ($queryFilters = 'unique,hidden')    
    ## Sets allowProperty to the empty value for the copy action to preserve the livetable behavior where an action with an
    ## undefined rights was implicitly allowed as long as it was not an admin action (admin, rename, or rights).
    
    #set ($sourceParameters = $escapetool.url({
      'template' : 'getdocuments.vm',
      'translationPrefix' : 'platform.index.',
      'queryFilters': $queryFilters,
      '$doc': 'MyWiki.Section1.Category1'
    }))
    {{liveData
      id='childrenIndex'
      source='liveTable'
      sourceParameters="$sourceParameters"
      properties='doc.title,doc.location,doc.date,doc.author,_actions'
      sort='doc.location:asc'
      }}{{/liveData}}
  
{{/html}}
{{/velocity}}

How to specify page ?