Hello all,
I have an issue with some Velocity code I got from here --->
http://extensions.xwiki.org/xwiki/bin/view/Extension/Create+Page+With+Object
When the code runs the resulting page is created and the template is used, but none of my
users can edit the page after (not even the admin). It looks like the template page was
actually included in the page, not that the page was created "from" the
template.
Here is the code I'm using:
{{velocity}}
#set($newDoc = $xwiki.getDocument("Sandbox.TestPage"))
$newDoc.setTitle("TestPage")
$newDoc.setParent("Sandbox.WebHome")
$newDoc.setContent('{{include document="Templates.TemplateToUse"/}}')
$newDoc.save()
{{/velocity}}
When I go to my space and create a new page manually and select to use a template for the
new page the resulting page CAN be edited appropriately using the EXACT SAME TEMPLATE, so
I'm very confused.
Any help is greatly appreciated