Magic Words look like template calls (surrounded 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.
Magic Word | Meaning | Example | |||
---|---|---|---|---|---|
{{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 | |||
{{PAGENAMENS}} | Returns the title of the current wiki page, without any leading namespace: or following (suffix) | 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 or stubs (very short 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:
Magic Word | Meaning | Example |
---|---|---|
{{CURRENTTIME}} | Returns the current time | 03:22 |
{{CURRENTHOUR}} | Returns the current hour | 03 |
{{CURRENTTIMESTAMP}} | Returns the current date and time | 202404200322 |
{{CURRENTTIMESTAMP2}} | Returns the current date and time in a prettier format | Sat Apr 20, 2024, 3:22:39 AM |
{{CURRENTDAY}} | Returns the current day of the month | 20 |
{{CURRENTDOW}} | Returns the current day of the week | Sat |
{{CURRENTDOWNAME}} | Returns the name of the current day of the week | Saturday |
{{CURRENTDOY}} | Returns the current day of the year | 111 |
{{CURRENTMONTH}} | Returns the number of the current month (zero-padded to 2 characters) | 04 |
{{CURRENTMONTHNAME}} | Returns the name of the current month | April |
{{CURRENTMONTHABBREV}} | Returns the abbreviated name of the current month | Apr |
{{CURRENTYEAR}} | Returns the current year | 2024 |
|