v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Template:ArticleVersion/help

From Dwarf Fortress Wiki
< Template:ArticleVersion
Revision as of 21:50, 24 April 2013 by Lethosor (talk | contribs) (Created page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

{{av}} is a complex template - this is a reference guide explaining some important parts.

Structure[edit]

This template consists of 2 main parts: Variable definitions and a table (as well as documentation).

Variables[edit]

Variables are used to cut down on #ifexist - storing the result in a variable does not require multiple, identical invocations of an expensive parser function (also, it's a lot easier to read).

The variables defined in the template are list

  • PAGE: The current page - uses the first parameter to av if specified, or defaults to {{PAGENAME}} (this is not implemented completely – you can specify a page name for av to use, but the colors are still determined by the namespace)
  • Existence checks
    • e4, e3, e2, e1: These variables are set to 1 if the article exists in the corresponding namespace. The e stands for "exists".
      • Currently, DF2012=4, v0.31=3, 40d=2, and 23a=1. DF2012 is likely to change when the next version is released, so using the namespace as the variable name would make updating the template harder.
      • Note that this variable is blank when the page does not exist (this is for easy use with #if, which treats a blank string as false). If you need 0 to represent false, use {{#var:e4|0}} (this technique is used with eboth)
    • emw: 1 if the page exists in the Masterwork (mod) namespace
    • evan (Abbreviation of "exists in vanilla DF"): 1 if the page exists in any vanilla namespace
    • emod: 1 if the page exists in any mod namespace. This is currently redundant, since Masterwork is the only mod currently implemented. However, this should not be used when checking for a mod (don't resort to emw just because it works at the moment)
    • ismod: 1 if the current page is about a mod (not exactly related, but close enough)
    • eboth: 1 if the page exists in a vanilla and mod namespace
    • enone: 1 if the page does not exist in a vanilla or mod namespace (this is not the opposite of eboth - both are blank if the page exists in one set of namespaces but not the other)