Help:Variables

From Wiki
Jump to: navigation, search

MediaWiki knows some defined variables which can be used in texts. They are rendered differently depending on the time, the site and the page. Their syntax is similar to templates. If you want a page to show always the current time, you use {{CURRENTTIME}}. To distinguish variables from templates, most variables are capitalized.

Template:Hl3|Description Template:Hl3|You type Template:Hl3|You get
Template:Hl2 colspan="3" | Date & Wiki variables
Current month {{CURRENTMONTH}} 05
Current month {{CURRENTMONTHNAME}} May
Genitive form
of current month name
{{CURRENTMONTHNAMEGEN}} May
Abbreviated month name {{CURRENTMONTHABBREV}} May
Day of the month {{CURRENTDAY}} 1
Day of the week {{CURRENTDOW}} 3
Day of the week {{CURRENTDAYNAME}} Wednesday
Week {{CURRENTWEEK}} 18
Year {{CURRENTYEAR}} 2024
current time {{CURRENTTIME}} 23:18
numbers of articles in this Wiki {{NUMBEROFARTICLES}} 380
numbers of uploaded files {{NUMBEROFFILES}} 1,166
Template:Hl2 colspan="3" | Namespaces
{{ns:-2}} or {{ns:Media}} Media
{{ns:-1}} or {{ns:Special}} Special
{{ns:1}} or {{ns:Talk}} Talk
{{ns:2}} or {{ns:User}} User
{{ns:3}} or {{ns:User_talk}} User talk
{{ns:4}} or {{ns:Project}} Wiki
{{ns:5}} or {{ns:Project_talk}} Wiki talk
{{ns:6}} or {{ns:Image}} File
{{ns:7}} or {{ns:Image_talk}} File talk
{{ns:8}} or {{ns:MediaWiki}} MediaWiki
{{ns:9}} or {{ns:MediaWiki_talk}} MediaWiki talk
{{ns:10}} or {{ns:Template}} Template
{{ns:11}} or {{ns:Template_talk}} Template talk
{{ns:12}} or {{ns:Help}} Help
{{ns:13}} or {{ns:Help_talk}} Help talk
{{ns:14}} or {{ns:Category}} Category
{{ns:15}} or {{ns:Category_talk}} Category talk
Template:Hl2 colspan="3" | Server specific
Sitename {{SITENAME}} Wiki
Servername {{SERVERNAME}} www.celica-club.co.uk
Server {{SERVER}} http://www.celica-club.co.uk
Script path {{SCRIPTPATH}} /wiki
Local part of the URL
{{localurl:pagename}} /wiki/index.php?title=Pagename
{{localurl:pagename|query string}} /wiki/index.php?title=Pagename&query string
Template:Hl2 colspan="3" | Page related
Pagename {{PAGENAME}} Variables
Pagename
(URL encoded)
{{PAGENAMEE}} Variables
Namespace {{NAMESPACE}} Help
Revision ID {{REVISIONID}} 1583