It is possible to add a category table to a TWiki web. This permits storing and searching for more structured information. Editing a topic shows a HTML form with the usual text area and a table with selectors, checkboxes, radio buttons and text fields. The category table is shown at the end of a topic. The format of the category table can be defined per TWiki web.

If you want to use a Category Table in a TWiki web you need to have the following three files in the twiki/templates/{Yourweb} directory:
	* twikicatitems.tmpl : Defines the items in the table
	* twikicatedit.tmpl : Defines the look of the table when editing a topic
	* twikicatview.tmpl : Defines the look of the table when viewing a topic

*_Format of category definition template twikicatitems.tmpl_*

Valid lines:
<pre>
select|{name}|{selSize}|{val1}|{val2}|{val3}...
checkbox|{name}|{checkFlag}|{itemsPerLine}|{val1}|{val2}|{val3}...
radio|{name}|{itemsPerLine}|{val1}|{val2}|{val3}...
text|{name}|{charSize}
# comments start with a # character
</pre>

Explanation:
<pre>
  {name}				 name of tag
  {selSize}			 vertical size of SELECT tag
  {val1}|{val2}...	values
  {checkFlag}		  set to true for [Set] [Clear] buttons, else set to false
  {itemsPerLine}	  input items per line before wrap around, 0 if no wrap around
  {charSize}			number of characters for text fields
</pre>

*_Remark:_* Line <code> radio|UseCategory|0|Yes|No </code> has a special meaning. If present, it is possible to choose in "edit" if the category table is included in the topic or not

Example file:
<pre>
radio|UseCategory|0|Yes|No, delete this category table
select|TopicClassification|1|Select one...|NoDisclosure|PublicSupported|PublicFAQ
checkbox|OperatingSystem|true|5|OsSolaris|OsSunOS|OsHPUX|OsWin
text|OsVersion|16
</pre>

*_Format of twikicatedit.tmpl and twikicatview.tmpl_*

Use the example below and customize if needed. twikicatedit.tmpl and twikicatview.tmpl can be identical, but they do not have to be.

*_Attention:_* <code> &lt;!--TWikiCat--&gt; </code> is needed at the beginning and end as markers. Do not delete them!

Example:
<pre>
&lt;!--TWikiCat--&gt; &lt;h4&gt; TWikiCategory &lt;/h4&gt;
&lt;table border="2" cellspacing="1" cellpadding="1"&gt;
%REPEAT%&lt;tr&gt;
&lt;td valign="top" align="right"&gt; %CATNAME%: &nbsp;&lt;br&gt;%CATMODIFIER%&lt;/td&gt;&lt;td&gt;&nbsp; %CATVALUE% &lt;/td&gt;
&lt;/tr&gt;%REPEAT%
&lt;/table&gt;&lt;!--TWikiCat--&gt;
</pre>

Above template files will result in the following category table when *_viewing_* a topic:

<h4> <A href="">TWikiCategory</a> </h4>
<table border="2" cellspacing="1" cellpadding="1">
<tr>
<td valign="top" align="right"> <A href="">TopicClassification</a>:  <br></td><td>  <A href="">PublicFAQ</A> </td>
</tr><tr>
<td valign="top" align="right"> <A href="">OperatingSystem</a>:  <br></td><td>  <A href="">OsSolaris</A> </td>
</tr><tr>
<td valign="top" align="right"> <A href="">OsVersion</a>:  <br></td><td>  <!---->2.5<!---->&nbsp; </td>
</tr>
</table>

Above template files will result in the following table when *_editing_* a topic:

<form>
<h4><A href="">TWikiCategory</a></h4>
<table border="2" cellspacing="1" cellpadding="1">
<tr>
<td valign="top" align="right"> <A href="">UseCategory</a>
:  <br></td><td>  
<table cellspacing="0" cellpadding="0"><tr>
<td><input type="radio" name="UseCategory" value="Yes" checked>Yes &nbsp;&nbsp;</td>
<td><input type="radio" name="UseCategory" value="Nodeletethiscategorytable" >No, delete this category table &nbsp;&nbsp;</td>
</tr></table>
 </td>
</tr><tr>
<td valign="top" align="right"> <A href="">TopicClassification</a>
:  <br></td><td>  <select name="TopicClassification" size="1">
<option value="Selectone" >Select one...
<option value="NoDisclosure" >NoDisclosure
<option value="PublicSupported" >PublicSupported
<option value="PublicFAQ" selected>PublicFAQ
</select> </td>
</tr><tr>
<td valign="top" align="right"> <A href="">OperatingSystem</a>
:  <br>
<input type="button" value=" Set " onClick="">&nbsp;
<input type="button" value="Clear" onClick="">&nbsp;</td><td>  
<table cellspacing="0" cellpadding="0"><tr>
<td><input type="checkbox" name="OperatingSystemOsSolaris" checked>OsSolaris &nbsp;&nbsp;</td>
<td><input type="checkbox" name="OperatingSystemOsSunOS" >OsSunOS &nbsp;&nbsp;</td>
<td><input type="checkbox" name="OperatingSystemOsHPUX" >OsHPUX &nbsp;&nbsp;</td>
<td><input type="checkbox" name="OperatingSystemOsWin" >OsWin &nbsp;&nbsp;</td>
</tr></table>
 </td>
</tr><tr>
<td valign="top" align="right"> <A href="">OsVersion</a>
:  <br></td><td>  <input type="text" name="OsVersion" size="16" value="2.5" > </td>
</tr>
</table>
</form>

__Note:__ It is possible to force the values of a category table when creating a new topic. This is useful to create new topics using a form for the topic name. The default values of the category table can be specified as hidden fields if needed, i.e. =&lt;input type="hidden" name="someCategory" value="someValue"&gt;= 

Example (edit this page to see the source) :
	* <form action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/Know/"> New Know.PublicFAQ topic: <input type="text" name="topic" size="32"> <input type="hidden" name="TopicClassification" value="PublicFAQ"> <input type="hidden" name="OperatingSystem" value="OsSolaris,OsSunOS"> <input type="hidden" name="OsVersion" value="Just testing..."> <input type="hidden" name="onlywikiname" value="on"> <input type="submit" value="Create Topic"> </form>

-- Main.PeterThoeny - 21 Apr 2000 <br>
