HowToCreateADocumentTemplate

Last modified by Vincent Massol on 2008/04/21

Question How to create a document template ?
Answer

To create and use a document template:

  • create a standard wiki document for your template
  • use the following HTML to allow the creation of a document from your template:
#includeTopic("xwiki:XWiki.XWikiCommonJavascript")
<form action="" id="newdoc">
<input type="hidden" name="parent" value="${doc.fullName}" />
<input type="hidden" name="template" value="XWiki.YourTemplateName" />
<input type="hidden" name="webname" value="Main" size="8" />
Title: <input type="text" name="name" value="Name of your document" />
<br />
<br />
<input type="button" value="Create this document" onclick='if (updateName(this.form.name)) {this.form.action="../../inline/" + this.form.webname.value + "/" + this.form.name.value; this.form.submit(); }'>
</form>

Get Connected