%ADDTOHEAD{}%
expands in-place to an empty string, unless there is an error in which case the variable expands to an error string.
%ADDTOHEAD{ "..." text="..." }%
Parameter: | Description: | Comment: |
---|---|---|
"..." | ID of the head block, such as "MY_CSS" | Optional but recommended |
text="..." | HTML text to add to the head section | Mutually exclusive with topic="" |
topic="Web.TopicName" | Name of topic that contains the full HTML text to add to the head section, such as topic="Main.MyCssTopic" | Mutually exclusive with text="" |
section="name" | If topic parameter is used, includes only the specified named section, as defined in the topic by the STARTSECTION and ENDSECTION variables. Nothing is shown if the named section does not exists. section="" is equivalent to not specifying a section | Optional |
requires="..., ..." | Comma-separated list of other IDs this one depends on | Optional |
%ADDTOHEAD{ "MYBOX_CSS" text="<style type=\"text/css\"> .myBox { height: 22px; background-color: #AFB3C5; } </style>" }%
(this topic)
%CALCULATE{formula}%
variable is handled by the SpreadSheetPlugin. Over 100 functions are available, such as $ABS()
, $EXACT()
, $EXISTS()
, $GET()/$SET()
, $IF()
, $LOG()
, $LOWER()
, $PERCENTILE()
, $TIME()
, $VALUE()
.
%CALC{formula}%
%CALC{$EXISTS(Web.SomeTopic)}%
returns 1
if the topic exists
%CALC{$UPPER(Collaboration)}%
returns COLLABORATION
$LEFT()
or $T()
. Use CALC instead.
%DASHBOARD{...}%
variable.
%DASHBOARD{ section="..." ... }%
%DASHBOARD{ section="dashboard_start" }%
%DASHBOARD{ section="banner" image="..." title="..." }%
%DASHBOARD{ section="box_start" title="Box 1 title" }%
Box 1 content
%DASHBOARD{ section="box_end" }%
%DASHBOARD{ section="box_start" title="Box 2 title" }%
Box 2 content
%DASHBOARD{ section="box_end" }%
...
%DASHBOARD{ section="dashboard_end" }%
%EDITFORM{topic="..." formfields="..."}%
Parameter: | Description: | Default: | |||
---|---|---|---|---|---|
"..." ortopic="..." | Name of topic containing the TWiki form, such as "Bug1234" . Specify topic name or Web.TopicName | Either "..." , topic="" or formtemplate="" is required | |||
formtemplate="..." | Name of form template topic, such as "BugForm" . Specify topic name or Web.TopicName | ||||
elements="..." | Elements of edit form: formstart is the HTML form tag, header the form header, formfields the form fields, submit the submit button, hiddenfields are hidden input fields, formend is the HTML form end tag. | "formstart, header, | |||
header="..." | Form header, typically containing the form name. If "on" , the default format is used:" | *[[$formweb.$formtopic][$formtopic]]* | " Supported variables: รข\x{fffd}ยข $formweb - name of web containing the form definition. รข\x{fffd}ยข $formtopic - name of topic containing the form definition. | "on" | |
formfields="..., ..." | Specify names of TWiki form fields to use, in sequence. The all token shows all remaining fields. | "all" | |||
format="..." | Format of one form field. Supported variables: รข\x{fffd}ยข $inputfield - rendered form input field. รข\x{fffd}ยข $title - raw field name (includes space and other special characters). รข\x{fffd}ยข $name - field name (sanitized title). รข\x{fffd}ยข $size - size of field or selector. รข\x{fffd}ยข $value - initial value, or select options. รข\x{fffd}ยข $tooltip - tooltip message. รข\x{fffd}ยข $attributes - type attributes, such as H for hidden, M for mandatory. รข\x{fffd}ยข $extra - extra information, such as * for mandatory field. รข\x{fffd}ยข $formweb - name of web containing the form definition. รข\x{fffd}ยข $formtopic - name of topic containing the form definition. See details in TWikiForms#FormFieldTypes. | " | $title: $extra | $inputfield | " |
hiddenfields="..., ..." | List of form field names to use as hidden fields. For each name listed in hiddenfields="" , add a name="value" parameter to specify the value of the hidden input field. If you omit the name="value" parameter for a hidden input field, it will be excluded as a form field, even with a formfields="all" . | "" | |||
submit="..." | Format of submit button row. Line separator. Variable $submit expands to submit input field with label "Save", $submit(Save) to a submit input field with specific label. | " | $submit | " | |
onsubmit="..." | Execute JavaScript when the form is submitted, optional. | "" | |||
action="..." | Specify a TWiki script (view , edit , save , ...), or the full URL of an action to take on form submit. | "save" | |||
method="..." | HTML form action method. | "post" for saveaction, else "get" | |||
separator="..." | Line separator. Variable $br expands to <br /> tag, and $n to a newline. | "$n" | |||
default="..." | Text shown when no form or form fields are found | "" |
%EDITFORM{ topic="%INCLUDINGTOPIC%" }%
- show HTML form to update form data of the including topic (typically used in an included header)
%EDITFORM{
topic="%BASEWEB%.%BASETOPIC%"
formfields="Priority, Status"
hiddenfields="Updated"
Updated="%SERVERTIME{$year-$mo-$day}%"
submit=" | | $submit(Update) |"
}%
%EDITFORMFIELD{"fieldname" form="...Form"}%
- create form field defined in a TWiki Form template
%EDITFORMFIELD{"fieldname" topic="..."}%
- create form field based on a topic that has a TWiki Form & initialize its value
%EDITFORMFIELD{"fieldname" type="..."}%
- create an HTML input field
Parameter: | Description: | Default: |
---|---|---|
"fieldname" | The name of a TWiki form field or HTML form field. | Required |
form="..." | Name of form template topic, such as "BugForm" . Specify topic name or Web.TopicName | Either form or topic is required unless type is specified |
topic="..." | Name of topic containing form, such as "Bug1234" . Specify topic name or Web.TopicName | |
format="..." | Format string. Supported variables: รข\x{fffd}ยข $inputfield - rendered form input field. รข\x{fffd}ยข $title - raw field name (includes space and other special characters). รข\x{fffd}ยข $name - field name (sanitized title). รข\x{fffd}ยข $size - size of field or selector. รข\x{fffd}ยข $value - initial value, or select options. รข\x{fffd}ยข $tooltip - tooltip message. รข\x{fffd}ยข $attributes - type attributes, such as H for hidden, M for mandatory. รข\x{fffd}ยข $extra - extra information, such as * for mandatory field. See details in TWikiForms#FormFieldTypes. This parameter is ignored if type="..." is specified. | "$inputfield" |
value="..." | Initial value of input field. If omitted and if topic="..." is specified, the value is taken from the named form field. | "" |
type="start" | Special case: Start an HTML form. Parameters: "form" type="start" action="save" topic="..." method="" onsubmit="" onreset="" รข\x{fffd}ยข action : Specify a TWiki script (view , edit , save , ...), or a full action URL, default "view" . รข\x{fffd}ยข topic : Specify topic name or Web.TopicName , default current topic; ignored if full action URL is provided. รข\x{fffd}ยข method : HTML form action method, default "post" for save action, else "get" . รข\x{fffd}ยข onsubmit : Execute JavaScript when the form is submitted, optional. รข\x{fffd}ยข onreset : Execute JavaScript when the reset button is clicked, optional. | "" |
type="end" | Special case: End an HTML form. Parameters: "form" type="end" | "" |
type="..." | Special case: Create an input field regardless of the type defined in the TWikiForm. Used mainly for hidden fields and submit button. The nameless parameter is the field name. Supported types: รข\x{fffd}ยข "fieldname" type="hidden" value="..." - hidden input field. รข\x{fffd}ยข "fieldname" type="submit" value="..." - submit button, value is button label. รข\x{fffd}ยข "fieldname" type="button" value="..." onclick="..." - regular button, value is button label. รข\x{fffd}ยข "fieldname" type="text" value="..." size="80" - text input field. รข\x{fffd}ยข "fieldname" type="textarea" value="..." size="80x6" - multi line text area field, size denotes columns x rows. รข\x{fffd}ยข "fieldname" type="checkbox" value="..." text="..." - checkbox, text is display text. รข\x{fffd}ยข "fieldname" type="radio" value="..." text="..." - radio button, text is display text. รข\x{fffd}ยข In addition, any valid XHML and HTML5 input type is supported, such as type="date" , type="file" , type="image" . Additional type-specific parameters can be supplied, such as alt="..." , checked="checked" , class="..." , max="..." , min="..." , placeholder="..." , src="..." , style="..." , width="..." . Consult HTML documentation. | "" |
%EDITFORMFIELD{ "ReleaseType" form="PackageForm" value="Beta-1" }%
%EDITFORMFIELD{ "form" type="start" action="save" topic="%BASEWEB%.%BASETOPIC%" method="post" }%
| Priority: | %EDITFORMFIELD{ "Priority" topic="%BASETOPIC%" }% |
| Status: | %EDITFORMFIELD{ "Status" topic="%BASETOPIC%" }% |
| | %EDITFORMFIELD{ "form" type="submit" value="Update" }% |
%EDITFORMFIELD{ "Updated" type="hidden" value="%SERVERTIME{$year-$mo-$day}%" }%
%EDITFORMFIELD{ "form" type="end" }%
"\n"
) and linefeed ("\r"
)
"<"
, ">"
, "&"
, single quote ('
) and double quote ("
)
"%"
, "["
, "]"
, "@"
, "_"
, "*"
, "="
and "|"
%ENTITY{string}%
%ENTITY{text with "quotes" and
newline}%
expands to text with "quotes" and newline
<input type="text" name="address" value="%ENTITY{any text}%" />
%ENTITY{string}%
is roughly equivalent to %ENCODE{ "string" type="html" }%
, but the latter cannot handle strings that have double quotes embedded in it.
%EXAMPLEVAR{}%
variable is handled by the EmptyPlugin
%EXAMPLEVAR{"text" format="..."}%
text="..."
- example text.
format="..."
- format of report.
%EXAMPLEVAR{"hello" format="| $topic: $summary |"}%
%FORM{topic="..." formfields="..." ...}%
Parameter: | Description: | Default: | |||
---|---|---|---|---|---|
"..." ortopic="..." | Name of topic containing the TWiki form, such as "Bug1234" . Specify topic name or Web.TopicName | Current topic | |||
rev="..." | Get the form from the specified topic revision, range "1" to top revision of topic. "0" is equivalent to the top revision | The rev URL parameter value if present, else the top revision | |||
formfields="..., ..." | Specify names of TWiki form fields to show, in sequence. The all token shows all remaining fields. | "all" | |||
header="..." | Form header, typically containing the form name. If "on" , the default format " | *[[$formweb.$formtopic][$formtopic]]* | " is used. If "none" , the header is suppressed. Supported variables: รข\x{fffd}ยข $formweb - name of web containing the form definition. รข\x{fffd}ยข $formtopic - name of topic containing the form definition. | "on" | |
format="..." | Format of one form field. Supported variables: รข\x{fffd}ยข $title - raw field name (includes space and other special characters). รข\x{fffd}ยข $name - field name (sanitized title). รข\x{fffd}ยข $type - form field type. รข\x{fffd}ยข $size - size of field or selector. รข\x{fffd}ยข $value - form field value. รข\x{fffd}ยข $value(20, -<br />) - value hyphenated every 20 characters using separator -<br />. รข\x{fffd}ยข $value(30, ...) - value shortened to 30 characters. รข\x{fffd}ยข $length - length of form field value. รข\x{fffd}ยข $tooltip - tooltip message. รข\x{fffd}ยข $attributes - type attributes, such as H for hidden, M for mandatory. รข\x{fffd}ยข $formweb - name of web containing the form definition. รข\x{fffd}ยข $formtopic - name of topic containing the form definition. See details in TWikiForms#FormFieldTypes. | " | $title: | $value | " |
separator="..." | Line separator. Variable $br expands to <br /> tag, and $n to a newline. | "$n" | |||
default="..." | Text shown when no form or form fields are found | "" | |||
newline="$br" | Convert newlines in textarea to other delimiters. Variable $br expands to <br /> tag, and $n to a newline. Other text is encoded based on encode parameter. | "$br" if format is a TWiki table, else "\n" | |||
encode="html" | Encode special characters in form field value into HTML entities. Additional encodings available: encode="quote" , encode="moderate" , encode="safe" , encode="entity" and encode="url" . See ENCODE for details. | "" (no encoding) | |||
showhidden="..." | Set to "on" to show also hidden form fields. | "" |
%FORM{topic="%INCLUDINGTOPIC%"}%
- show form data of the including topic (typically used in an included header)
%FORM{topic="Projects.SushiProject" formfields="Title, Status, Deadline" header="none"}%
- show a subset of form fields
%FORM{format="$name" header="none" separator=", "}%
- get all visible form field names as a list
%SET{}%
. The %SET{}%
and %GET{}%
variables are handled by the SetGetPlugin.
%GET{ "name" default="..." }%
Parameter | Description | Default |
---|---|---|
"name" | Name of variable, such as menu . May optionally contain a JSON path, such as menu.File.Open . | (required) |
format="..." | Format with supported variables: รข\x{fffd}ยข $name for variable name รข\x{fffd}ยข $value for variable value รข\x{fffd}ยข $isdefined expanding to 1 or 0 depending if variable is defined or not รข\x{fffd}ยข $isset expanding to 1 or 0 depending if variable is logically true or false รข\x{fffd}ยข $ispersistent expanding to 1 or 0 depending if variable is persistent or not รข\x{fffd}ยข all FormatTokens such as $dollar , $n , $percnt . | "$value" |
default="..." | Text shown if variable is not defined, e.g. not found. This parameter overrides the format parameter. | "" (empty string) |
store="..." | Specify a store name that holds the persistent variable. This assumes the variable was previously set with the same store name. | "" |
%GET{"lunch"}%
returns Sushi
if the following has been previously set:%SET{ "lunch" value="Sushi" }%
- see more examples
%GET{ name }%
- see description.
%SET{ menu = { "File": { "New": [ "new", "F" ], "Open": [ "open", "F" ] }, "Edit": { "Copy": [ "cpy", "F" ], "Paste": [ "pst", "F" ] } } }%
- set a JSON object
%GET{ menu.File.Open }%
- returns: ["open","F"]
%GET{}%
. No output is shown, e.g. %SET{}%
resolves to an empty string. It is also possible to set a JSON object using a JSON path. The %SET{}%
and %GET{}%
variables are handled by the SetGetPlugin.
%SET{ "name" value="..." remember="1" }%
Parameter | Description![]() | Default |
---|---|---|
value="..." | Value of variable. Escape double quotes with backslash. | (required, may be empty) |
store="..." | Specify a store name to persistently store the variable, such as store="Parts" . Use alphanumeric characters, dashes and underscores for the name. For better performance, store is preferred over the remember parameter if you need to store a large dataset. See important notes. | "" |
"name" | Name of variable. Alphanumeric characters, dashes and underscores can be used. | (required) |
remember="1" | If set, the variable will be stored persistently so that it can be used later in any TWiki topic. Alternatively use the store parameter. See important notes. | "0" |
%SET{"lunch" value="Sushi"}%
- see more examples.
%SET{ name = { ... } remember="1" }%
- see description. remember="1"
or store="..."
parameter can be appended. If specified, the JSON object will be stored persistently so that it can be used later in any TWiki topic.
%SET{ menu = { "File": { "New": [ "new", "F" ], "Open": [ "open", "F" ] }, "Edit": { "Copy": [ "cpy", "F" ], "Paste": [ "pst", "F" ] } } }%
- set a JSON object
%GET{ menu }%
- returns: {"File":{"New":["new","F"],"Open":["open","F"]},"Edit":{"Copy":["cpy","F"],"Paste":["pst","F"]}}
%SET{ menu.File.Open[1] = "T" }%
- modify a JSON object
%GET{ menu }%
- returns: {"File":{"New":["new","F"],"Open":["open","T"]},"Edit":{"Copy":["cpy","F"],"Paste":["pst","F"]}}
%SET{ menu.Edit.Cut = [ "cut", "T" ] }%
- add to a JSON object
%GET{ menu }%
- returns: {"File":{"New":["new","F"],"Open":["open","T"]},"Edit":{"Copy":["cpy","F"],"Paste":["pst","F"],"Cut":["cut","T"]}}
%SET{}%
. The %SETGETDUMP{}%
, %SET{}%
, and %GET{}%
variables are handled by the SetGetPlugin.
%SETGETDUMP{ remember="1" format="..." separator="..." }%
Parameter | Description | Default |
---|---|---|
remember="1" | Dump all persistent variables | (volatile variables) |
store="..." | Dump variables of a specific store | (volatile variables) |
format="..." | Format output using variables $name and $value | "name: $name, value: $value <br />" |
separator="..." | String used for separating entries | "\n" |
%SETGETDUMP{"| $name | $value |" separator="$n"}%
- see more examples.
%USERREPORT{ action="..." ... }%
Report | action= | Parameters |
---|---|---|
Show a simple list of registered users | "user_list" | search , limit , sort , reverse |
Show the profile picture image of a user | "profile_picture" | user , height , width , title |
Show slim, one line height user boxes | "slim_box_start" "slim_box" or "slim_box_list" "slim_box_end" | style user , style users , style none |
Show small, two line height user boxes | "small_box_start" "small_box" or "small_box_list" "small_box_end" | style user , style users , style none |
Show users in business card format | "business_card_start" "business_card" or "business_card_list" "business_card_end" | style user , style users , style none |
Show a selector to pick a user, for use in HTML forms | "select_one_user" | name , selected , users |
Show rows of checkboxes to select users, for use in HTML forms | "select_users" | name , selected , users , colums , style |
%USERREPORT{ action="user_list" search="jane" limit="5" }%