Revision as of 2010-12-02 09:38:39
  Older version (diff) | current version (diff) | Newer version (diff)

Wiki:Magic Words  

< Documentation

Magic Words look like template calls (surround by double curly braces) but most have no parameters and return a system variable value. Traditionally they are always typed in all-caps to make them easy to see in the template code, but they are actually case-insensitive.

URL Magic
Magic WordMeaningExample
{{PAGENAME}}Returns the title of the current wiki page, without any leading namespace:Magic Words
{{PAGENAMEE}}Returns the url-encoded title of the current wiki page, without any leading namespace:Magic_Words
{{NAMESPACE}}Returns the url-encoded namespace portion of the current wiki page title (without the colon)Wiki
{{ARTICLES|category}} (proposed)Returns the number of articles in a given category, or the total number of articles in the wikibase, not including category pages.ARTICLES
{{PAGES|category}} (proposed)Returns the total number of pages in a given category, or the total number of pages in the wikibase, including category pages.PAGES
About the following Magic Words:
  • If you are not a registered user or are not logged in, Time is given as UTC.
  • If you are logged in the timezone value in your profile is used to adjust the date/time to your local timezone.

Date/Time Magic
Magic WordMeaningExample
{{CURRENTTIME}}Returns the current time 08:16
{{CURRENTHOUR}}Returns the current hour 08
{{CURRENTTIMESTAMP}}Returns the current date and time202404250816
{{CURRENTTIMESTAMP2}}Returns the current date and time in a prettier formatThu Apr 25, 2024, 8:16:30 PM
{{CURRENTDAY}}Returns the current day of the month25
{{CURRENTDOW}}Returns the current day of the weekThu
{{CURRENTDAY2}}Returns the current day of the month (zero-padded to 2 characters)CURRENTDAY2
{{CURRENTDAYNAME}}Returns the name of the current day of the week CURRENTDAYNAME
{{CURRENTMONTH}}Returns the number of the current month (zero-padded to 2 characters)04
{{CURRENTMONTHNAME}}Returns the name of the current monthApril
{{CURRENTMONTHABREV}}Returns the abbreviated name of the current month Apr
{{CURRENTYEAR}}Returns the current year2024

This page last modified 2010-12-02 09:38:39.