|
META TOPICPARENT |
name="WebHome" |
|
| Form Templates replace TWikiCategory Tables from the 01-Dec-2000 version of TWiki.
|
|
< < | Changes from the Category Table System |
> > | Main Changes from Category Tables |
|
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 |
> > | Importing 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. |
|
NOTE: If things aren't working correctly, there may be useful entries in data/warning.txt . |
|
< < | Form Template Elements |
> > | Defining a Form Template
A Form Template is simply a page containing your form, defined in a table where each row is one form field.
Form Template Elements |
|
- form template - a set of fields defining a form (replaces category table definition)
- A web can use one or more form templates.
|
|
-
- textarea - a text box; size is 40x10 (columns x rows)
- field value - one or more values from a fixed set (select, checkbox, radio type) or free-form (text). (replaces category item value)
|
|
< < | Defining a Form Template
A Form Template is simply a page containing your form, defined in a table where each row is one form field. |
> > | Defining a Form in One Topic |
|
- Create a new topic with your Form name: MyForm, ExpenseReport, InfoCategory, RecordReview, whatever you need.
- Create a TWiki table, with each column representing one element of an entry field: Name, Type, Size, Values, and Tooltip msessage (see sample below).
|
| OsSolaris , OsWin | blah blah... |
|
|
< < |
Defining a Form in One Topic
Example: WebFormTemplate from the TWiki.Know web |
|
|
|
|
|
< < | Defining a Form in Multiple Topics |
> > | Defining a Form with Multiple Topics |
|
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 - radio, select, checkbox - can be defined by field value Template topics.
|
> > |
- A Form Template topic defines the Form.
- Fields that have more then one value - radio, select, checkbox - can be defined in individual field value topics.
|
|
|
|
< < | Code from: |
> > | Example: WebFormTemplate |
| |
|
< < |
- WebFormTemplate of the TWiki.Know web:
|
> > |
- Know.WebFormTemplate Form main definition:
|
|
|
|
< < |
|
> > |
|
| |
|
< < |
- TopicClassification topic:
|
> > |
- Know.TopicClassification field value definition:
|
|
|
|
< < | Implementation Notes
-
- This format allows you to define field items with / without WikiNames, depending on your needs.
|
> > |
- Implementation Notes: This format allows you to define field items with or without WikiNames, depending on your needs.
|
|
-
- The topic can be protected in the usual manner so that not everybody can change the form template - see TWikiAccessControl
|
|
-
- 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 |
> > | Including Forms in New Topics
When you create a new topic in a web that has the WEBFORMS Preferences variable set, an Add Form button appears at the bottom of the page. You can start all new topics with forms enabled, and pre-select a form if there's more than one available: |
| |
|
< < | When you create a new topic in a web that has the WEBFORMS Preferences variable set, an Add Form button appears at the bottom of the page. If the WebTopicEditTemplate topic has a form added, the form will appear with values set; press Change to remove the template or to switch to a different one. |
> > |
- Edit the WebTopicEditTemplate topic, adding the name of an available Form.
- Create a new topic to check - the Form should appear with values set.
- Click Change to switch or remove Forms.
|
|
A form embedded in a topic also appears in a new topic. This is done by specifying the formtemplate parameter in the URL. |