none
authorMikeMannix <MikeMannix>
Fri, 7 Sep 2001 23:31:17 +0000 (23:31 +0000)
committerMikeMannix <MikeMannix>
Fri, 7 Sep 2001 23:31:17 +0000 (23:31 +0000)
TWiki/TWikiForms.mdwn

index b5a2e03..d5b848b 100644 (file)
@@ -1,7 +1,11 @@
 <div>
   <ul>
-    <li><a href="#Form Templates"> Form Templates</a><ul>
+    <li><a href="#TWiki Form Templates"> TWiki Form Templates</a><ul>
         <li><a href="#Overview"> Overview</a></li>
+        <li><a href="#Changes from the Category Table"> Changes from the Category Table System</a><ul>
+            <li><a href="#Importing Existing Category Tabl"> Importing Existing Category Table Data</a></li>
+          </ul>
+        </li>
         <li><a href="#Form Template Elements"> Form Template Elements</a><ul>
             <li><a href="#Defining a Form Template"> Defining a Form Template</a></li>
             <li><a href="#Defining a Form in One Topic"> Defining a Form in One Topic</a></li>
   </ul>
 </div>
 
-# <a name="Form Templates"></a> Form Templates
+# <a name="TWiki Form Templates"></a> 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 &amp; topic_
 
 ## <a name="Overview"></a> 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|Main/TWikiDocumentation#TWiki_Meta_Data]]; 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.
+
+<a name="FormsVsCategoryTables"></a>
+
+## <a name="Changes from the Category Table"></a><a name="Changes from the Category Table "></a> 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:
+
+<table border="1" cellpadding="0" cellspacing="0">
+  <tr>
+    <th align="center" bgcolor="#99CCCC"><strong> Form Templates </strong></th>
+    <th align="center" bgcolor="#99CCCC"><strong> Category Tables </strong></th>
+  </tr>
+  <tr>
+    <td align="center"> defined in topics </td>
+    <td align="center"> defined in templates </td>
+  </tr>
+  <tr>
+    <td align="center"> many forms per web </td>
+    <td align="center"> one table per web </td>
+  </tr>
+  <tr>
+    <td align="center"> saved as Meta Data </td>
+    <td align="center"> saved as HTML </td>
+  </tr>
+  <tr>
+    <td align="center"><strong>Change</strong> &amp; <strong>Add Form</strong> buttons </td>
+    <td align="center"><strong>UseCategory</strong> radio button </td>
+  </tr>
+</table>
+
+### <a name="Importing Existing Category Tabl"></a> 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 <code>**twikicatitems.tmpl**</code>. 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`.
 
 ## <a name="Form Template Elements"></a> Form Template Elements
 
@@ -55,64 +98,66 @@ A Form Template is simply a page containing your form, defined in a table where
 3. For each field, fill in a new line; for the type of field, select from the list.
 4. Save the topic.
 
-> <span><font>**Example:** Form Template </font></span>
+> **Example: WebFormTemplate from the TWiki.Know web**
 >
->     | *Name:* | *Type:* | *Size:* | *Values:* | *Tooltip message:* |
->     | TopClass | select | 1 | Select one..., Private, Public | must fill |
->     | Target   | checkbox+buttons | 3 | 1, No.2, No.3 | Select OS |
->     | Version | text | 16 | | OS version |
+>     | *Name* | *Type* | *Size* | *Values* | *Tooltip message* |
+>     | Know.TopicClassification | select | 1 | Know.NoDisclosure,
+>       Know.PublicSupported, Know.PublicFAQ | blah blah... |
+>     | Know.OperatingSystem | checkbox | 3 | Know.OsHPUX, Know.OsLinux,
+>       Know.OsSolaris, Know.OsWin | blah blah... |
+>     | Know.OsVersion | text | 16 | | blah blah... |
 
 ### <a name="Defining a Form in One Topic"></a> Defining a Form in One Topic
 
