How can I create a terminal page in velocity

Hi there!
I am diddling around, creating something awesome on XWiki (at least that’s what I am convinced of) but now I ran into something I am not able to find any resource on; the creation of a terminal page in velocity.
I wonder if anyone could help me out with this. Is it even possible?
Thanks in advance,
JP

Well, that is an awkward situation. It appears that if I put a single page in the getDocument call (like $xwiki.getDocument("myPage")) it was not making the page. If I called it with the webhome child page it worked (like $xwiki.getDocument("myPage.WebHome")).

BUT
When I called it with the spaces that are used in the eventual environment like ($xwiki.getDocument("mainSpace.subSpace.myPage")) where the velocity is being used in it worked like a charm.

I did not know that. Yet another thing learned :tada:

Thanks anyway :slight_smile:

:slight_smile:

Here’s an example: Scripting API Guide (XWiki.org)

The parameter is a reference. See https://extensions.xwiki.org/xwiki/bin/view/Extension/Model%20Module

If you pass just “myPage”, it’s going to be resolved to the current wiki/space/etc.

You can try it with:

{{velocity}}
#set ($d = $xwiki.getDocument("myPage"))
$d.documentReference
{{/velocity}}
1 Like