1. VW3
  2. Creating Templates
Printable Version

https://www.vaultwiki.org/pages/Help/VaultWiki-3-Manual/VW3:Creating-Templates
This page is a chapter in VW3 Introduction to Templates

This page has been seen 1,153,767 times.

    • Created by on
      Last updated by on
This Chapter covers the usage.
How to use write wiki templates in VaultWiki. Written for VaultWiki 3.x, but still largely applicable to VaultWiki 4.x.
For other variations, please refer to Templates (Disambiguation).
Visit a forum in your Template namespace, and create a new article. The content of this article will be inserted into others whenever the Template is used.

Post-New-Article-2.jpg
You can also add replacement variables, called "Parameters", to the content.

The values of these Parameters will be defined later when you actually use the Template.

There are two types of Parameters:
  • Numerical - These will be replaced in the order values are provided.
    Code:
    {{{number}}}
    {{{number|default_value}}}

  • Named - These will be replaced with the value that matches the corresponding Parameter name.
    Code:
    {{{name}}}
    {{{name|default_value}}}
Both Numerical and Named Parameters can be given default values. If no value is provided when using the Template, the default value will be used.

Note:For complex templates, we recommend using Named Parameters rather than Numerical Parameters.