Using XWiKi Cloud, I created a template and added objects to it (XWiKiRights in this case). The goal is to restrict viewing rights for the pages that are created based on the template to specific user groups.
The problem is, that pages that are created based on the template using the wizard do not contain the objects that have been added to the template. They are not copied from the template to the page for some reason.
Any help much appreciated!
Thanks!
Hello,
Do pages created with your template have the expected text content, but none of the objects on the template page? Does this happen with other objects too (ex. XWiki.TagClass)?
Could you share some screenshots of the objects on each page? (template page, template provider page, new page created through the template)
Pages created through a template should indeed have all objects that the template page has. I tried doing the steps in the Template Provider tutorial on a local XWiki 16.10.15, and for me the rights are applied.
Some causes I can think of why the objects aren’t created:
- Maybe the Template Provider page doesn’t have the right reference to the template page? If you have pages with the same title but in different spaces, it’s easy to confuse them
- Maybe the Template Provider has a similar name to another existing Template Provider, so they are confused (or if you have visibility restrictions set in the Template Provider, maybe your provider doesn’t show up at all?)
- The XWikiRights object is not on the template page for some reason (so the page which is referenced in the Template Provider as “Template to use“/”Template” contains no object)
- If the XWikiRights object is inherited in the template page from a parent page, then it would seem like the rights are applied, but the object isn’t actually on the page.
- I really don’t think this is the case, but if any of the pages has special characters (~ \[ \] . \\) , XWiki might be interpreting the title as XWiki syntax
It’s odd, if the objects exist in the template page they should also exist on the pages created with that template.
We have specific checks for rights objects to avoid that users modify rights in a way that gives them more rights than they currently have. In this case, all right changes are reverted (in the case of a new document, all rights objects would be removed). Have you tested using the template with an admin account?