Difference between revisions of "Help:Variables"
(incomplete) |
Lostinbali (talk | contribs) m |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | A '''variable''' is called in the form of a [[Help:Template|template]] (one without parameters). Variables often refer to specific aspects of the respective page or the wiki, or to time and date variables. |
+ | |||
+ | {| class= "wikitable" style="border:1px black solid" | ||
+ | ! | ||
+ | |- | ||
+ | | Date || || | ||
+ | |- | ||
+ | | <tt><nowiki>{{CURRENTDAY}}</nowiki></tt> || {{CURRENTDAY}} || Displays day | ||
+ | |- | ||
+ | | <tt><nowiki>{{CURRENTYEAR}}</nowiki></tt> || {{CURRENTYEAR}} || Displays year | ||
+ | |- | ||
+ | | <tt><nowiki>{{CURRENTMONTHNAME}}</nowiki></tt> || {{CURRENTMONTHNAME}} || Displays month | ||
+ | |- | ||
+ | | <tt><nowiki>{{CURRENTTIME}}</nowiki></tt> || {{CURRENTTIME}} || Displays time | ||
+ | |- | ||
+ | | <tt><nowiki>{{CURRENTHOUR}}</nowiki></tt> || {{CURRENTHOUR}} || Displays hour | ||
+ | ! | ||
+ | |- | ||
+ | | Page Info || || | ||
+ | |- | ||
+ | | <tt><nowiki>{{PAGENAME}}</nowiki></tt> || {{PAGENAME}} || Displays name of page (without namespace) | ||
+ | |- | ||
+ | | <tt><nowiki>{{PAGENAMEE}}</nowiki></tt> || {{PAGENAMEE}} || Same as PAGENAME, but formatted for an URL. | ||
+ | |} | ||
+ | |||
+ | Also, in templates, you can specify a variable in it with <nowiki>{{{VARNAME}}}</nowiki>. | ||
+ | |||
+ | Then, when the template is put onto another page, you can specify the variable as follows: | ||
+ | <nowiki>{{TEMPLATENAME | VARNAME = VALUE }}</nowiki> | ||
+ | which replaces the variable with VALUE. Note that if you name the variables <nowiki>{{{1}}},{{{2}}},{{{3}}}</nowiki>, etc. then you can specify the values without listing the variable names in the template call. | ||
+ | == See also == | ||
+ | *[http://meta.wikimedia.org/wiki/Help:Variable MetaWiki] | ||
+ | |||
+ | {{tutorial}} |
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}} | 08:13 | Displays time | |
{{CURRENTHOUR}} | 08 | 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.