The attachment URL of the current topic, is http://dualopt1.cmm.msu.ru/pub/TWiki/TWikiVariables Example: If you attach a file you can refer to it as %ATTACHURL%/image.gif
> >
The attachment URL of the current topic, is http://dualopt1.cmm.msu.ru/pub/TWiki/TWikiVariables Example: If you attach a file you can refer to it as %ATTACHURL%/image.gif
%ATTACHURLPATH%
The path of the attachment URL of the current topic, is /pub/TWiki/TWikiVariables
Line: 114 to 115
separator=", "
line separator
"\n" (new line)
web="Name"
Name of web
Current web
Examples:
Changed:
< <
%TOPICLIST{" * $web.$name"}% creates a bullet list of all topics.
%TOPICLIST{separator=", "}% creates a comma separated list of all topics.
%TOPICLIST{" <option>$name</option>"}% creates an option list (for drop down menus).
> >
%TOPICLIST{" * $web.$name"}% creates a bullet list of all topics.
%TOPICLIST{separator=", "}% creates a comma separated list of all topics.
%TOPICLIST{" <option>$name</option>"}% creates an option list (for drop down menus).
%WEBLIST{"format"}%
Web index, e.g. list of all webs. Hidden webs are excluded, e.g. webs with a NOSEARCHALL=on preference variable. The "format" defines the format of one web item. The $name variable gets expanded to the name of the web, $qname gets expanded to double quoted name, $marker to marker where web matches selection.
Line: 127 to 128
separator=", "
line separator
"\n" (new line)
webs="public"
comma sep list of Web, public expands to all non-hidden
"public"
marker="selected"
Text for $marker where item matches selection, otherwise equals ""
"selected"
Changed:
< <
selection
Current value e.g. current for current Web, =section="%WEB%"
Examples: %WEBLIST{" * [[$name.WebHome]]"}% creates a bullet list of all webs.
> >
selection="%WEB%"
Current value to be selected in list
section="%WEB%"
Examples: %WEBLIST{" * [[$name.WebHome]]"}% creates a bullet list of all webs.
%WEBLIST{"" webs="Trash,public" selection="TWiki" separator=" "}% Dropdown of all public Webs + Trash Web, current Web highlighted.
Line: 147 to 148
$mo
2 digit month
12
$year
4 digit year
1999
$ye
2 digit year
99
Changed:
< <
Variables can be shortened to 3 characters. Example: %GMTIME{"$day $month, $year - $hour:$min:$sec"}% is 10 Apr, 2016 - 09:49:38
> >
Variables can be shortened to 3 characters. Example: %GMTIME{"$day $month, $year - $hour:$min:$sec"}% is 10 Apr, 2016 - 09:49:38
%SERVERTIME%
Server time, is 2016-04-10 - 12:49
%SERVERTIME{"format"}%
Changed:
< <
Formatted server time. Example: %SERVERTIME{"$hou:$min"}% is 12:49
> >
Formatted server time. Example: %SERVERTIME{"$hou:$min"}% is 12:49
%HTTP_HOST%
HTTP_HOST environment variable, is dualopt1.cmm.msu.ru
What sort of search is required? "topicmoved" if search for a topic that may have been moved "parent" if searcing for topics that have a specific parent i.e. its children
required
web="%WEB%"
Wiki web to search: A web, a list of webs separated by whitespace, or all webs.
required
topic="%TOPIC%"
The topic the search relates to
required
title="Title"
Text the is pre-pended to any search results
required
Example: %METASEARCH{type="topicmoved" web="%WEB%" topic="%TOPIC%" title="This topic used to exist and was moved to: "}%, you may want to use this in WebTopicViewTemplate and WebTopicNonWikiTemplate %METASEARCH{type="parent" web="%WEB%" topic="%TOPIC%" title="Children: "}%
%VAR{"NAME" web="Web"}%
Get a preference value from a web other then the current one. Example: To get %WEBBGCOLOR% of the Main web write %VAR{"WEBBGCOLOR" web="Main"}%, is #FFEFA6
Line: 332 to 346
Setting Preferences
Changed:
< <
The syntax for Preferences variables is the same anywhere in TWiki. In Edit mode, from the start of a new line: [6 spaces] * [space] Set [space] VARIABLENAME [space] = [value] Example:
> >
The syntax for Preferences variables is the same anywhere in TWiki. In Edit mode, from the start of a new line: [6 spaces] * [space] Set [space] VARIABLENAME [space] = [value] Example:
Set VARIABLENAME = value
Creating Custom Variables
Line: 340 to 354
You can add your own preference variables for an entire site, a single web, or a single topic, using the standard syntax. Whatever you include in your variable will be expanded on display, and treated exactly as if it had been written out. So you can place formatted text, page links, image paths.
Changed:
< <
Example: Create a custom logo variable
> >
Example: Create a custom logo variable
To place a logo anywhere in a web by typing %MYLOGO%, simply define the variable on the web's WebPreferences page. You also have to upload logo.gif - this can be done by attaching a file to LogoTopic (any topic name you choose):
Set MYLOGO = %PUBURLPATH%/%MAINWEB%/LogoTopic/logo.gif
Text strings expanded on the fly include predefined, preference-driven and custom-defined data
Overview
TWikiVariables are text strings enclosed in percentage signs: %VARIABLE% that represent stored data. When a topic is rendered for viewing, defined variables are replaced by their actual values. TWiki has two types of variable, predefined and Preference-based, where usually you determine the content. Through Preference variables, you can also define custom variables, creating new variable name and value. TWiki variables are as simple to use as they are powerful, and vice versa!
Changed:
< <
Predefined Variables
> >
Predefined Variables
With a couple of notable exceptions, predefined variables return set values that are defined one-time on installation and left alone. Most are directory names and file paths, customized for your server, and only have to be updated once in the main configuration file if your server set-up changes.
Line: 214 to 218
[2] Note: A web can be excluded from a web="all" search if you define a NOSEARCHALL=on variable in its WebPreferences.
Changed:
< <
Preferences Variables
> >
Preferences Variables
Additional variables are defined in the preferences ( site-level ( SL ) in TWikiPreferences, web-level ( WL ) in WebPreferences of each web, and user level ( UL ) preferences in individual user topics):
Line: 324 to 328
List of preferences that are not allowed to be overridden by next level preferences
Changed:
< <
Setting Preferences
> >
Setting Preferences
The syntax for Preferences variables is the same anywhere in TWiki. In Edit mode, from the start of a new line: [6 spaces] * [space] Set [space] VARIABLENAME [space] = [value] Example:
Set VARIABLENAME = value
Changed:
< <
Creating Custom Variables
> >
Creating Custom Variables
You can add your own preference variables for an entire site, a single web, or a single topic, using the standard syntax. Whatever you include in your variable will be expanded on display, and treated exactly as if it had been written out. So you can place formatted text, page links, image paths.
You can add your own preference variables for an entire site, a single web, or a single topic, using the standard syntax. Whatever you include in your variable will be expanded on display, and treated exactly as if it had been written out. So you can place formatted text, page links, image paths.
Changed:
< <
HOW-TO: Create a custom logo variable
To place a logo anywhere in a web by typing %MYLOGO%, simply define the variable on the web's WebPreferences page. In this case, you also have to upload logo.gif to the same directory.:
> >
Example: Create a custom logo variable
To place a logo anywhere in a web by typing %MYLOGO%, simply define the variable on the web's WebPreferences page. You also have to upload logo.gif - this can be done by attaching a file to LogoTopic (any topic name you choose):
Set MYLOGO = %PUBURLPATH%/%MAINWEB%/LogoTopic/logo.gif