Variables
Documentation > Handbook > Variables
Variables are bits of data connected with a page or other system information that can be retrieved into a page. BoltWire offers many powerful database-like capabilities.
It is possible to define additional variables as desired, or reset the values of existing variables in a plugin or config file.
System variables
About the system
| {version} | current version of BoltWire |
| {now} | time (unix time stamp) |
| {captcha} | four digit random number |
| {return} | link to referrer page |
| {ip} | IP address of visitor |
| {domain} | domain name of website |
| {field} | name of wiki field |
| {script} | full path to script |
| {action} | current action if any |
About the member
| {id} | member id |
| {member} | member name |
| {memberships} | current group memberships |
About the current page
These system variables return data about the current page, so they work like data variables. The difference, besides the syntax, is that the values are derived from the page name rather than stored as data:
| {p} | full page name |
| {p0} | page name index (number of parts) |
| {p1}, {p2}, {p3}... | part 1, part 2, part 3... of page name |
| {page} | last part of page name |
| {title} | title (or last part of page name if title is not set) |
| {data} | CSV list of all defined data variables |
You can define your own system variables in a config file by adding a line like this:
$BOLTvar['$myvar'] = 'some value';
This will set {myvar} to "some value" wherever it is found. You can use simple PHP commands when defining the value, based on your needs.
Data variables
These variables are data related with one page. They are created and edited with the action data or with custom forms. See some info here on data management.
Their syntax is:
| {:variablename} | variable from the current page |
| {pagename:variablename} | variable from another page |
Three page data variables are created automatically in the default page editing routines:
| {:author} | last person to edit the page. |
| {:changesummary} | most recent change summary |
Note: A "title" data variable {:title} is generated dynamically from the page name, if no custom title value is set. It is exactly equivalent to the page variable {title}.
The list of current page data variables is returned by the {data} system variable.
Info variables
Their values are extracted from the actual text of a page, where they are defined this way (even hidden inside comments):
<code>
variablename: value
</code>
Their syntax is:
| {::variablename} | extracts a value from the current page |
| {pagename::variablename} | extracts a value from another page |
Here are more details on info variables.
Special variables
To be documented.
| {?var} | a get or post value, can also retrieve cookie info |
| {~var}, {~id:var} | a shortcut for data value on members page |
| {=var} | field replacement used in a form |
| {+var}, {+:var} | page or data field insertion used in a template |
| {*:var}, {page*:var} | special shortcut to get data values from a stamp |
Snippets
These variables have the syntax $$variablename. They can be used inside skin pages or regular markup zones and can contain BoltWire markups. They were formerly call skin vars.
They are defined in the page code.snippets either in the form of an info var or as an anchored section. In the default skin the site name and slogan are defined as snippets.
<code>
var1: value
Some text
On more the
One line...
</code>
To see the snippets currently defined on your system, or to edit them, view page code.snippets.
Snippets are a convenient way to keep text or code pieces that are common to several skins or zones, and change all of them from one place.

