[xwiki-users] Trying to use $doc.documentReference as the documentTree root
I'm trying to list the children of the current page. According to this post: http://lists.xwiki.org/pipermail/users/2015-December/031639.html, I believe this should work, but all I get is "No pages found": {{velocity}} {{documentTree root="$doc.documentReference" /}} {{/velocity}} If I use {{velocity}} $doc.documentReference {{/velocity}}, the correct value is returned. Can anyone tell me what I'm doing wrong or if there is a better way to list all the children of the current page? Thanks, Jared -- View this message in context: http://xwiki.475771.n2.nabble.com/Trying-to-use-doc-documentReference-as-the... Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Jared,
On 22 Jul 2016, at 22:59, simmsj <[email protected]> wrote:
I'm trying to list the children of the current page. According to this post: http://lists.xwiki.org/pipermail/users/2015-December/031639.html, I believe this should work, but all I get is "No pages found":
{{velocity}}
{{documentTree root="$doc.documentReference" /}}
This is not correct, see http://extensions.xwiki.org/xwiki/bin/view/Extension/Document+Tree+Macro and especially the documentation for the “root” parameter at http://extensions.xwiki.org/xwiki/bin/view/Extension/Document+Tree+Macro#HPa... Namely: {{velocity}} {{documentTree root="document:$doc.documentReference" /}} {{/velocity}} FYI I’ve updated the page and added an example at http://extensions.xwiki.org/xwiki/bin/view/Extension/Document+Tree+Macro#HCh... Thanks -Vincent
{{/velocity}}
If I use {{velocity}} $doc.documentReference {{/velocity}}, the correct value is returned.
Can anyone tell me what I'm doing wrong or if there is a better way to list all the children of the current page?
Thanks, Jared
View this message in context: http://xwiki.475771.n2.nabble.com/Trying-to-use-doc-documentReference-as-the...
FYI I’ve also created and implemented http://jira.xwiki.org/browse/XWIKI-13588 Thanks -Vincent
On 22 Jul 2016, at 23:32, Vincent Massol <[email protected]> wrote:
Hi Jared,
On 22 Jul 2016, at 22:59, simmsj <[email protected]> wrote:
I'm trying to list the children of the current page. According to this post: http://lists.xwiki.org/pipermail/users/2015-December/031639.html, I believe this should work, but all I get is "No pages found":
{{velocity}}
{{documentTree root="$doc.documentReference" /}}
This is not correct, see http://extensions.xwiki.org/xwiki/bin/view/Extension/Document+Tree+Macro and especially the documentation for the “root” parameter at http://extensions.xwiki.org/xwiki/bin/view/Extension/Document+Tree+Macro#HPa...
Namely:
{{velocity}} {{documentTree root="document:$doc.documentReference" /}} {{/velocity}}
FYI I’ve updated the page and added an example at http://extensions.xwiki.org/xwiki/bin/view/Extension/Document+Tree+Macro#HCh...
Thanks -Vincent
{{/velocity}}
If I use {{velocity}} $doc.documentReference {{/velocity}}, the correct value is returned.
Can anyone tell me what I'm doing wrong or if there is a better way to list all the children of the current page?
Thanks, Jared
View this message in context: http://xwiki.475771.n2.nabble.com/Trying-to-use-doc-documentReference-as-the...
Thanks. That's working for me now. Having the Children macro will be helpful as well. Have a nice weekend -- View this message in context: http://xwiki.475771.n2.nabble.com/Trying-to-use-doc-documentReference-as-the... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (2)
-
simmsj -
Vincent Massol