Difference between revisions of "Help:Variables"

(variables in templates)
m
 
(2 intermediate revisions by one other user not shown)
Line 17: Line 17:
 
!
 
!
 
|-
 
|-
| More || ||
+
| Page Info || ||
 
|-
 
|-
 
| <tt><nowiki>{{PAGENAME}}</nowiki></tt> || {{PAGENAME}} || Displays name of page (without namespace)
 
| <tt><nowiki>{{PAGENAME}}</nowiki></tt> || {{PAGENAME}} || Displays name of page (without namespace)
Line 32: Line 32:
 
*[http://meta.wikimedia.org/wiki/Help:Variable MetaWiki]
 
*[http://meta.wikimedia.org/wiki/Help:Variable MetaWiki]
  
[[Category:Tutorial]]
+
{{tutorial}}
{{incomplete|article}}
 

Latest revision as of 17:04, 20 October 2024

A variable is called in the form of a template (one without parameters). Variables often refer to specific aspects of the respective page or the wiki, or to time and date variables.

Date
{{CURRENTDAY}} 22 Displays day
{{CURRENTYEAR}} 2024 Displays year
{{CURRENTMONTHNAME}} November Displays month
{{CURRENTTIME}} 14:32 Displays time
{{CURRENTHOUR}} 14 Displays hour
Page Info
{{PAGENAME}} Variables Displays name of page (without namespace)
{{PAGENAMEE}} Variables Same as PAGENAME, but formatted for an URL.

Also, in templates, you can specify a variable in it with {{{VARNAME}}}.

Then, when the template is put onto another page, you can specify the variable as follows:

{{TEMPLATENAME | VARNAME = VALUE }}

which replaces the variable with VALUE. Note that if you name the variables {{{1}}},{{{2}}},{{{3}}}, etc. then you can specify the values without listing the variable names in the template call.

See also

This article is a tutorial about the AoPSWiki or AoPS Forum.