-Example: WebFormTemplate of the TWiki.Know web:
-
-<table border="1" cellpadding="0" cellspacing="0">
-  <tr>
-    <th bgcolor="#99CCCC"><strong> Name: </strong></th>
-    <th bgcolor="#99CCCC"><strong> Type: </strong></th>
-    <th bgcolor="#99CCCC"><strong> Size: </strong></th>
-    <th bgcolor="#99CCCC"><strong> Values: </strong></th>
-    <th bgcolor="#99CCCC"><strong> Tooltip message: </strong></th>
-  </tr>
-  <tr>
-    <td>[[Know/TopicClassification]]</td>
-    <td> select </td>
-    <td> 1 </td>
-    <td>[[Know/NoDisclosure]], [[Know/PublicSupported]], [[Know/PublicFAQ]]</td>
-    <td> blah blah... </td>
-  </tr>
-  <tr>
-    <td>[[Know/OperatingSystem]]</td>
-    <td> checkbox </td>
-    <td> 3 </td>
-    <td>[[Know/OsHPUX]], [[Know/OsLinux]], [[Know/OsSolaris]], [[Know/OsWin]]</td>
-    <td> blah blah... </td>
-  </tr>
-  <tr>
-    <td>[[Know/OsVersion]]</td>
-    <td> text </td>
-    <td> 16 </td>
-    <td>   </td>
-    <td> blah blah... </td>
-  </tr>
-</table>
+> **Example: WebFormTemplate from the TWiki.Know web**
+>
+> <table border="1" cellpadding="0" cellspacing="0">
+>   <tr>
+>     <th bgcolor="#99CCCC"><strong> Name </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Type </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Size </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Values </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Tooltip message </strong></th>
+>   </tr>
+>   <tr>
+>     <td>[[Know/TopicClassification]]</td>
+>     <td> select </td>
+>     <td align="center"> 1 </td>
+>     <td>[[Know/NoDisclosure]], [[Know/PublicSupported]], [[Know/PublicFAQ]]</td>
+>     <td> blah blah... </td>
+>   </tr>
+>   <tr>
+>     <td>[[Know/OperatingSystem]]</td>
+>     <td> checkbox </td>
+>     <td align="center"> 3 </td>
+>     <td>[[Know/OsHPUX]], [[Know/OsLinux]], [[Know/OsSolaris]], [[Know/OsWin]]</td>
+>     <td> blah blah... </td>
+>   </tr>
+>   <tr>
+>     <td>[[Know/OsVersion]]</td>
+>     <td> text </td>
+>     <td align="center"> 16 </td>
+>     <td>   </td>
+>     <td> blah blah... </td>
+>   </tr>
+> </table>
 
 ### <a name="Defining a Form in Multiple Topi"></a> 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.
 
-> <span><font>**Code from:** </font></span>
+> **Code from:**
 >
 > - WebFormTemplate of the TWiki.Know web: <table border="1" cellpadding="0" cellspacing="0">
 >   <tr>
->     <th bgcolor="#99CCCC"><strong> Name: </strong></th>
->     <th bgcolor="#99CCCC"><strong> Type: </strong></th>
->     <th bgcolor="#99CCCC"><strong> Size: </strong></th>
->     <th bgcolor="#99CCCC"><strong> Values: </strong></th>
->     <th bgcolor="#99CCCC"><strong> Tooltip message: </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Name </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Type </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Size </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Values </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Tooltip message </strong></th>
 >   </tr>
 >   <tr>
 >     <td>[[Know/TopicClassification]]</td>
@@ -139,9 +184,9 @@ The form template can also be defined in an alternative way by using more then o
 >
 > - TopicClassification topic: <table border="1" cellpadding="0" cellspacing="0">
 >   <tr>
->     <th bgcolor="#99CCCC"><strong> Name: </strong></th>
->     <th bgcolor="#99CCCC"><strong> Type: </strong></th>
->     <th bgcolor="#99CCCC"><strong> Tooltip message: </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Name </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Type </strong></th>
+>     <th bgcolor="#99CCCC"><strong> Tooltip message </strong></th>
 >   </tr>
 >   <tr>
 >     <td>[[Know/NoDisclosure]]</td>
@@ -184,9 +229,9 @@ Forms are enabled on a per web basis. The <code>**WEBFORMS**</code> variable in
 
 - 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`. <br /> Boxes with a tick must be specified.
 
 ## <a name="Creating New Topics with Forms"></a> Creating New Topics with Forms