Difference: FormFieldListPlugin ( vs. 1)

Revision 12004-10-01 - Main.BerndRaichle

Line: 1 to 1
Added:
>
>

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 TextFormattingRules 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)
    • Set DEBUG = 0

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 not found. __ field not found. __ field not found. __ field not found. .

Plugin Info

Plugin Author: TWiki:Main/BerndRaichle
Plugin Version: 01 Oct 2004 (V1.000)
Change History:
<-- versions below in reverse order -->
 
01 Oct 2004: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.024
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins/Benchmark: GoodStyle nn%, FormattedSearch nn%, FormFieldListPlugin nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/FormFieldListPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/FormFieldListPluginDev

Related Topics: Predefined variable FORMFIELD TWikiPreferences, TWikiPlugins

-- TWiki:Main/BerndRaichle - 01 Oct 2004

META TOPICMOVED by="BerndRaichle" date="1096633424" from="TWiki.FormfieldListPlugin" to="TWiki.FormFieldListPlugin"
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.FormFieldListPlugin