[xwiki-users] creating a "standard" document using a form
Robin Fernandes
rewbs.soal at gmail.com
Fri Jul 28 11:37:27 CEST 2006
So you just want a form to create new documents, rather than inserting
& clicking links to non-existent documents? How about this:
#set($parent="$doc.fullName")
#set($defaultSpace="SandBox")
#set($defaultDocument="NewDocument")
#includeTopic("xwiki:XWiki.XWikiCommonJavascript")
<form action="">
<input type="hidden" name="parent" value="$parent">
Space: <input type="text" name="spacename" value="$defaultSpace">
Document: <input type="text" name="docname" value="$defaultDocument"
onchange="updateName(this)">
<br />
<br />
<input type="button" value="Create this Document"
onclick='action="../../edit/" + this.form.spacename.value + "/" +
this.form.docname.value; this.form.submit();'>
</form>
I think your mistake was to use the 'inline' action (which is for
editing a document's objects/metadata) instead of 'edit'. Note that
you'll then end up with "orphaned" documents, unless you take measures
to link to them from somewhere.
Regards,
Robin
On 28/07/06, Michael Redinger <Michael.Redinger at uibk.ac.at> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> in the standard XWiki installation, there is a form in the menu to add
> news. This form uses the article template.
> How do I add a form that uses no special template? I.e. I want to get
> the same page I get when creating a new, empty document
> (edit/Main/NotExistingDocument)?
>
> I found HowToCreateADocumentTemplate and DocumentTemplateExample. But
> when I use this, a document is created from this template, but the user
> does not get the textarea (or WYSIWYG editor) to actually change the
> document:
>
> #includeTopic("xwiki:XWiki.XWikiCommonJavascript")
> <form action="" id="newdoc">
> <input type="hidden" name="parent" value="${doc.fullName}" />
> <input type="hidden" name="template" value="Doc.ExampleTemplate" />
> <input type="hidden" name="webname" value="Doc" 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>
>
>
> Thanks,
> Michael
>
>
>
>
> - --
> Michael Redinger
> Zentraler Informatikdienst (Central IT Services)
> Universitaet Innsbruck
> Technikerstrasse 13 Tel.: ++43 512 507 2335
> 6020 Innsbruck Fax.: ++43 512 507 2944
> Austria Mail: Michael.Redinger at uibk.ac.at
> BB98 D2FE 0F2C 2658 3780 3CB1 0FD7 A9D9 65C2 C11D
> http://homepage.uibk.ac.at/~c102mr/mred-pubkey.asc
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.4 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
>
> iD8DBQFEyc8GD9ep2WXCwR0RAtnhAJ4wAu/GzeJ9XmiPW6UMuvihJR7kJQCgp0mM
> qlDlxoJA3mBSwimM+d4ijmM=
> =JwLV
> -----END PGP SIGNATURE-----
>
>
>
>
> --
> You receive this message as a subscriber of the xwiki-users at objectweb.org mailing list.
> To unsubscribe: mailto:xwiki-users-unsubscribe at objectweb.org
> For general help: mailto:sympa at objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>
More information about the users
mailing list