1. VW3
  2. Parser Extensions
Printable Version

https://www.vaultwiki.org/pages/Help/VaultWiki-3-Manual/VW3:Parser-Extensions
This page is a chapter in VW3 Editing Syntax

This page has been seen 402,924 times.

    • Created by on
      Last updated by on
Some syntax is only available in VaultWiki Premium.

Template Conditionals

The [if] code only works in Template pages. Using it, you can create Templates that produce different output depending on the input provided.
Code:
[if="{{{param}}}"]Param exists[else /]Param does not exist[/if]

You can also use comparative operators (<, >, <=, >=, ==, !=, ===, !==) in the code:
Code:
[if="{{{number}}} < 4"]Number is small.[else /]I like big numbers.[/if]

Whitespace is stripped from the following places: after the opening tag, around the [else /] tag, and before the closing tag. This allows you to create readable nested conditional code without worrying about the added whitespace. If you actually wanted to keep whitespace here, you need to break your code into multiple tags, or if HTML is enabled, you can use the appropriate entity code.

Variables

The [var] code allows editors to insert a lot of information that is only available behind-the-scenes. The value of the tag should be the name of the variable you wish to use. If the variable accepts any arguments, you can add those as well, separating them with the | separator.
Code:
[var]varname|args[/var]


Current Time

When a user visits a page, the following variables display the current time, formatted in various ways. The page is still eligible for caching, so the time may become out of sync.
  • CURRENT
  • CURRENTDAY
  • CURRENTDAY2
  • CURRENTDAYNAME
  • CURRENTDOW
  • CURRENTHOUR
  • CURRENTMONTH
  • CURRENTMONTHABBREV
  • CURRENTMONTHNAME
  • CURRENTMONTHNAMEGEN
  • CURRENTTIME
  • CURRENTTIMESTAMP
  • CURRENTWEEK
  • CURRENTYEAR
Another one is called CURRENTVERSION, which is not time-related. Instead, it shows the current VaultWiki version.

Article-related

DISPLAYTITLE replaces the title of the current article with the provided argument.
TYPE appends the provided argument to the end of the title, as a subtitle.
Neither of these affect the article's URL.

Counters

NUMBEROFARTICLES returns the number of articles in the current namespace.
NUMBEROFPAGES returns the number of articles in all namespaces.
PAGESINNS and PAGESINNAMESPACE both accept a numerical Namespace ID as an argument, and they both return the number of pages in that namespace.
NUMBEROFEDITS returns the number of edits for all articles in all namespaces.

All of these variables accept the R argument, which returns the number without applying any formatting.

The following variables return information about the current revision of the page:
  • REVISIONID
  • REVISIONDAY
  • REVISIONDAY2
  • REVISIONMONTH
  • REVISIONYEAR
  • REVISIONTIMESTAMP
  • REVISIONUSER

USER returns information about the user currently viewing the page. A page that uses this variable cannot be added to the post cache. To return specific data, include the name of the field as the argument. Passwords and other sensitive fields cannot be returned with this code.

Accessibility

DIRMARK and DIRECTIONMARK return the current page's text-direction.
CONTENTLANGUAGE returns the current page's language.

URLENCODE prepares the argument for transmission via a URL or form data.

PAGENAME returns the title of the current article.
NAMESPACE returns the ID of the namespace containing the current article.
FULLPAGENAME returns the namespace and title of the current article.
FULLPAGENAMEE returns the encoded title of the article, as used in the article's URL.
SITENAME returns the title of the wiki. This is usually the title of the default namespace.
SERVER returns the path to your forums.
SERVERNAME returns the domain name.
SCRIPTPATH returns the relative path to the current page.