Have one topic which creates another

  • Tip Category - Developing Wiki Applications
  • Tip Added By - RichMorin - 29 Sep 2009 - 04:06
  • Extensions Used - None
  • Useful To - Beginners
  • Tip Status - New
  • Related Topics -

Problem

You want one topic to create another (new) topic.

Context

The creating topic (optionally) collects some information from the user, then directs the wiki to generate a new topic with a specified name, template, etc.

Solution

Use an HTML form to collect any desired user data; direct the action at the wiki's "save" command.

The creating topic (optionally) collects some information from the user, then generates a URL for the new topic. When the user clicks a button, the HTML form's action sends the user to the wiki's "save" command. Associated parameters tell the wiki what information to include, what template to use, etc.

<form     name="fooform" method="post" action="%SCRIPTURL%/save/%WEB%/%URLPARAM{"topic"}%">
<input    name="templatetopic" value="FooTemplate"            type="hidden" />
<input    name="formtemplate"  value="FooForm"                type="hidden" />
<input    name="topic"         value="type topic name here"   type="text">
<textarea name="text"       rows="4" cols="60"></textarea>
<input type="submit">
</form>

Known Uses

  • Creating topics with a consistent format for viewing.
  • Creating topics containing specific metadata.

Known Limitations

See Also

BestPracticeTipsForm edit

Category Developing Wiki Applications
Topic revision: r6 - 09 Dec 2009, PaulHarvey - This page was cached on 17 Nov 2018 - 19:57.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy