Logo name
Personal tools

Help:Variable

From Nissan 350Z & 370Z Wiki


This is a list of variables that can be used in the wikitext. The way they are rendered depends on the time, on the project, or on the page in which it occurs.

On the left is the variable, on the right how it is rendered at this time, in this project, on this page.

The names of the variables form part of the set of so-called "magic words" the system uses.

Contents

Constants depending on parameters

{{ns:-2}}, {{ns:Media}} Media, Media
{{ns:-1}}, {{ns:Special}} Special, Special
{{ns:0}} ( main namespace ) ( empty string )
{{ns:1}}, {{ns:Talk}} Talk, Talk
{{ns:2}}, {{ns:User}} User, User
{{ns:3}}, {{ns:User_talk}} User_talk, User_talk
{{ns:4}}, {{ns:Project}} Nissan_350Z_&_370Z_Wiki, Nissan_350Z_&_370Z_Wiki
{{ns:5}}, {{ns:Project_talk}} Nissan_350Z_&_370Z_Wiki_talk, Nissan_350Z_&_370Z_Wiki_talk
{{ns:6}}, {{ns:Image}} Image, Image
{{ns:7}}, {{ns:Image_talk}} Image_talk, Image_talk
{{ns:8}}, {{ns:MediaWiki}} MediaWiki, MediaWiki
{{ns:9}}, {{ns:MediaWiki_talk}} MediaWiki_talk, MediaWiki_talk
{{ns:10}}, {{ns:Template}} Template, Template
{{ns:11}}, {{ns:Template_talk}} Template_talk, Template_talk
{{ns:12}}, {{ns:Help}} Help, Help
{{ns:13}}, {{ns:Help_talk}} Help_talk, Help_talk
{{ns:14}}, {{ns:Category}} Category, Category
{{ns:15}}, {{ns:Category_talk}} Category_talk, Category_talk
{{ns:100}}, {{ns:102}}, etc. Key_Term, ( customized namespaces )
{{ns:101}}, {{ns:103}}, etc. Key_Term_Talk,
{{SITENAME}} Nissan 350Z & 370Z Wiki
{{SERVER}} http://www.350z-tech.com
{{SERVERNAME}} www.350z-tech.com
{{localurl:fullpagename}} /zwiki/Fullpagename
{{localurl:a&b!}}
{{localurle:a&b!}}
/zwiki/A%26b%21
/zwiki/A%26b%21
{{localurl:page|query=x}} /w/index.php?title=Page&query=x
{{fullurl:fullpagename}} http://www.350z-tech.com/zwiki/Fullpagename
{{fullurl:a&b!|u=v}}
{{fullurle:a&b!|u=v}}
http://www.350z-tech.com/w/index.php?title=A%26b%21&u=v
http://www.350z-tech.com/w/index.php?title=A%26b%21&u=v

The pseudo-template localurl replaces spaces by underscores and special characters by escape codes, e.g. {{localurl:a !}} gives /zwiki/A_%21. Two purposes are:

  1. for a given page name, creating a link in external link style to a page in the same project or a project which uses the same string in the URL between the server name and the page name (on Wikimedia "/wiki/" and "w/index.php?title="),
  2. allow the same wikitext to be used in a project that uses a different string, if the target is in that other project or a project which uses the same string.

Note that localurl does not escape text in the query string after "|". This problem can be avoided by moving queries to the left hand side. In some cases, such as with Special:Contributions and Special:Recentchangeslinked the data can be placed after a "/", rather than as part of a query, Example:

http://meta.wikimedia.org/wiki/Special:Contributions?target=Jimbo_Wales&limit=10
as {{fullurl:m:Special:Contributions/Jimbo Wales|limit=10}} for
http://www.350z-tech.com/w/index.php?title=M:Special:Contributions/Jimbo_Wales&limit=10 but not
{{fullurl:m:Special:Contributions|target=Jimbo Wales&limit=10}} for
http://www.350z-tech.com/w/index.php?title=M:Special:Contributions&target=Jimbo Wales&limit=10.

Localurle and its counterpart fullurle perform additional character escaping on the resulting link, are intended for internal use only, and work in wikitext only for backwards-compatibility reasons. The unescaped versions should always be used in wikitext.

The {{fullurl}} pseudo-template introduced in recent versions of MediaWiki is a shorthand for {{SERVER}}{{localurl}}.

Varying with time

{{CURRENTYEAR}} 2009   {{CURRENTMONTH}} 01
{{CURRENTMONTHNAME}} January   {{CURRENTMONTHABBREV}} Jan
{{CURRENTMONTHNAMEGEN}} January   {{CURRENTWEEK}} 2
{{CURRENTDAY}} 8   {{CURRENTDAY2}} 08
{{CURRENTDAYNAME}} Thursday   {{CURRENTDOW}} 4
{{CURRENTTIME}} 15:44   {{NUMBEROFARTICLES}} 675
{{REVISIONID}} 15079   {{NUMBEROFFILES}} 6,355

NUMBEROFARTICLES: number of pages in the main namespace which contain a link and are not a redirect, i.e. number of articles, stubs containing a link, and disambiguation pages.

This depends on system variable $wgUseCommaCount If true, article count will only include those with commas (","). If false, will only count those with links ("[["). The default set in DefaultSettings.php is false, this can be changed in LocalSettings.php. See also Help:Article count.

Time variables which change more often than once a day are generally useful only as curiosities. Because of the way article HTML is cached, these variables may be wrong by up to 24 hours, and so are not a reliable way to tell the user the current time.

CURRENTWEEK ranges from 1 to 54 (unclear).
CURRENTMONTHNAMEGEN is the genitive grammatical form of the month name (used in Finnish).
CURRENTDAY2 adds a leading zero to days 1...9, this allows to construct the ISO date formats like 2009-01-08T15:44Z.

Includeonly subst magic

When a template containing {{<includeonly>subst:</includeonly>CURRENTTIME}} is substituted, the time of doing that is put in the wikitext, and similarly for other variables. Examples:

{{CURRENTTIME}}
15:44 - is a variable on pages including the template
{{subst:CURRENTTIME}}
21:25 - became a substituted constant in the template
{{<includeonly>subst:</includeonly>CURRENTTIME}}
15:44 - becomes a constant at the time of its inclusion

Depending on page

PlainEncoded
{{NAMESPACE}} Help{{NAMESPACEE}} Help
{{PAGENAME}} Variable{{PAGENAMEE}} Variable
{{FULLPAGENAME}} Help:Variable{{FULLPAGENAMEE}} Help:Variable
{{SUBPAGENAME}} Variable{{SUBPAGENAMEE}} Variable
{{TALKSPACE}} Help talk{{TALKSPACEE}} Help_talk
{{SUBJECTSPACE}} Help{{SUBJECTSPACEE}} Help

{{NAMESPACE}} and {{NAMESPACEE}} both return nothing (not even a space) in the article namespace.

PAGENAMEE displays the page title in the form that is used in URLs, i.e. with underscores for spaces, and escape codes for special characters, and is therefore used for constructing URLs. For example, on a page called "Grand café", PAGENAMEE would produce "Grand_caf%C3%A9". Do not use PAGENAMEE as the pagename in first part of the variable localurl, see above.

When used in a template, these eight variables refer to the page in which the template is included, not to the template page.

Depending on revision

{{REVISIONID}} gives 15079

REVISIONID displays a unique number identifying a version of a page in the set of all versions of all pages. In the URL the number can be referred to as "oldid=..", even when the version is still the current one. This can be useful on talk pages, and for citation in newspaper, scholar works, etc. When applying such a URL, at the top of the page the date and local time (if not logged in: UTC) are displayed, with a link to the previous version, and a link to the next version (unless at the time of loading the page there is no newer version: in that case the text "Newer revision" appears anyway, but it is not a link; if the version is the first, a link labeled "previous revision" appears anyway, but it leads to the same page)

The page history page and the Permalinks also use this variable. In a preview, the REVISIONID is not defined.

Examples of combinations

{{fullurl:{{FULLPAGENAME}}|action=edit}}
http://www.350z-tech.com/w/index.php?title=Help:Variable&action=edit
 
{{fullurl:Special:Whatlinkshere|target={{NAMESPACE}}:{{PAGENAME}}}}
http://www.350z-tech.com/w/index.php?title=Special:Whatlinkshere&target=Help:Variable
 
{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}}
http://www.350z-tech.com/w/index.php?title=Help:Variable&action=edit
 
{{fullurl:Special:Whatlinkshere|target={{NAMESPACE}}:{{PAGENAME}}}}
http://www.350z-tech.com/w/index.php?title=Special:Whatlinkshere&target=Help:Variable
 
[[{{NAMESPACE}}:{{PAGENAME}}_1]]
Help:Variable_1
 
{{fullurl:{{NAMESPACE}}:{{PAGENAME}}_1}}
http://www.350z-tech.com/zwiki/Help:Variable_1
 
{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|oldid={{REVISIONID}}}}
http://www.350z-tech.com/w/index.php?title=Help:Variable&oldid=15079
 

The old form {{SERVER}}{{localurl:page }} has the same effect as {{fullurl:page }} in recent (1.5+) versions of the software.

As a link the last example is not useful in the page itself, but it gives useful info about the original in a paper or HTML copy of the page, and provides a permalink to that in the HTML copy.

In a template, for a link to a page which depends on a template parameter, the external link style is used even for internal links, to avoid that the system links to the edit page even if the page exists. To construct the external link, variables can also be useful.

See also


Links to other help pages
 
Help contents - all help pages
Meta|Commons|Wikinews|Wikipedia|Wikiquote|Wikisource|Wiktionary
Versions of this help page (for other languages see below)
Meta|Commons|Wikinews|Wikipedia|Wikiquote|Wikisource|Wiktionary
Reading
Go|Search|Stop words|URL|Namespace|Page name|Section|Backlinks
Link|Piped link|Interwiki link|Redirect|Variable|Category|Special page
Logging in and preferences
Logging in|Preferences|User style
Tracking changes
Recent changes|Related changes|Watching pages|Page history|Diff
Edit summary|Minor edit|User contributions|Patrolled edit
Enhanced recent changes|Image page
Editing
Filling the page|Starting a new page|List|Table|Special characters
Template|Renaming (moving) a page|Editing shortcuts|Talk page|Testing
Advanced
Export|Import|Advanced templates|Array|Parameter default|Formula
EasyTimeline|Inputbox|Images and other uploaded files

[[ca:Ajuda:Variable |Template:Lang name - ca (ca)]] Deutsch (de) English (en) Français (fr) Esperanto (eo) Italiano (it) 日本語 (ja) 中文 (zh) +/-

This page was last modified 15:55, 20 April 2006.  This page has been accessed 292 times.  Disclaimers