|
META TOPICPARENT | name="WebHome" |
|
|
< < | Form Templates |
> > | TWiki Form Templates |
| |
|
< < | Include form-based input in topics, with unlimited, user-selectable forms per web; values stored as Meta Data |
> > | Form-based input in topics, with name/value pairs stored as Meta Data variables; multiple forms per web & topic |
| Overview
By adding form-based input to free-form content, you can structure topics with unlimited, easily searchable categories. When forms are enabled for a web and selected in a topic, the form appears in edit mode, and the contents are rendered as a table when viewing the actual page. When editing, can switch forms, if more than one is defined, or remove forms entirely. Form input values are stored as TWikiMetaData; all data is saved. |
|
< < | Form Templates replace TWikiCategory Tables from the previous version of TWiki. |
> > | Form Templates replace TWikiCategory Tables from the 01-Dec-2000 version of TWiki.
Changes from the Category Table System
Form Templates more powerful, flexible replacement for the original TWikiCategoryTable. Data from existing category tables can be imported directly.
Main changes from TWikiCategoryTable:
Form Templates | Category Tables |
defined in topics | defined in templates |
many forms per web | one table per web |
saved as Meta Data | saved as HTML |
Change & Add Form buttons | UseCategory radio button |
Importing Existing Category Table Data
On upgrading from the previous TWiki, a Form Template topic has to be built for each web that used a Category Table, recreating the fields and values from the old twikicatitems.tmpl . The replacement Form Template must be set as the first item in the WebPreferences variable =WEBFORM . If missing, pages will display, but attempting to edit results in an error message.
The new Form Template system should work with old Category Table data with no special conversion. Data is assigned to Meta variables the first time an imported topic is edited and saved in the new system.
NOTE: If things aren't working correctly, there may be useful entries in data/warning.txt . |
| Form Template Elements |
|
- Save the topic.
|
|
< < | Example: Form Template |
> > | Example: WebFormTemplate from the TWiki.Know web |
| |
|
< < |
|
> > |
| TopicClassification? | select | 1 | NoDisclosure? ,
PublicSupported? , PublicFAQ? | blah blah... |
| OperatingSystem? | checkbox | 3 | OsHPUX? , OsLinux? ,
OsSolaris? , OsWin? | blah blah... |
OsVersion? | text | 16 | | blah blah... |
|
|
Defining a Form in One Topic |
|
< < | Example: WebFormTemplate of the TWiki.Know web: |
> > |
Example: WebFormTemplate from the TWiki.Know web |
| |
|
< < |
|
> > |
|
|
TopicClassification? | select | 1 | NoDisclosure? , PublicSupported? , PublicFAQ? | blah blah... |
OperatingSystem? | checkbox | 3 | OsHPUX? , OsLinux? , OsSolaris? , OsWin? | blah blah... |
OsVersion? | text | 16 | | blah blah... |
|
|
> > | |
| Defining a Form in Multiple Topics |
|
< < | The form template can also be defined in an alternative way by using more then one topic: |
> > | The Form Template can also be defined in an alternative way by using more then one topic: |
| |
|
< < |
- A form template topic defines the form
- Values of fields that have more then one value, e.g. of type radio, select and checkbox can be defined by field value template topics
|
> > |
- A Form Template topic defines the form.
- Values of fields that have more then one value - radio, select, checkbox - can be defined by field value Template topics.
|
| |
|
< < |
Code from: |
> > |
Code from: |
|
- WebFormTemplate of the TWiki.Know web:
|
|
< < |
|
> > |
|
|
TopicClassification? | select | 1 | | blah blah... |
OperatingSystem? | checkbox | 3 | | blah blah... |
OsVersion? | text | 16 | | blah blah... |
- TopicClassification topic:
|
|
< < |
|
> > |
|
|
NoDisclosure? | option | blah blah... |
PublicSupported? | option | blah blah... |
PublicFAQ? | option | blah blah... |
|
|
- A default Form Template (new topics get this default form) can be provided by creating the
WebTopicEditTemplate topic in a web and adding a form to it. Initial Form values can be set there.
|
|
< < |
- Addtionaly a new topic can be given a form using the
formtemplate parameter in the URL. Initial values can then be provided in the URLs or as form values. Names being:
- Not checkboxes - name e.g. ?BugPriority=1
- Checkbox - namevalue=1 e.g. ?ColourRed=1. Note that all boxes with a tick must be specified.
|
> > |
- Additionally a new topic can be given a Form using the
formtemplate parameter in the URL. Initial values can then be provided in the URLs or as form values:
- other than checkboxes:
name , ex: ?BugPriority=1
- checkbox:
namevalue=1 , ex: ?ColourRed=1 . Boxes with a tick must be specified.
|
| Creating New Topics with Forms |