[xwiki-users] Document Tree set Root to Current page (take 2)
Hello, Searching through the web I found the following mailing list thread: http://comments.gmane.org/gmane.comp.web.wiki.xwiki.user/28977 Which solves my problem exactly, with one minor caveat: the enterprise XWiki installation I'm using has Velocity macros disabled for average users. Therefore, what is the equivalent of Velocity's $doc.documentReference in XWiki syntax (i.e. node id reference). Best regards. -- Isaac Jurado "The noblest pleasure is the joy of understanding" Leonardo da Vinci
On Tue, Jun 14, 2016 at 12:31 PM, Isaac Jurado <[email protected]> wrote:
Hello,
Searching through the web I found the following mailing list thread:
http://comments.gmane.org/gmane.comp.web.wiki.xwiki.user/28977
Which solves my problem exactly, with one minor caveat: the enterprise XWiki installation I'm using has Velocity macros disabled for average users.
Therefore, what is the equivalent of Velocity's $doc.documentReference in XWiki syntax (i.e. node id reference).
You can either hard-code the full reference of the current document (wiki:Path.To.Page) if it's not dynamic, otherwise, you can create a wiki macro http://platform.xwiki.org/xwiki/bin/view/DevGuide/WikiMacroTutorial that uses Velocity. Your average users will have to use this "currentDocumentTree" macro. Hope this helps, Marius
Best regards.
-- Isaac Jurado
"The noblest pleasure is the joy of understanding" Leonardo da Vinci _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On Tue, Jun 14, 2016 at 11:42 AM, Marius Dumitru Florea < [email protected]> wrote:
On Tue, Jun 14, 2016 at 12:31 PM, Isaac Jurado <[email protected]> wrote:
Hello,
Searching through the web I found the following mailing list thread:
http://comments.gmane.org/gmane.comp.web.wiki.xwiki.user/28977
Which solves my problem exactly, with one minor caveat: the enterprise XWiki installation I'm using has Velocity macros disabled for average users.
Therefore, what is the equivalent of Velocity's $doc.documentReference in XWiki syntax (i.e. node id reference).
You can either hard-code the full reference of the current document (wiki:Path.To.Page) if it's not dynamic, otherwise, you can create a wiki macro http://platform.xwiki.org/xwiki/bin/view/DevGuide/WikiMacroTutorial that uses Velocity. Your average users will have to use this "currentDocumentTree" macro.
As I mentioned, our users don't have permission to use the {{velocity}} macro so anything related to Velocity is out of the equation. On the other hand I think I'm failing to understand the "root" parameter of the {{documentTree}} macro: http://extensions.xwiki.org/xwiki/bin/view/Extension/Document+Tree+Macro Given that I have the following path: MyRoot.MyPage.MyChild If I want to show the Document Tree rooted at MyPage, I'm trying something like: {{documentTree root="document:xwiki:MyRoot.MyPage" hierarcyMode="parentchild" /}} And also: {{documentTree root="document:xwiki:MyRoot.MyPage" hierarcyMode="parentchild" /}} And neither of those show any children, when the expectation was to see "MyChild". Thank you for your support. Best regards.
On Tue, Jun 14, 2016 at 1:14 PM, Isaac Jurado <[email protected]> wrote:
On Tue, Jun 14, 2016 at 11:42 AM, Marius Dumitru Florea < [email protected]> wrote:
On Tue, Jun 14, 2016 at 12:31 PM, Isaac Jurado <[email protected]> wrote:
Hello,
Searching through the web I found the following mailing list thread:
http://comments.gmane.org/gmane.comp.web.wiki.xwiki.user/28977
Which solves my problem exactly, with one minor caveat: the enterprise XWiki installation I'm using has Velocity macros disabled for average users.
Therefore, what is the equivalent of Velocity's $doc.documentReference in XWiki syntax (i.e. node id reference).
You can either hard-code the full reference of the current document (wiki:Path.To.Page) if it's not dynamic, otherwise, you can create a wiki macro http://platform.xwiki.org/xwiki/bin/view/DevGuide/WikiMacroTutorial that uses Velocity. Your average users will have to use this "currentDocumentTree" macro.
As I mentioned, our users don't have permission to use the {{velocity}} macro so anything related to Velocity is out of the equation.
The {{documentTree}} is a wiki macro that uses the {{velocity}} macro https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwik... so if your users can use it then they can also use the "currentDocumentTree" wiki macro I described above.
On the other hand I think I'm failing to understand the "root" parameter of the {{documentTree}} macro:
http://extensions.xwiki.org/xwiki/bin/view/Extension/Document+Tree+Macro
Given that I have the following path:
MyRoot.MyPage.MyChild
If I want to show the Document Tree rooted at MyPage, I'm trying something like:
{{documentTree root="document:xwiki:MyRoot.MyPage" hierarcyMode="parentchild" /}}
And also:
{{documentTree root="document:xwiki:MyRoot.MyPage" hierarcyMode="parentchild" /}}
I don't see any difference.
And neither of those show any children, when the expectation was to see "MyChild".
You are mixing things. You should read http://platform.xwiki.org/xwiki/bin/view/Features/ContentOrganization/Nested... . The "parentchild" hierarchy mode that you're using is not based on the page reference ("MyRoot.MyPage.MyChild"). You shouldn't use hierarcyMode="parentchild" unless you are migrating from an older version of XWiki and you want to preserve your hierarchy. But since you are using nested pages (MyRoot.MyPage.MyChild) I doubt this is the case.
Thank you for your support. Best regards. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi, On Tue, Jun 14, 2016 at 1:14 PM, Isaac Jurado <[email protected]> wrote:
On Tue, Jun 14, 2016 at 11:42 AM, Marius Dumitru Florea < [email protected]> wrote:
On Tue, Jun 14, 2016 at 12:31 PM, Isaac Jurado <[email protected]> wrote:
Hello,
Searching through the web I found the following mailing list thread:
http://comments.gmane.org/gmane.comp.web.wiki.xwiki.user/28977
Which solves my problem exactly, with one minor caveat: the enterprise XWiki installation I'm using has Velocity macros disabled for average users.
Therefore, what is the equivalent of Velocity's $doc.documentReference in XWiki syntax (i.e. node id reference).
You can either hard-code the full reference of the current document (wiki:Path.To.Page) if it's not dynamic, otherwise, you can create a wiki macro http://platform.xwiki.org/xwiki/bin/view/DevGuide/WikiMacroTutorial that uses Velocity. Your average users will have to use this "currentDocumentTree" macro.
As I mentioned, our users don't have permission to use the {{velocity}} macro so anything related to Velocity is out of the equation.
It is not clear what you want to achieve. If you are a wiki admin and have received complains that your users can not use the {{documentTree}} in order to create some content that displays the document tree for the current document, then your solution, again, as a wiki admin, is to create a very small "currentDocumentTree" macro which is tailor-made for this particular usecase and which you can recommend to your users to use in their plain-wiki content instead of the default "documentTree" macro. A user without "script" rights is able to successfully use macros (even if the macros contain scripts), as long as the macros are created and saved by a user with script rights (e.g. an admin) and that has set the macro to be visible to the entire wiki (i.e. other users). However, if your situations if that of being a regular user in a wiki where the admin did you give you "script" rights, then unfortunately the wiki syntax [1] does not have such a construct, since it is something that is achievable either through scripting or through (installed/pre-built/available) wiki macros (as detailed above and in the reply from Marius). Hope this makes it clearer. Thanks, Eduard ---------- [1] http://platform.xwiki.org/xwiki/bin/view/Main/XWikiSyntax
On the other hand I think I'm failing to understand the "root" parameter of the {{documentTree}} macro:
http://extensions.xwiki.org/xwiki/bin/view/Extension/Document+Tree+Macro
Given that I have the following path:
MyRoot.MyPage.MyChild
If I want to show the Document Tree rooted at MyPage, I'm trying something like:
{{documentTree root="document:xwiki:MyRoot.MyPage" hierarcyMode="parentchild" /}}
And also:
{{documentTree root="document:xwiki:MyRoot.MyPage" hierarcyMode="parentchild" /}}
And neither of those show any children, when the expectation was to see "MyChild".
Thank you for your support. Best regards. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (3)
-
Eduard Moraru -
Isaac Jurado -
Marius Dumitru Florea