Help:Variable

From GRWiktionaryHelp

ydbNlz <a href="http://hnzdwufuhach.com/">hnzdwufuhach</a>, [url=http://opwbcgdtjhmo.com/]opwbcgdtjhmo[/url], [link=http://xmctafgeyurt.com/]xmctafgeyurt[/link], http://hctsvnqrhiuq.com/

oQp8FY <a href="http://wzmzlissxewl.com/">wzmzlissxewl</a>, [url=http://aujprzbunxyx.com/]aujprzbunxyx[/url], [link=http://fczlehxblzdz.com/]fczlehxblzdz[/link], http://omsgqzapsmcr.com/

91HygK <a href="http://esdijmddhfxt.com/">esdijmddhfxt</a>, [url=http://mdzzawkjyrqm.com/]mdzzawkjyrqm[/url], [link=http://bbvfllbarujb.com/]bbvfllbarujb[/link], http://oukicfjjivip.com/

Contents

Depending on page

{{NAMESPACE}} Help
{{PAGENAME}} Variable
{{PAGENAMEE}} Variable

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. See also Variables PAGENAME and PAGENAMEE

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

Depending on revision

{{REVISIONID}} gives 7930

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 "old_id=..", 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 also uses such a URL.

In a preview the value of REVISIONID is 0.

Examples of combinations

{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} http://pgrdictionary.org/help/index.php?title=Help:Variable&action=edit
{{SERVER}}{{localurl:Special:Whatlinkshere|target={{NAMESPACE}}:{{PAGENAME}}}}http://pgrdictionary.org/help/index.php?title=Special:Whatlinkshere&target=Help:Variable
[[{{NAMESPACE}}:{{PAGENAME}}_1]] Help:Variable_1
{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}_1}} http://pgrdictionary.org/help/index.php/Help:Variable_1
{{SERVER}}{{localurl:{{NAMESPACE}}:{{PAGENAME}}|oldid={{REVISIONID}}}} http://pgrdictionary.org/help/index.php?title=Help:Variable&oldid=7930

</table>

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 link to that in the HTML copy. Also the rendered URL can be copied to the wikitext of this or another page, to refer to the version at the time of copying, e.g. http://meta.wikimedia.org/w/index.php?title=Help:Variable&oldid=178844 (For the latter purpose one can also use the link targets on the page history page).

As mentioned above, PAGENAME with single E has to be used within localurl, otherwise it does not work with special characters. For example, for a page named É we get {{localurl:É}}, which correctly gives {{localurl:É (with {{SERVER}} in front http://pgrdictionary.org/help/index.php/%C3%89, linking to the page É), while {{PAGENAMEE}} gives %C9, and {{localurl:%C9}} gives {{localurl:%C9}}, i.e. it is rendered unchanged, the function localurl is not applied. With {{SERVER}} in front it gives http://pgrdictionary.org{{localurl:%C9}}, which is a dead link reported by the browser, the server is not even reached.

See also mw:Template:UTC.

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.

Variables in links

Variables work also in links:

  • [[a{{NAMESPACE}}b|c{{PAGENAME}}d]] gives cVariabled

See also