Help:Variables

      Date and time

      The following variables return the current date and time in UTC.

      Due to software and browser caching, these variables frequently show when the page was cached rather than the current time.

      Variable Output Description
      {{CURRENTYEAR}} 2013 Year
      {{CURRENTMONTH}} 06 Month (zero-padded number)
      {{CURRENTMONTHNAME}} June Month (name
      {{CURRENTMONTHNAMEGEN}} June Month (genitive form)
      {{CURRENTMONTHABBREV}} Jun Month (abbreviation)
      {{CURRENTDAY}} 19 Day of the month (unpadded number)
      {{CURRENTDAY2}} 19 Day of the month (zero-padded number)
      {{CURRENTDOW}} 3 Day of the week (unpadded number)
      {{CURRENTDAYNAME}} Wednesday Day of the week (name)
      {{CURRENTTIME}} 01:44 Time (24-hour HH:mm format)
      {{CURRENTHOUR}} 01 Hour (24-hour zero-padded number)
      {{CURRENTWEEK}} 25 Week (number)
      {{CURRENTTIMESTAMP}} 20130619014413 YYYYMMDDHHmmss timestamp
      ↑Jump back a section

      Technical metadata

      Revision variables return data about the latest edit to the current page, even if viewing an older version of the page.

      Site

      Variable Output Description
      {{SITENAME}} Wikibooks The wiki's site name
      {{SERVER}} //en.wikibooks.org domain URL
      {{SERVERNAME}} en.wikibooks.org domain name
      {{SCRIPTPATH}} /w relative script path
      {{STYLEPATH}} //bits.wikimedia.org/static-1.22wmf7/skins relative style path
      {{CURRENTVERSION}} 1.22wmf7 (9977877) The wiki's MediaWiki version.
      {{CONTENTLANGUAGE}}
      {{CONTENTLANG}}
      en
      en
      The wiki's default interface language

      Latest revision to current page

      Variable Output Description
      {{REVISIONID}} 2016821 Unique revision ID
      {{REVISIONDAY}} 13 Day edit was made (unpadded number)
      {{REVISIONDAY2}} 13 Day edit was made (zero-padded number)
      {{REVISIONMONTH}} 01 Month edit was made (zero-padded number)
      {{REVISIONYEAR}} 2011 Year edit was made
      {{REVISIONTIMESTAMP}} 20110113165154 Timestamp as of time of edit
      {{REVISIONUSER}} Adrignola The username of the user who made the most recent edit to the page, or the current user when previewing an edit
      ↑Jump back a section

      Statistics

      Numbers returned by these variables normally contain separators (commas or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, {{NUMBEROFPAGES}} → 168,968 and {{NUMBEROFPAGES:R}} → 168968). Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example {{PAGESINCATEGORY:Help}} and {{PAGESINCATEGORY:Help|R}}).

      Variable Output Description
      {{NUMBEROFPAGES}} 168,968 Number of wiki pages.
      {{NUMBEROFARTICLES}} 47,208 Number of pages in content namespaces.
      {{NUMBEROFFILES}} 7,182 Number of uploaded files.
      {{NUMBEROFEDITS}} 2,556,752 Number of page edits.
      {{NUMBEROFVIEWS}} Number of page views. Usually useless on a wiki using caching.
      {{NUMBEROFUSERS}} 982,894 Number of registered users.
      {{NUMBEROFADMINS}} 9 Number of users in the [[Wikibooks:Administrators|administrator group.
      {{NUMBEROFACTIVEUSERS}} 453 Number of active users, based on the criteria used in Special:Statistics.
      {{NUMBERINGROUP:groupname}}
      {{NUMINGROUP:groupname}}
      3
      3
      ({{NUMBERINGROUP:bureaucrat}} used here)
      Number of users in a specific group.
      ↑Jump back a section

      Namespaces

      Variable Output Description
      {{NAMESPACE}} Help Name of the page's namespace
      {{SUBJECTSPACE}}
      {{ARTICLESPACE}}
      Help
      Help
      Name of the associated content namespace
      {{TALKSPACE}} Help talk Name of the associated talk namespace

      The following are equivalents encoded for use in URLs (spaces replaced with underscores and some characters percent-encoded):

      • {{NAMESPACEE}}
      • {{SUBJECTSPACEE}}
      • {{TALKSPACEE}}

      These can take a page name and will return the namespace of the page name parameter, instead of the current page's:

      • {{NAMESPACE:Template:Main Page}}Template
      • {{SUBJECTSPACE:Template:Main Page}}Template
      • {{TALKSPACE:Template:Main Page}}Template talk
      ↑Jump back a section

      Page names

      Variable Output Description
      {{FULLPAGENAME}} Help:Variables Namespace and page title.
      {{PAGENAME}} Variables Page title.
      {{BASEPAGENAME}} Variables Page title excluding the current subpage and namespace ("Title/foo" on "Title/foo/bar").
      {{SUBPAGENAME}} Variables The subpage title ("foo" on "Title/foo").
      {{SUBJECTPAGENAME}} Help:Variables The namespace and title of the associated content page.
      {{TALKPAGENAME}} Help talk:Variables The namespace and title of the associated talk page.

      The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters percent-encoded):

      • {{FULLPAGENAMEE}}
      • {{PAGENAMEE}}
      • {{BASEPAGENAMEE}}
      • {{SUBPAGENAMEE}}
      • {{SUBJECTPAGENAMEE}}
      • {{TALKPAGENAMEE}}

      These can all allow specification of the page to be operated on, instead of just the current page:

      • {{PAGENAME:Template:Main Page}}Main Page
      ↑Jump back a section

      Pseudo variables

      Some templates have been created that mimic the above variables. While the variables in the above section use a colon (:) to specify a page for output if desired, these will use a pipe (|) for inputting a page. For example, {{BOOKNAME|Wikijunior:Bugs}} can be used to get Bugs.

      Template Description
      {{NUMBEROFBOOKS}} Returns the number of books at Wikibooks.
      {{BOOKTEMPLATE}} Returns the name of a template with the same name as the book it's used in.
      {{BOOKNAME}} Returns the name of the book without the namespace.
      {{FULLBOOKNAME}} Returns the name of the book including the namespace.
      {{ROOTBOOKNAME}} Returns the name of the book associated with the page on which it's used.
      {{TALKBOOKNAME}} Returns the associated discussion page for a book as a whole.
      {{CHAPTERNAME}} Returns the chapter that a page is in and ignores anything beyond that.
      {{FULLCHAPTERNAME}} Returns the full name of a chapter or the book name if it isn't a chapter.

      For the latter templates, it's easier to see the difference between them by viewing a side-by-side comparison of their outputs.

      Input Pages and Outputs
      Template Chess/Puzzles/Directmates Wikijunior:Dinosaurs/Apatosaurus Category:Horticulture/Templates/Boxes Wikijunior talk:Bugs/Shield Bug
      {{BOOKNAME}} Chess Dinosaurs Horticulture Bugs
      {{FULLBOOKNAME}} Chess Wikijunior:Dinosaurs Category:Horticulture Wikijunior talk:Bugs
      {{ROOTBOOKNAME}} Chess Wikijunior:Dinosaurs Horticulture Wikijunior:Bugs
      {{TALKBOOKNAME}} Talk:Chess Wikijunior talk:Dinosaurs Talk:Horticulture Wikijunior talk:Bugs
      {{CHAPTERNAME}} Puzzles Apatosaurus Templates Shield Bug
      {{FULLCHAPTERNAME}} Puzzles/Directmates Apatosaurus Templates/Boxes Shield Bug
      ↑Jump back a section
      Last modified on 13 January 2011, at 16:51