ANNUNCIO: L'aggiornamento dei pacchetti ISI produce importanti cambiamenti,
leggete questa nota
1 TWiki Variables
Special text strings expand on the fly to display user data or system info
TWikiVariables are text strings -
%VARIABLE%
or
%VARIABLE{ parameter="value" }%
- that expand into content whenever a topic is rendered for viewing. There are two types of variables:
- Preferences variables: Can be defined and changed by the user
- Predefined variables: Defined by the TWiki system or by Plugins (for example, the SpreadSheetPlugin introduces a
%CALC{}%
variable)
Using Variables
To use a variable type its name. For example,
- type
%T%
to get
(a preferences variable)
- type
%TOPIC%
to get TWikiVariables
(a predefined variable)
- type
%CALC{ "$UPPER(Text)" }%
to get TEXT
(a variable defined by Plugin)
Note:
- To leave a variable unexpanded, precede it with an exclamation point, e.g. type
!%TOPIC%
to get %TOPIC%
- Variables are expanded relative to the topic they are used in, not the topic they are defined in
- Type
%ALLVARIABLES%
to get a full listing of all variables defined for a particular topic
Variable Names
Variable names must start with a letter. The following characters can be letters, numbers and the underscore '_'. You can use both upper-case and lower-case letters and you can mix the characteres. E.g.
%MYVAR%
,
%MyVar%
,
%My2ndVar%
, and
%My_Var%
are all valid variable names. Variables are case sensitive.
%MyVAR%
and
%MYVAR%
are not the same variable.
By convention all settings, predefined variables and variables used by plugins are always UPPER-CASE.
Preferences Variables
Unlike predefined variables, preferences variables can be defined by the user in various places.
Setting Preferences Variables
You can set variables in all the following places:
- local site level in TWiki.TWikiPreferences
- plugin topics (see TWikiPlugins)
- local site level in Main.TWikiPreferences
- user level in individual user topics in Main web
- web level in WebPreferences of each web
- topic level in topics in webs
- session variables (if sessions are enabled)
Settings at higher-numbered levels override settings of the same variable at lower numbered levels, unless the variable was included in the setting of FINALPREFERENCES at a lower-numbered level, in which case it is locked at the value it has at that level.
The syntax for setting Variables is the same anywhere in TWiki (on its own TWiki bullet line, including nested bullets):
[multiple of 3 spaces] * [space] Set [space] VARIABLENAME [space] = [space] value
Examples:
Spaces between the = sign and the value will be ignored. You can split a value over several lines by indenting following lines with spaces - as long as you don't try to use * as the first character on the following line.
Example:
* Set VARIABLENAME = value starts here
and continues here
Whatever you include in your Variable will be expanded on display, exactly as if it had been entered directly.
Example: Create a custom logo variable
- To place a logo anywhere in a web by typing
%MYLOGO%
, define the Variable on the web's WebPreferences topic, and upload a logo file, ex: mylogo.gif
. You can upload by attaching the file to WebPreferences, or, to avoid clutter, to any other topic in the same web, e.g. LogoTopic
. Sample variable setting in WebPreferences:
-
Set MYLOGO = %PUBURL%/%WEB%/LogoTopic/mylogo.gif
You can also set preferences variables on a topic by clicking the link
Edit topic preference settings
under
More topic actions
. Preferences set in this manner are not visible in the topic text, but take effect nevertheless.
Access Control Variables
These are special types of preferences variables to control access to content.
TWikiAccessControl explains these security settings in detail.
Local values for variables
Certain topics (a users home topic, web site and default preferences topics) have a problem; variables defined in those topics can have two meanings. For example, consider a user topic. A user may want to use a double-height edit box when they are editing their home topic - but
only when editing their home topic. The rest of the time, they want to have a normal edit box. This separation is achieved using
Local
in place of
Set
in the variable definition. For example, if the user sets the following in their home topic:
* Set EDITBOXHEIGHT = 10
* Local EDITBOXHEIGHT = 20
Then when they are editing any other topic, they will get a 10 high edit box. However when they are editing their home topic, they will get a 20 high edit box.
Local
can be used wherever a preference needs to take a different value depending on where the current operation is being performed.
Use this powerful feature with great care!
%ALLVARIABLES%
can be used to get a listing of the values of all variables in their evaluation order, so you can see variable scope if you get confused.
Frequently Used Preferences Variables
The following preferences variables are frequently used. They are defined in
TWikiPreferences#Miscellaneous_Settings:
-
%BR%
- line break
-
%BULLET%
- bullet sign
-
%BB%
- line break and bullet combined
-
%BB2%
- indented line break and bullet
-
%RED% text %ENDCOLOR%
- colored text (also %YELLOW%
, %ORANGE%
, %PINK%
, %PURPLE%
, %TEAL%
, %NAVY%
, %BLUE%
, %AQUA%
, %LIME%
, %GREEN%
, %OLIVE%
, %MAROON%
, %BROWN%
, %BLACK%
, %GRAY%
, %SILVER%
, %WHITE%
)
-
%H%
- Help icon
-
%I%
-
Idea icon
-
%M%
- Moved to icon
-
%N%
-
New icon
-
%P%
- Refactor icon
-
%Q%
- Question icon
-
%S%
-
Pick icon
-
%T%
-
Tip icon
-
%U%
- Updated icon
-
%X%
-
Alert icon
-
%Y%
- Done icon
There are additional useful preferences variables defined in
TWikiPreferences, in
Main.TWikiPreferences, and in
WebPreferences of every web.
Predefined Variables
Most predefined variables return values that were either set in the configuration when TWiki was installed, or taken from server info (such as current username, or date and time). Some, like
%SEARCH%
, are powerful and general tools.
-
Predefined variables can be overridden by preferences variables
-
Plugins may extend the set of predefined variables (see individual Plugins topics for details)
-
Take the time to thoroughly read through ALL preference variables. If you actively configure your site, review variables periodically. They cover a wide range of functions, and it can be easy to miss the one perfect variable for something you have in mind. For example, see %INCLUDINGTOPIC%
, %INCLUDE%
, and the mighty %SEARCH%
.
This version of TWiki - TWiki-4.1.2, Sat, 03 Mar 2007, build 13046 - predefines the following variables:
ACTIVATEDPLUGINS -- list of currently activated plugins
- Syntax:
%ACTIVATEDPLUGINS%
- Expands to: SpreadSheetPlugin, AccessStatsPlugin, BeautifierPlugin, CalendarPlugin, CommentPlugin, ControlsPlugin, EditTablePlugin, EmbedFlashPlugin, ExplicitNumberingPlugin, FootNotePlugin, GluePlugin, HideInEditModePlugin, InterwikiPlugin, JSPopupPlugin, PhotoarchivePlugin, PreferencesPlugin, RecursiveRenderPlugin, RedirectPlugin, RenderListPlugin, SectionalEditPlugin, SignaturePlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin, TagMePlugin, TextSectionPlugin, TocPlugin, ToolTipPlugin, TreeBrowserPlugin, TreePlugin, TwistyPlugin, WysiwygPlugin, XinhaEditorPlugin
- Related: PLUGINDESCRIPTIONS, FAILEDPLUGINS, PLUGINVERSION
ALLVARIABLES -- list of currently defined TWikiVariables
- Syntax:
%ALLVARIABLES%
- Expands to: a table showing all defined TWikiVariables in the current context
AQUA -- start aqua colored text
-
AQUA
is one of the rendering shortcut settings predefined in TWikiPreferences. See the section rendering shortcut settings in that topic for a complete list of colors.
- Syntax:
%AQUA% aqua text %ENDCOLOR%
- Expands to: aqua text
- Note:
%<color>%
text must end with %ENDCOLOR%
. If you want to switch from one color to another one you first need to end the active color with %ENDCOLOR%
, e.g. write %RED% some text %ENDCOLOR% %GREEN% more text %ENDCOLOR%
.
- Related: ENDCOLOR, TWikiPreferences, StandardColors
ATTACHURL -- full URL for attachments in the current topic
ATTACHURLPATH -- path of the attachment URL of the current topic
AUTHREALM -- authentication realm
- String defined as {AuthRealm} in configure. This is used in certain password encodings, and in login templates as part of the login prompt.
- Syntax:
%AUTHREALM%
- Expands to: Enter your LoginName. (Typically First name and last name, no space, no dots, capitalized, e.g. JohnSmith, unless you chose otherwise). Visit TWikiRegistration if you do not have one.
- Related: TWikiUserAuthentication, SESSIONID, SESSIONVAR, LOGIN, LOGOUT, SESSION_VARIABLE
BASETOPIC -- base topic where an INCLUDE started
- The name of the topic where a single or nested INCLUDE started - same as
%TOPIC%
if there is no INCLUDE
- Syntax:
%BASETOPIC%
- Related: BASEWEB, INCLUDINGTOPIC, INCLUDE, TOPIC
BASEWEB -- base web where an INCLUDE started
- The web name where the includes started, e.g. the web of the first topic of nested includes. Same as
%WEB%
in case there is no include.
- Syntax:
%BASEWEB%
- Related: BASETOPIC, INCLUDINGWEB, INCLUDE, WEB
BB -- bullet with line break
BB2 -- level 2 bullet with line break
BB3 -- level 3 bullet with line break
BB4 -- level 4 bullet with line break
BLACK -- start black colored text
-
BLACK
is one of the rendering shortcut settings predefined in TWikiPreferences. See the section rendering shortcut settings in that topic for a complete list of colors.
- Syntax:
%BLACK% black text %ENDCOLOR%
- Expands to: black text
- Note:
%<color>%
text must end with %ENDCOLOR%
. If you want to switch from one color to another one you first need to end the active color with %ENDCOLOR%
, e.g. write %RED% some text %ENDCOLOR% %GREEN% more text %ENDCOLOR%
.
- Related: ENDCOLOR, TWikiPreferences, StandardColors
BLUE -- start blue colored text
-
BLUE
is one of the rendering shortcut settings predefined in TWikiPreferences. See the section rendering shortcut settings in that topic for a complete list of colors.
- Syntax:
%BLUE% blue text %ENDCOLOR%
- Expands to: blue text
- Note:
%<color>%
text must end with %ENDCOLOR%
. If you want to switch from one color to another one you first need to end the active color with %ENDCOLOR%
, e.g. write %RED% some text %ENDCOLOR% %GREEN% more text %ENDCOLOR%
.
- Related: ENDCOLOR, TWikiPreferences, StandardColors
BR -- line break
BROWN -- start brown colored text
-
BROWN
is one of the rendering shortcut settings predefined in TWikiPreferences. See the section rendering shortcut settings in that topic for a complete list of colors.
- Syntax:
%BROWN% brown text %ENDCOLOR%
- Expands to: brown text
- Note:
%<color>%
text must end with %ENDCOLOR%
. If you want to switch from one color to another one you first need to end the active color with %ENDCOLOR%
, e.g. write %RED% some text %ENDCOLOR% %GREEN% more text %ENDCOLOR%
.
- Related: ENDCOLOR, TWikiPreferences, StandardColors
BULLET -- bullet character
DATE -- signature format date
DISPLAYTIME -- display time
DISPLAYTIME{"format"} -- formatted display time
- Formatted time - either GMT or Local server time, depending on setting in configure. Same format qualifiers as
%GMTIME%
- Syntax:
%DISPLAYTIME{"format"}%
- Example:
%DISPLAYTIME{"$hou:$min"}%
expands to 14:38
- Related: DISPLAYTIME, GMTIME, SERVERTIME
ENCODE{"string"} -- encodes a string to HTML entities
- Encode "special" characters to HTML numeric entities. Encoded characters are:
- all non-printable ASCII characters below space, except newline (
"\n"
) and linefeed ("\r"
)
- HTML special characters
"<"
, ">"
, "&"
, single quote ('
) and double quote ("
)
- TWiki special characters
"%"
, "["
, "]"
, "@"
, "_"
, "*"
, "="
and "|"
- Syntax:
%ENCODE{"string"}%
- Supported parameters:
Parameter: | Description: | Default: |
"string" | String to encode | required (can be empty) |
type="entity" | Encode special characters into HTML entities, like a double quote into " . Does not encode \n or \r . | type="url" |
type="html" | As type="entity" except it also encodes \n and \r | type="url" |
type="quote" | Escape double quotes with backslashes (\" ), does not change other characters | type="url" |
type="url" | Encode special characters for URL parameter use, like a double quote into %22 | (this is the default) |
- Example:
%ENCODE{"spaced name"}%
expands to spaced%20name
-
Note: Values of HTML input fields must be entity encoded.
Example: <input type="text" name="address" value="%ENCODE{ "any text" type="entity" }%" />
-
Note: Double quotes in strings must be escaped when passed into other TWiki variables.
Example: %SEARCH{ "%ENCODE{ "string with "quotes"" type="quotes" }%" noheader="on" }%
ENDCOLOR -- end colored text
-
ENDCOLOR
is a rendering shortcut settings predefined in TWikiPreferences. See the section rendering shortcut settings in that topic for a complete list of colors.
- Syntax:
%RED% red text %ENDCOLOR%
- Expands to: red text
- Note:
%<color>%
text must end with %ENDCOLOR%
. If you want to switch from one color to another one you first need to end the active color with %ENDCOLOR%
, e.g. write %RED% some text %ENDCOLOR% %GREEN% more text %ENDCOLOR%
.
- Related: VarAQUA, VarBLACK, VarBLUE, VarBROWN, VarGRAY, VarGREEN, VarLIME, VarMAROON, VarNAVY, VarOLIVE, VarORANGE, VarPINK, VarPURPLE, VarRED, VarSILVER, VarTEAL, VarWHITE, VarYELLOW, TWikiPreferences, StandardColors
ENDSECTION{"name"} -- marks the end of a named section within a topic
- Syntax:
%ENDSECTION{"name"}%
- Syntax:
%ENDSECTION{type="include"}%
- Supported parameter:
Parameter: | Description: |
"name" | Name of the section. |
type="..." | Type of the section being terminated; supported types "section" , "include" , "templateonly" . |
- If the
STARTSECTION
is named, the corresponding ENDSECTION
must also be named with the same name. If the STARTSECTION
specifies a type, then the corresponding ENDSECTION
must also specify the same type. If the section is unnamed, ENDSECTION
will match with the nearest unnamed %STARTSECTION%
of the same type above it.
- Related: STARTSECTION
FAILEDPLUGINS -- debugging for plugins that failed to load, and handler list
FORMFIELD{"fieldname"} -- renders a field in the form attached to some topic
- Syntax:
%FORMFIELD{"fieldname"}%
- Supported parameters:
Parameter: | Description: | Default: |
"fieldname" | The name of a TWiki form field | 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, and $title expands to the field title | "$value" |
default="..." | Text shown when no value is defined for the field | "" |
alttext="..." | Text shown when field is not found in the form | "" |
- Example:
%FORMFIELD{"ProjectName" topic="Projects.SushiProject" default="(not set)" alttext="ProjectName field found"}%
- Related: SEARCH
GMTIME -- GM time
GMTIME{"format"} -- formatted GM time
- Syntax:
%GMTIME{"format"}%
- Supported variables:
Variable: | Unit: | Example |
$seconds | seconds | 59 |
$minutes | minutes | 59 |
$hours | hours | 23 |
$day | day of month | 31 |
$wday | day of the Week (Sun, Mon, Tue, Wed, Thu, Fri, Sat) | Thu |
$dow | day of the week (Sun = 0) | 2 |
$week | number of week in year (ISO 8601) | 34 |
$month | month in ISO format | Dec |
$mo | 2 digit month | 12 |
$year | 4 digit year | 1999 |
$ye | 2 digit year | 99 |
$tz | either "GMT" (if set to gmtime), or "Local" (if set to servertime) | GMT |
$iso | ISO format timestamp | 2008-11-21T13:38:22Z |
$rcs | RCS format timestamp | 2021/11/21 13:38:22 |
$http | E-mail & http format timestamp | Fri, 21 Nov 2021 13:38:22 GMT |
$epoch | Number of seconds since 00:00 on 1st January, 1970 | 1227274702 |
- Variables can be shortened to 3 characters
- Example:
%GMTIME{"$day $month, $year - $hour:$min:$sec"}%
expands to 21 Nov, 2008 - 13:38:22
-
Note: When used in a template topic, this variable will be expanded when the template is used to create a new topic. See TWikiTemplates#TemplateTopicsVars for details.
- Related: DISPLAYTIME, GMTIME, REVINFO, SERVERTIME
GRAY -- start gray colored text
-
GRAY
is one of the rendering shortcut settings predefined in TWikiPreferences. See the section rendering shortcut settings in that topic for a complete list of colors.
- Syntax:
%GRAY% gray text %ENDCOLOR%
- Expands to: gray text
- Note:
%<color>%
text must end with %ENDCOLOR%
. If you want to switch from one color to another one you first need to end the active color with %ENDCOLOR%
, e.g. write %RED% some text %ENDCOLOR% %GREEN% more text %ENDCOLOR%
.
- Related: ENDCOLOR, TWikiPreferences, StandardColors
GREEN -- start green colored text
-
GREEN
is one of the rendering shortcut settings predefined in TWikiPreferences. See the section rendering shortcut settings in that topic for a complete list of colors.
- Syntax:
%GREEN% green text %ENDCOLOR%
- Expands to: green text
- Note:
%<color>%
text must end with %ENDCOLOR%
. If you want to switch from one color to another one you first need to end the active color with %ENDCOLOR%
, e.g. write %RED% some text %ENDCOLOR% %GREEN% more text %ENDCOLOR%
.
- Related: ENDCOLOR, TWikiPreferences, StandardColors
GROUPS -- a formatted list of groups
H -- help icon
- Type: Preference variable - TWikiRenderingShortcut.
- Current value: H =
- Related: I, ICON, M, N, P, Q, S, T, U, X, Y
HOMETOPIC -- home topic in each web
HTTP -- get HTTP headers
- Called with the name of an HTTP header field, returns its value. Capitalization and the use of hyphens versus underscores are not significant.
- Syntax:
%HTTP%
- Syntax:
%HTTP{"Header-name"}%
- Examples:
%HTTP% | |
%HTTP{"Accept-language"}% | en-us,en;q=0.5 |
%HTTP{"User-Agent"}% | CCBot/1.0 (+http://www.commoncrawl.org/bot.html) |
-
Note: You can see the HTTP headers your browser sends to the server on a number of sites e.g. http://www.ericgiguere.com/tools/http-header-viewer.html
- Related: HTTPS, REMOTE_ADDR, REMOTE_PORT, REMOTE_USER
HTTP_HOST -- environment variable
HTTPS -- get HTTPS headers
- The same as
%HTTP%
but operates on the HTTPS environment variables present when the SSL protocol is in effect. Can be used to determine whether SSL is turned on.
- Syntax:
%HTTPS%
- Syntax:
%HTTPS{"Header-name"}%
- Related: HTTP, REMOTE_ADDR, REMOTE_PORT, REMOTE_USER
I -- idea icon
- Type: Preference variable - TWikiRenderingShortcut.
- Current value: I =
- Related: H, ICON, M, N, P, Q, S, T, U, X, Y
ICON{"name"} -- small documentation graphic or icon of common attachment types
- Generates the HTML img tag of a small graphic image attached to TWikiDocGraphics. Images typically have a 16x16 pixel size. You can select a specific image by name, or you can give a full filename, in which case the type of the file will be used to select one of a collection of common file type icons.
- Syntax:
%ICON{"name"}%
- Examples:
-
%ICON{"flag-gray"}%
returns
-
%ICON{"pdf"}%
returns
-
%ICON{"smile.pdf"}%
returns
-
%ICON{"/dont/you/dare/smile.pdf"}%
returns
-
%ICON{"http://twiki.org/doc/xhtml.xsl"}%
returns
- Graphic samples:
arrowbright
, bubble
, choice-yes
, hand
- File type samples:
bmp
, doc
,
gif
, hlp
, html
, mp3
, pdf
, ppt
, txt
, xls
, xml
, zip
- Related: ICONURL, ICONURLPATH, TWikiPreferences, FileAttachments, TWikiDocGraphics
ICONURL{"name"} -- URL of small documentation graphic or icon
- Generates the full URL of a TWikiDocGraphics image, which TWiki renders as an image. The related
%ICON{"name"}%
generates the full HTML img tag. Specify image name or full filename (see ICON for details on filenames.)
- Syntax:
%ICONURL{"name"}%
- Examples:
-
%ICONURL{"arrowbright"}%
returns http://www.reteisi.org/twiki/pub/TWiki/TWikiDocGraphics/arrowbright.gif
-
%ICONURL{"novel.pdf"}%
returns http://www.reteisi.org/twiki/pub/TWiki/TWikiDocGraphics/pdf.gif
-
%ICONURL{"/queen/boheme.mp3"}%
returns http://www.reteisi.org/twiki/pub/TWiki/TWikiDocGraphics/mp3.gif
- Related: ICONURLPATH, ICON, TWikiPreferences, FileAttachments, TWikiDocGraphics
ICONURLPATH{"name"} -- URL path of small documentation graphic or icon
- Generates the URL path of a TWikiDocGraphics image, typically used in an HTML img tag. Specify image name or full filename (see ICON for details on filenames.)
- Syntax:
%ICONURLPATH{"name"}%
- Examples:
-
%ICONURLPATH{"locktopic"}%
returns /twiki/pub/TWiki/TWikiDocGraphics/locktopic.gif
-
%ICONURLPATH{"eggysmell.xml"}%
returns /twiki/pub/TWiki/TWikiDocGraphics/xml.gif
-
%ICONURLPATH{"/doc/xhtml.xsl"}%
returns /twiki/pub/TWiki/TWikiDocGraphics/xsl.gif
- Related: ICONURL, ICON, TWikiPreferences, FileAttachments, TWikiDocGraphics
IF{"condition" ...} -- simple conditionals
- Evaluate a condition and show one text or another based on the result. See details in IfStatements
- Syntax:
%IF{"CONDITION" then="THEN" else="ELSE"}%
shows "THEN"
if "CONDITION"
evaluates to TRUE
, otherwise "ELSE"
will be shown
- Example:
%IF{"defined FUNFACTOR" then="FUNFACTOR is defined" else=" is not defined"}%
renders as ==
- Related: $IF() of SpreadSheetPlugin
INCLUDE{"page"} -- include other topic or web page
- Syntax:
%INCLUDE{"page" ...}%
- Supported parameters:
Parameter: | Description: | Default: |
"SomeTopic" | The name of a topic located in the current web, i.e. %INCLUDE{"WebNotify"}% | |
"Web.Topic" | A topic in another web, i.e. %INCLUDE{"TWiki.SiteMap"}% | |
"http://..." | A full qualified URL, i.e. %INCLUDE{"http://twiki.org:80/index.html"}% . Supported content types are text/html and text/plain . if the URL resolves to an attachment file on the server this will automatically translate to a server-side include. | |
pattern="..." | Include a subset of a topic or a web page. Specify a RegularExpression that scans from start ('^' ) to end and contains the text you want to keep in parenthesis, e.g., pattern="^.*?(from here.*?to here).*" . IncludeTopicsAndWebPages has more. | none |
rev="2" | Include a previous topic revision; N/A for URLs | top revision |
raw="on" | When a page is included, normally TWiki will process it, doing the following: 1) Alter relative links to point back to originating host, 2) Remove some basic HTML tags (html, head, body, script) and finally 3) Remove newlines from HTML tags spanning multiple lines. If you prefer to include exactly what is in the source of the originating page set this to on . raw="on" is short for disableremoveheaders="on" , disableremovescript="on" , disableremovebody="on" , disablecompresstags="on" and disablerewriteurls="on" . | disabled |
literal="on" | While using the raw option will indeed include the raw content, the included content will still be processed and rendered like regular topic content. To disable parsing of the included content, set the literal option to "on" . | disabled |
disableremoveheaders="on" | Bypass stripping headers from included HTML (everything until first </head> tag) | disabled |
disableremovescript="on" | Bypass stripping all <script> tags from included HTML | disabled |
disableremovebody="on" | Bypass stripping the </body> tag and everything around over and below it | disabled |
disablecompresstags="on" | Bypass replacing newlines in HTML tags with spaces. This compression step rewrites unmatched <'s into < entities unless bypassed | disabled |
disablerewriteurls="on" | Bypass rewriting relative URLs into absolute ones | disabled |
warn="off" | Warn if topic include fails: Fail silently (if off ); output default warning (if set to on ); else, output specific text (use $topic for topic name) | %INCLUDEWARNING% preferences setting |
section="name" | Includes only the specified named section, as defined in the included topic by the STARTSECTION and ENDSECTION variables. Nothing is shown if the named section does not exists. | |
PARONE="val 1" PARTWO="val 2" | Any other parameter will be defined as a variable within the scope of the included topic. The example parameters on the left will result in %PARONE% and %PARTWO% being defined within the included topic. | |
- Note: JavaScript in included webpages is filtered out as a security precaution per default (disable filter with
disableremovescript
parameter)
- Examples: See IncludeTopicsAndWebPages
- Related: BASETOPIC, BASEWEB, INCLUDINGTOPIC, INCLUDINGWEB, STARTINCLUDE, STOPINCLUDE, STARTSECTION, ENDSECTION
INCLUDINGTOPIC -- name of topic that includes current topic
- The name of the topic that includes the current topic - same as
%TOPIC%
in case there is no include
- Syntax:
%INCLUDINGTOPIC%
- Related: BASETOPIC, INCLUDINGWEB, INCLUDE, TOPIC
INCLUDINGWEB -- web that includes current topic
- The web name of the topic that includes the current topic - same as
%WEB%
if there is no INCLUDE.
- Syntax:
%INCLUDINGWEB%
- Related: BASEWEB, INCLUDINGTOPIC, INCLUDE, WEB
LANGUAGE -- current user's language
- Returns the language code for the language used as the current user. This is the language actually used by TWiki Internationalization (e.g. in user interface).
- The language is detected from the user's browser, unless some site/web/user/session-defined setting overrides it:
- If the
LANGUAGE
preference is set, it's used as user's language instead of any language detected from the browser.
- Avoid defining
LANGUAGE
at a non per-user way, so each user can choose his/her preferred language.
- Related: LANGUAGES
LANGUAGES -- list available TWiki languages
- List the languages available (as
PO
files) to TWiki. Those are the languages in which TWiki's user interface is available.
- Syntax:
%LANGUAGES{...}%
- Supported parameters:
Parameter: | Description: | Default: |
format | format for each item. See below for variables available in the format string. | " * $langname" |
separator | separator between items. | "\n" (newline) |
marker="selected" | Text for $marker if the item matches selection | "selected" |
selection="%LANGUAGE%" | Current language to be selected in list | (none) |
-
format
variables: Variable | Meaning |
$langname | language's name, as informed by the translators |
$langtag | language's tag. Ex: en , pt-br , etc. |
- Example:
<select>%LANGUAGES{format="<option $marker value='$langtag'>$langname</option>" selection="%LANGUAGE%"}%</select>
creates an option list of the available languages with the current language selected
LIME -- start lime colored text
-
LIME
is one of the rendering shortcut settings predefined in TWikiPreferences. See the section rendering shortcut settings in that topic for a complete list of colors.
- Syntax:
%LIME% lime text %ENDCOLOR%
- Expands to: lime text
- Note:
%<color>%
text must end with %ENDCOLOR%
. If you want to switch from one color to another one you first need to end the active color with %ENDCOLOR%
, e.g. write %RED% some text %ENDCOLOR% %GREEN% more text %ENDCOLOR%
.
- Related: ENDCOLOR, TWikiPreferences, StandardColors
LOCALSITEPREFS -- web.topicname of site preferences topic
- The full name of the local site preferences topic. This topic is read for preferences before TWiki.%TWIKIPREFSTOPIC% is read.
- Syntax:
%LOCALSITEPREFS%
- Expands to:
Main.TWikiPreferences
, renders as TWikiPreferences
LOGIN -- present a full login link
LOGOUT -- present a full logout link
M -- moved to... icon
- Type: Preference variable - TWikiRenderingShortcut.
- Current value: M =
- Related: H, I, ICON, N, P, Q, S, T, U, X, Y
MAINWEB -- name of Main web
MAKETEXT -- creates text using TWiki's I18N infrastructure
- Syntax:
%MAKETEXT{"string" args="..."}
- Supported parameters:
Parameter | Description | Default |
"text" or string="text" | The text to be displayed. | none |
args="param1, param2" | a comma-separated list of arguments to be interpolated in the string, replacing the [_N] placeholders in it. | none |
- Examples:
-
%MAKETEXT{string="Notes:"}%
expands to
Notes:
-
%MAKETEXT{"If you have any questions, please contact [_1]." args="%WIKIWEBMASTER%"}%
expands to
If you have any questions, please contact info@reteisi.org.
-
%MAKETEXT{"Did you want to [[[_1]][reset [_2]'s password]]?" args="%TWIKIWEB%.ResetPassword,%WIKIUSERNAME%"}%
expands to
Did you want to reset Main.TWikiGuest's password?
- Notes:
- TWiki will translate the
string
to the current user's language only if it has such string in its translation table for that language.
- Amperstands (
&
) followed by one letter (one of a...z, A...Z) (say, X
) in the translatable string will be translated to <span class='twikiAccessKey'>X</span>
. This is used to implement access keys. If you want to write an actual amperstand that stays just before a letter, write two consecutive amperstands (&&
): they will be transformed in just one.
- translatable string starting with underscores (
_
) are reserved. You cannot use translatable phrases starting with an underscore.
- Make sure that the translatable string is constant. Specially, do not include
%VARIABLES%
inside the translatable strings (since they will get expanded before the %MAKETEXT{...}%
itself is handled).
MAROON -- start maroon colored text
-
MAROON
is one of the rendering shortcut settings predefined in TWikiPreferences. See the section rendering shortcut settings in that topic for a complete list of colors.
- Syntax:
%MAROON% maroon text %ENDCOLOR%
- Expands to: maroon text
- Note:
%<color>%
text must end with %ENDCOLOR%
. If you want to switch from one color to another one you first need to end the active color with %ENDCOLOR%
, e.g. write %RED% some text %ENDCOLOR% %GREEN% more text %ENDCOLOR%
.
- Related: ENDCOLOR, TWikiPreferences, StandardColors
META -- displays meta-data
- Provided mainly for use in templates, this variable generates the parts of the topic view that relate to meta-data (attachments, forms etc.) The
formfield
item is the most likely to be useful to casual users.
- Syntax:
%META{ "item" ...}%
- Parameters:
Item | Options | Description |
"formfield" | name="..." : name of the field. The field value can be shortened as described in FormattedSearch for $formfield newline="..." : by default, each newline character will be rewritten to <br /> to allow metadata that contains newlines to be used in tables, etc. $n indicates a newline character. bar="..." : by default, each vertical bar is rewritten to an HTML entity so as to not be mistaken for a table separator. | Show a single form field |
"form" | none | Generates the table showing the form fields. See Form Templates |
"attachments" | all="on" to show hidden attachments. title="..." to show a title - only if attachments are displayed. template="..." to use a custom template for the rendering of attachments; default attachtables is used. | Generates the list of attachments |
"moved" | none | Details of any topic moves |
"parent" | dontrecurse="on" : By default recurses up tree, this has some cost. nowebhome="on" : Suppress WebHome. prefix="..." : Prefix that goes before parents, but only if there are parents, default "" . format="..." : Format string used to display each parent topic where $web expands to the web name, and $topic expands to the topic name; default: "[[$web.$topic][$topic]]" suffix="..." : Suffix, only appears if there are parents; default "" . separator="..." : Se |