|
TOC: No TOC in "TWiki.TWikiForms"
|
|
By adding form-based input to freeform content, you can structure topics with unlimited, easily searchable categories. When forms are enabled for a web and selected in a topic, a single form appears in edit mode, and the contents are rendered as a table when viewed on the display page. You can define unlimited forms per web. For each topic, you can select a template if more than one is defined, or remove forms entirely. Form input values are stored as TWikiMetaData; all data is saved.
|
< < |
Form Templates replace TWikiCategoryTables from the 01-Dec-2000 version of TWiki. - see #FormsVsCategoryTables
|
> > |
Form Templates replace TWikiCategoryTables from the 01-Dec-2000 version of TWiki. - see #FormsVsCategoryTables
|
|
Defining a Form Template
|
|
- Create a new topic with your form name:
YourForm, ExpenseReport, InfoCategory, RecordReview, whatever you need.
- Create a TWiki table, with each column head representing one element of an entry field:
Name, Type, Size, Values, and Tooltip message (see sample below).
- For each field, fill in a new line; for the type of field, select from the list.
|
< < |
- Save the topic (you can later choose to enable/disable individual forms).
|
> > |
- Save the topic (you can later choose to #EnablingFormsenable/disable individual forms).
|
|
Example: WebForm
|
|
- Implementation Notes: This format allows you to define field items with or without WikiNames, depending on your needs.
- Topics can be protected in the usual manner, using TWikiAccessControl, to limit who can change the form template and/or individual value lists.
|
< < |
-
-
[[...]] links can be used to force a link (at present, the [[...][...]] format is not supported).
|
> > |
-
-
[[... links can be used to force a link (at present, the [[...... format is not supported).
|
|
-
- The
Tooltip message column is used as a tooltip for the field name (only if field name is a WikiName) - you only see the tooltip In edit.
- The first item in the list is the default item. Alternative initial values can be set in a topic template, like
WebTopicEditTemplate, with field=value, or, for checkboxes, field=1.
- The topic definition is not read when a topic is viewed.
|
|
Forms are enabled on a per web basis. The WEBFORMS variable in WebPreferences is optional and defines a list of possible form templates. Example:
- Set WEBFORMS = BugForm, FeatureForm, BookLoanForm
|
< < |
- With
WEBFORMS enabled, 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. The buttons open a screen that enables selection of a form specified in WEBFORMS, or the No form option.
|
> > |
- With
WEBFORMS enabled, 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. The buttons open a screen that enables selection of a form specified in WEBFORMS, or the No form option.
|
|
Including Forms in New Topics
|
|
Using Form Data
|
< < |
TWikiForms accept user-input data, stored as TWikiMetaData. Meta data also contains program-generated info about changes, attachments, etc. To find, format and display form and other meta data, see TWikiMetaData, SEARCH and METASEARCH variables in TWikiVariables, and TWiki Formatted Search for various options.
|
> > |
TWikiForms accept user-input data, stored as TWikiMetaData. Meta data also contains program-generated info about changes, attachments, etc. To find, format and display form and other meta data, see TWikiMetaData, SEARCH and METASEARCH variables in TWikiVariables, and FormattedSearchTWiki? Formatted Search for various options.
|
|
Main Changes from Category Tables
|
|
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.
|
> > |
NOTE: If things aren"t working correctly, there may be useful entries in data/warning.txt.
|
|
Using Forms For Settings
Example process to change your WebPreferences to use forms instead of {3 spaces}* Set statements:
|
|
Notes:
|
< < |
If it isn't working, double check that the S attribute has been specified (S for Setting).
If you change the form, the changes will not take affect until you edit and save the preferences' topics again.
|
> > |
If it isn"t working, double check that the S attribute has been specified (S for Setting).
If you change the form, the changes will not take affect until you edit and save the preferences" topics again.
|
|
Using the TWiki:Plugins.EditTablePlugin on WebPreferencesForm makes adding new prefedrences a breeze.
|
< < |
A possibly unwanted side effect for using forms for the SKINS setting in their personal user topic: because the User Preferences are final you can't have different skins for different webs as the user's setting always wins. A workaround is to simply omit SKIN in the form.
|
> > |
A possibly unwanted side effect for using forms for the SKINS setting in their personal user topic: because the User Preferences are final you can"t have different skins for different webs as the user"s setting always wins. A workaround is to simply omit SKIN in the form.
|
|
Another example, this one using EditTablePlugin, source:
|
|
| SKIN | select | | "twiki, free, gnu, koala, pattern, plain, tiger" | list of installed skins | S |
| WEBBGCOLOR | select | | lightpink, pink, crimson, lavenderblush, palevioletred, hotpink, deeppink, mediumvioletred, orchid, thistle, plum, violet, fuchsia, fuchsia, darkmagenta, purple, mediumorchid, darkviolet, darkorchid, indigo, blueviolet, mediumpurple, mediumslateblue, slateblue, darkslateblue, ghostwhite, lavender, blue, mediumblue, darkblue, navy, midnightblue, royalblue, cornflowerblue, lightsteelblue, lightslategray, slategray, dodgerblue, aliceblue, steelblue, lightskyblue, skyblue, deepskyblue, lightblue, powderblue, cadetblue, darkturquoise, azure, lightcyan, paleturquoise, aqua, aqua, darkcyan, teal, darkslategray, mediumturquoise, lightseagreen, turquoise, aquamarine, mediumaquamarine, mediumspringgreen, mintcream, springgreen, mediumseagreen, seagreen, honeydew, darkseagreen, palegreen, lightgreen, limegreen, lime, forestgreen, green, darkgreen, lawngreen, chartreuse, greenyellow, darkolivegreen, yellowgreen, olivedrab, ivory, beige, lightyellow, lightgoldenrodyellow, yellow, olive, darkkhaki, palegoldenrod, lemonchiffon, khaki, gold, cornsilk, goldenrod, darkgoldenrod, floralwhite, oldlace, wheat, orange, moccasin, papayawhip, blanchedalmond, navajowhite, antiquewhite, tan, burlywood, darkorange, bisque, linen, peru, peachpuff, sandybrown, chocolate, saddlebrown, seashell, sienna, lightsalmon, coral, orangered, darksalmon, tomato, salmon, mistyrose, lightcoral, snow, rosybrown, indianred, red, brown, firebrick, darkred, maroon, white, whitesmoke, gainsboro, lightgrey, silver, darkgray, gray, dimgray, black | Web specific background color: (Pick a lighter one of the StandardColors) | S |
| WEBFORMS | textarea | | | TWikiForms: How to enable form(s) | S |
|
< < |
|
> > |
|
|
-- TWiki:Main.JohnTalintyre - 16 Aug 2001
|