FormFieldListPlugin
FORMFIELDLIST{"field names"} renders a list of fields in the form attached to some topic.
It is an extended version of the predefined variable
FORMFIELD{"fieldname"}
to render more than one form field.
Syntax Rules
-
%FORMFIELDLIST{"field names"}%
- Supported parameters:
| Parameter: | Description: | Default: |
"field names" | A list of TWiki form field names separated by comma. | required |
topic="..." | Topic where form data is located. May be of the form Web.TopicName. | Current topic |
format="..." | Format string. $value expands to the field value. $title and $name expand to the field title as specified in the TWiki form and the field title without spaces. | "$title=$value " |
default="..." | Text shown when no value is defined for the field. | "" |
alttext="..." | Text shown when field is not found in the form . | "" |
separator="..." | Line separator between rendered entries. | Newline "$n" |
- The variable
$n expands to a newline for the complete rendered output.
Examples
-
%FORMFIELDLIST{"ProjectName, ProjectLeader, ProjectStatus" topic="Projects.SushiProject" separator=". " default="(Field $title not set)" alttext="_$title_ field not found"}%
- Output as list:
%FORMFIELDLIST{"ProjectName, ProjectLeader, ProjectStatus" topic="Projects.SushiProject" format=" * $title: $value." default=" * $title: not set." alttext=" * $title: not found."}%
Plugin Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%, i.e.
%INTERWIKIPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the Text Formatting Rules topic:
- Set SHORTDESCRIPTION = Renders a list of fields in the form attached to some topic (extending the predefined variable FORMFIELD)
- Debug plugin: (See output in
data/debug.txt)
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Download the ZIP file from the Plugin web (see below)
- Unzip
FormFieldListPlugin.zip in your twiki installation directory. Content: | File: | Description: |
data/TWiki/FormFieldListPlugin.txt | Plugin topic |
data/TWiki/FormFieldListPlugin.txt,v | Plugin topic repository |
lib/TWiki/Plugins/FormFieldListPlugin.pm | Plugin Perl module |
- (Dakar) Visit
configure in your TWiki installation, and enable the plugin in the {Plugins} section.
- Test if the installation was successful:
- The expansion of
%FORMFIELDLIST{"TopicClassification,InstalledOnTwikiOrg,NotFound,DemoUrl" format="$title: $value." default="(Field $title not set)" alttext="_$title_ field not found."}% is
(Field
$title not set).
Plugin Info
Related Topics: Predefined variable FORMFIELD TWiki Preferences,
TWiki Plugins
--
TWiki:Main/BerndRaichle - 01 Oct 2004