Design - Forms

Edit | Tags | Source | Print

Posted 01 Sep 2009 13:21 by leigerleiger
A lot of people want support for data-entry using forms in Wikidot. What needs to be done first is to come up with the simplest way of doing this so that forms are as generalised as possible and can apply to a range of situations.

The proposal

Pages can be created using forms. These forms will look very similar to the MailForm module, except that when processed they will create pages instead of sending emails.

The idea is that forms will make creating pages a lot easier for people that don't know or need to learn the Wikidot syntax. It will also make sites look more professional.

Editing pages

This particular proposal involves the creation of pages only. For editing the page at a later date, we assume that the normal editor will be used.

Implementation

Forms will be related to the NewPage module. Syntax will be of this form:

[[module NewPage category="cat" parent="dad" tags="page" type="form" ]]
… Form contents here (refer to MailForm module) …
[[/module]]

However, there would be an extra section that defines what the code of the page will look like. Similar to the way templates work, it would pull the information from the form and add it to the page as defined by the form template. It could use %%form{x}%%, where x is the name of the entry field.

Prerequisites

Features that should be implemented prior to forms are those that it depends on. Some suggestions are listed below.

The auto-save feature (weneed #1)

The NewPage module should support the auto-save feature.

In this way, a form can be created and:

  • If auto-save is turned on, the user is shown the generated page after submitting the form
  • If auto-save is turned off (default), the user is shown the edit-page dialog to further refine the code after they have submitted the form

[[module NewPage … … type="form" autosave="true/false|yes/no|on/off" ]]

The more advanced meta data feature (design #5, weneed #85)

This feature basically says that we should be able to edit tags, parent, page unix name, and more from the editor. It would be done by including this at the beginning of the page:

[[meta]]
... meta data goes here ...
[[/meta]]

For forms, this would be very powerful. For example, using the templates mentioned above in the Implementation section, a form could be used to set the parent, by using this code:

[[meta]]
parent="%%form{parent}%%";
[[/meta]]

Add a New Comment