Line: 1 to 1 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Form Templates | ||||||||||||||||
Changed: | ||||||||||||||||
< < | BackgroundThis is a more general replacement for the TWikiCategoryTable capability, in particular Forms are defined by special topics, where as categories were defineind using special templates. | |||||||||||||||
> > | Topics allow for flexible free format data, sometimes you want to ensure strucutre to some of the topic information, this can be done with Forms e.g. saying what type of topic it is (Bug, Feature, FAQ entry etc). | |||||||||||||||
Terminology
| ||||||||||||||||
Changed: | ||||||||||||||||
< < |
| |||||||||||||||
> > |
| |||||||||||||||
| ||||||||||||||||
Line: 29 to 27 | ||||||||||||||||
Enable forms for a web | ||||||||||||||||
Changed: | ||||||||||||||||
< < | By default topics can be edited in free form. A form can be added to a topic to give it more structure. Forms are enabled on a per web basis. This can be done in two ways. One is similar to that used for the older category system, with this a Web can have only one form. The other allows a Web to have any number of forms.
A default form template can be provided by creating the WebTopicEditTemplate topic in a Web and adding a form to it. Initial form values can be set here.
Enabling single default formTheDEFAULTFORM variable in WebPreferences is optional. If present it specifies the default form for all topics in the Web. Every time you edit a topic you will be presented with a form. The form must contain the special field UseForm (analogous to the UseCategory line in the old category system). The values for this must be:
Enabling multiple forms | |||||||||||||||
> > | By default topics can be edited in free form. A form can be added to a topic to give it more structure. Forms are enabled on a per web basis. | |||||||||||||||
The WEBFORMS variable in WebPreferences is optional and defines a list of possible form templates e.g.
| ||||||||||||||||
Changed: | ||||||||||||||||
< < | With this present an extra button is added to the edit view. If the topic doesn't have a form the button appears at the end of the page. If a form is present the button appears in the top row of the form. Pressing the button leads to a screen that enables no form to be selected of one of those specified by WEBFORMS . | |||||||||||||||
> > | With this present an extra button is added to the edit view. If the topic doesn't have a form an Add Form button appears at the end of the topic. If a form is present a Change button appears in the top row of the form to the right of the form name. The buttons leads to a screen that enables no form to be selected of one of those specified by WEBFORMS . | |||||||||||||||
Changed: | ||||||||||||||||
< < | Define a form template | |||||||||||||||
> > | A default form template (i.e. 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 here.
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:
Defining a form template | |||||||||||||||
Form templates are defined by topics, one topic per form template. A form template topic has descriptive text mixed with the form template definition in the form of a TWiki table. | ||||||||||||||||
Line: 57 to 51 | ||||||||||||||||
Example: WebFormTemplate of the TWiki.Know web:
| ||||||||||||||||
Deleted: | ||||||||||||||||
< < |
| |||||||||||||||
| ||||||||||||||||
Line: 74 to 67 | ||||||||||||||||
| ||||||||||||||||
Deleted: | ||||||||||||||||
< < |
| |||||||||||||||
| ||||||||||||||||
Line: 88 to 80 | ||||||||||||||||
Notes
| ||||||||||||||||
Changed: | ||||||||||||||||
< < |
| |||||||||||||||
> > |
| |||||||||||||||
| ||||||||||||||||
Changed: | ||||||||||||||||
< < |
| |||||||||||||||
> > |
| |||||||||||||||
Changes from category systemMain changes from TWikiCategoryTable :
| ||||||||||||||||
Deleted: | ||||||||||||||||
< < |
| |||||||||||||||
| ||||||||||||||||
Added: | ||||||||||||||||
> > |
| |||||||||||||||
Creating new topics with forms | ||||||||||||||||
Changed: | ||||||||||||||||
< < | When you create a new topic in a web that has the WEBFORM preferences variable set you will get a topic with the default form template specified by the variable. | |||||||||||||||
> > | When you create a new topic in a web that has the WEBFORMS preferences variable set you will get a Add Form button at the bottom of the page. However, if the WebTopicEditTemplate topic has had a form added this will appear with values set; Change in the form can be pressed to remove the template or switch to a different one. | |||||||||||||||
Changed: | ||||||||||||||||
< < | For simplicity we should use the default form template when one creates a new topic by question mark link or "Go" field, i.e. better not to show a menu to select a form template. | |||||||||||||||
> > | A form embedded in a topic can also cause a form to be present in a new topic, this is done by specifying the formtemplate parameter in the URL. | |||||||||||||||
Topic meta data | ||||||||||||||||
Line: 124 to 112 | ||||||||||||||||
UI for multiple form templates | ||||||||||||||||
Changed: | ||||||||||||||||
< < |
| |||||||||||||||
> > |
| |||||||||||||||
| ||||||||||||||||
Line: 135 to 123 | ||||||||||||||||
Old data should be transparently upgraded to the new meta format when a topic is edit/previewed/saved. | ||||||||||||||||
Changed: | ||||||||||||||||
< < | On upgrading the administrator must produce a form template topic for each Web that using the old category system. twikicatitems.tmpl defines the categories and is used in the conversion. The form template must be put as first item in WebPreferences variable WEBFORM or DEFAULTFORM (if/when put in). If it's not present, an oops dialog results. | |||||||||||||||
> > | On upgrading the administrator must produce a form template topic for each Web that using the old category system. twikicatitems.tmpl defines the categories and is used in the conversion. The form template must be put as first item in WebPreferences variable =WEBFORM . If it's not present view works, but edit results in an oops dialog results. If things aren't working correctly there may be entries data/warning.txt .
HistoryThis is a more general replacement for the TWikiCategoryTable capability, in particular Forms are defined by special topics, where as categories were defineind using special templates. | |||||||||||||||
Changed: | ||||||||||||||||
< < | -- JohnTalintyre - 07 Aug 2001 | |||||||||||||||
> > | -- JohnTalintyre - 16 Aug 2001 |
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
Form TemplatesOn this page:
BackgroundThis is a more general replacement for the TWikiCategoryTable capability, in particular Forms are defined by special topics, where as categories were defineind using special templates.Terminology
SpecificationEnable forms for a webBy default topics can be edited in free form. A form can be added to a topic to give it more structure. Forms are enabled on a per web basis. This can be done in two ways. One is similar to that used for the older category system, with this a Web can have only one form. The other allows a Web to have any number of forms. A default form template can be provided by creating theWebTopicEditTemplate topic in a Web and adding a form to it. Initial form values can be set here.
Enabling single default formTheDEFAULTFORM variable in WebPreferences is optional. If present it specifies the default form for all topics in the Web. Every time you edit a topic you will be presented with a form. The form must contain the special field UseForm (analogous to the UseCategory line in the old category system). The values for this must be:
Enabling multiple formsTheWEBFORMS variable in WebPreferences is optional and defines a list of possible form templates e.g.
WEBFORMS .
Define a form templateForm templates are defined by topics, one topic per form template. A form template topic has descriptive text mixed with the form template definition in the form of a TWiki table.ExamplesDefining form in one topicExample: WebFormTemplate of the TWiki.Know web:
Defining form in multiple topicsThe form template can also be defined in an alternative way by using more then one topic:
Notes
Changes from category systemMain changes from TWikiCategoryTable :
Creating new topics with formsWhen you create a new topic in a web that has the WEBFORM preferences variable set you will get a topic with the default form template specified by the variable. For simplicity we should use the default form template when one creates a new topic by question mark link or "Go" field, i.e. better not to show a menu to select a form template.Topic meta dataSee TWikiMetaDataDefinition . The form template topic name and all form fields/values are stored in the topic meta data. The form template topic name is needed for edit and save. The order of form field/value items in the meta-data is the same as in the form template.UI for multiple form templates
Migration of Category informationPrinciple: new system should work with old data with no special conversion. Old data should be transparently upgraded to the new meta format when a topic is edit/previewed/saved. On upgrading the administrator must produce a form template topic for each Web that using the old category system.twikicatitems.tmpl defines the categories and is used in the conversion. The form template must be put as first item in WebPreferences variable WEBFORM or DEFAULTFORM (if/when put in). If it's not present, an oops dialog results.
-- JohnTalintyre - 07 Aug 2001 |