head	1.7;
access;
symbols;
locks
	nobody:1.7; strict;
comment	@# @;


1.7
date	2001.09.18.06.31.59;	author PeterThoeny;	state Exp;
branches;
next	1.6;

1.6
date	2001.09.12.06.51.29;	author MikeMannix;	state Exp;
branches;
next	1.5;

1.5
date	2001.09.01.09.58.24;	author MikeMannix;	state Exp;
branches;
next	1.4;

1.4
date	2001.03.04.08.50.24;	author PeterThoeny;	state Exp;
branches;
next	1.3;

1.3
date	2001.02.26.21.14.12;	author PeterThoeny;	state Exp;
branches;
next	1.2;

1.2
date	2000.12.22.07.22.06;	author PeterThoeny;	state Exp;
branches;
next	1.1;

1.1
date	2000.04.22.00.47.40;	author PeterThoeny;	state Exp;
branches;
next	;


desc
@none
@


1.7
log
@none
@
text
@%META:TOPICINFO{author="PeterThoeny" date="1000794719" format="1.0" version="1.7"}%
__Note:__ This feature has been replaced by: TWikiForms
@


1.6
log
@none
@
text
@d1 2
a2 191
%META:TOPICINFO{author="MikeMannix" date="1000277489" format="1.0" version="1.6"}%
---++ Dev Reorg
	* This feature has been replaced by: TWikiForms

---

---## TWiki Category Table

---+++ What is a Category Table?

It is possible to add a Category Table to a %WIKITOOLNAME% web. It allows you to categorize and classify a topic, e.g. give some structure to the content of a web.

The Category Table is located at the end of a topic. Example:

<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>
</table>

When you edit the topic you see below the usual text area a table that includes widgets (controls) like drop-down menus, checkboxes, radio buttons, and text boxes. It makes it easy to provide keywords to categorize a topic. Example:

<form>
<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>
</table>
</form>

The format of the Category Table can be defined per %WIKITOOLNAME% web.

One sample application is a knowledge base for customer support. The web for customer support contains internal documents, FAQ entries and knowledge base entries. Topics are __classified__ accordingly. In addition, FAQ entries and knowledge base entries can be __categorized__ i.e. by the software product anf the operating system. For the operating system category, a checkbox contains <nop>OsSolaris, <nop>OsSunOS, <nop>OsHPUX and <nop>OsWin.

__Hint:__ The topic classification can be used to do some automatic processing in the background. For example, a script could automatically publish the FAQ entries to your corporate web site, including FAQ index page and file attachments.


---+++ How to Define a Category Table

The Category Table is defined by some template files. To add a Category Table to your %WIKITOOLNAME% web you need to place the following three files into 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 File 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 =radio|UseCategory|0|Yes|No= 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:__ ==&lt;!--TWikiCat--&gt;== 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>


---+++ Default Values for a Category Table

It is possible to force the values of a Category Table when creating a new topic. You can define a default template to set the Category Table and/or specify individual values.

---++++ Default Topic Template 

Whenever you create a new topic, the ==twiki/templates/Webname/notedited.tmpl== file is used as the new topic template. To create this template, save a topic with the default text and the Category Table setting you need, then copy the content of the topic to the ==notedited.tmpl== template (including the Category Table). Look also at the ==twiki/templates/Know/notedited.tmpl== included in the distribution. 

---++++ Set Individual Category Table Values

It is possible to set individual values of a Category Table when creating a new topic. This is useful when you have a form to create a new topic of a certain classification. The default values of the Category Table can be specified as hidden fields as 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>

-- RandyKramer - 26 Feb 2001 <br>
-- Main.PeterThoeny - 04 Mar 2001 <br>
@


1.5
log
@none
@
text
@d1 1
a1 1
%META:TOPICINFO{author="MikeMannix" date="999338304" format="1.0" version="1.5"}%
d3 1
a3 1
	* This feature has been replaced by: TWikiFormTemplate
@


1.4
log
@none
@
text
@d1 6
@


1.3
log
@none
@
text
@d1 3
a3 1
__What is a Category Table?__
d60 1
a60 1
__How to Define a Category Table__
d62 4
a65 4
The Category Table is defined by some template files. To add a Category Table to your %WIKITOOLNAME% web you need to place the following three files into 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
d68 1
a68 1
__Format of Category Definition Template File twikicatitems.tmpl__
d99 1
a99 1
__Format of twikicatedit.tmpl and twikicatview.tmpl__
d101 1
a101 1
Use the example below and customize if needed. =twikicatedit.tmpl= and =twikicatview.tmpl= can be identical, but they do not have to be.
d103 1
a103 1
__Attention:__ =&lt;!--TWikiCat--&gt;= is needed at the beginning and end as markers. Do not delete them!
d168 12
a179 1
__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;= 
d184 2
a185 1
-- Main.PeterThoeny - 26 Feb 2001 <br>
@


1.2
log
@none
@
text
@d3 1
a3 1
A Category Table is a table that can include drop-down menus, checkboxes, radio buttons, and text fields. It makes it easy to provide keywords to categorize a topic. 
d5 1
a5 1
For example, if a TWiki web is devoted to technical support, wiki topics might be incident reports. The Category Table can prompt the writer to select the operating system, the software product, and the version for this report. For the operating system category, checkboxes can be displayed for <nop>OsSolaris, <nop>OsSunOS, <nop>OsHPUX and <nop>OsWin.
d7 7
a13 1
__Using a Category Table__
d15 1
a15 1
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.
d17 44
a60 1
If you want to add a Category Table in a TWiki web you need to place the following three files into the =twiki/templates/{Yourweb}= directory:
d65 2
a66 1
__Format of category definition template twikicatitems.tmpl__
d166 1
a166 1
__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;= 
d171 1
a171 1
-- Main.PeterThoeny - 21 Apr 2000 <br>
@


1.1
log
@none
@
text
@d1 8
d11 4
a14 4
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
d16 1
a16 1
*_Format of category definition template twikicatitems.tmpl_*
d37 1
a37 1
*_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
d47 1
a47 1
*_Format of twikicatedit.tmpl and twikicatview.tmpl_*
d49 1
a49 1
Use the example below and customize if needed. twikicatedit.tmpl and twikicatview.tmpl can be identical, but they do not have to be.
d51 1
a51 1
*_Attention:_* <code> &lt;!--TWikiCat--&gt; </code> is needed at the beginning and end as markers. Do not delete them!
d63 1
a63 1
Above template files will result in the following category table when *_viewing_* a topic:
d76 1
a76 1
Above template files will result in the following table when *_editing_* a topic:
@
