Parentschildrenlivetable displays nothing

I need some help understanding the parentschildrenlivetable macro. I’ve tried to create a new page inside my space, as a blank page. Inside that I added (with the WYSIWYG editor) the parent-child livetable macro, left the “space” blank. Saved.

Then created a new blank page with title “test child” under that first page. Shows as a child page under the first page. But the livetable is blank, no entries.

How can I use something like the parentschildrenlivetable macro to create a list of direct children of, like, an index page? Do I misunderstand the purpose of the macro, or do I have to create the parent or children pages specially?

Any help understanding this would be appreciated.
-Alan

Hi, could you explain what is the “parentschildrenlivetable”? This doesn’t seem to be something provided in XWiki Standard, nor an extension supported by the xwiki dev team, and I don’t know about it. Thx

ok found it: https://extensions.xwiki.org/xwiki/bin/view/Extension/Parent-Children%20Livetable%20macro

Right, that’s the extension in question. Although, maybe it’s old and doesn’t work right with recent XWiki versions…?

I’ve tried a few ways to create what I want, especially trying to find a way my users can use without a lot of sophistication, to create a nice dynamic child-page index page. The “children” macro works fine, except it doesn’t create a nice filterable table of pages (just a tree-like page name list).

If there’s a better or better-supported way to do this, ,I’m happy to use that instead of this extension… hoping someone can either guide me to use the above extension, or point me to a better way to accomplish it.
-Alan

Anyone have any comments on best way to create a dynamic index page for child pages? One that looks like a live table with name, date, author, etc?

Maybe the document macro?

https://extensions.xwiki.org/xwiki/bin/view/Extension/Documents%20Macro

That looks like an option, don’t understand why it doesn’t show as a choice in the WYSIWYG editor macro list…

But still need advice. If I just include that, I get a list of all pages. Is there some idiom to tell it “children of the current page?” It looks like it needs a “location” parameter, but not sure what to put for that.

I guess setting the parent= option to the index page’s path + .WebHome works. I had hoped there was some simple way to reference the page containing the macro instead of having to specifically call out the page name/path.

OK, I see what I missed in the macro document. Wish it were a little easier for users to do this, but guess it’s a teaching opportunity.

Thanks for the reference to the documents macro.
-Alan

Well, wait. I just tried this on a page in our wiki instead of the {{children} macro. The children macro showed 32 documents. The {{documents}} macro only listed 13 pages. Makes no sense but the {{documents}} macro misses a lot of children…

The pages are listed in the children viewer of the page, and I can’t see any reason the macro wouldn’t see them. Is this a bug?

Used the code:

{{velocity}}
{{documents actions=false count=20 columns="doc.title,doc.date,doc.author" parent="$doc.fullName"}}{{/documents}}
{{/velocity}}

No but you need to read the doc carefully.

See https://extensions.xwiki.org/xwiki/bin/view/Extension/Documents%20Macro#HUsage

For example:

  • parent (optional and deprecated): If specified, only list pages having the specified parent (by default all documents are listed). Doesn’t work with Nested Pages, use the location parameter instead.

Yet you’ve used it in your example and since you have nested pages, it didn’t work of course :slight_smile:

Which begs the question then… what DOES work in such a context (nested pages)? Or alternatively, how do I set up a context in which something would work?

I’d really love to improve the doc but how can it be more explicit than:

Doesn’t work with Nested Pages, use the location parameter instead.

?

There’s even an example on that page…

I keep looking at that page, looking for an example of a location= parameter that shows how to reference the parent, or to at least filter the pages that are children of the current page. The one example seems to filter pages that have “Draft” in the path. All the other examples are deprecated.

So back to a question I asked several cycles back… what would the location= parameter look like to say “children of this page”?

I mean, I really am looking at the document, but I just don’t see an answer to that.

You can’t really say “children of the page” but you can see pages having this part in their reference.

Let’s say your pages are inside a page named “Page1”, so their full references are “Page1.PageN.PageP”.

You would use location="Page1.".

Of course, and that’s the limit of this, if you have another reference named SomeOtherPage.Page1.Whatever then you’d also get that to match so you need to find a pattern that matches only what you need.

There’s currently no real support of exact children pages in this {{documents}} macro.

Only thing missing is a way to indicate the start of the reference with something like location="^Page1." which would indicate the start of the reference.

Or a startsWith parameter such as startsWith="Page1.".

FTR I’ve found the jira issue about this: https://jira.xwiki.org/browse/XWIKI-13652

The problem with location=, in addition to to the reference match issue you mention, is what you might mean by “exact children”… if I use the location pattern to match the parent page path, the resulting page list includes the parent page too. I wanted only the children, not children+parent.

I’ve commented at https://jira.xwiki.org/browse/XWIKI-13652?focusedCommentId=102004&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-102004