Jump to content

Wikipedia:Page name

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 85.233.234.254 (talk) at 04:37, 10 May 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Name of a Wikipedia article. The wikilink for that article is THE NIRVANA PR, and the URL is http://en.wikipedia.org/wiki/THE NIRVANA PR.

In the MediaWiki software a page's name has aspects of itself stored in three variables that derive from the "magic words" , P, and FULLPAGENAME. Although the variables only refer to the page they are on, the lower-case terms refer to any page name, which makes them valuable in template documentation and on talk pages. In this regard, perhaps the value of the term namespace is more widely recognized, than pagename and fullpagename. Pagename, fullpagename, and namespace are all valuable terms because they are a convenient way for advancing editors to read about what they will be writing into a template.

Now "fullpagename" can display any title, create any link, render any transclusion, and successfully render a search for (or navigate to) any page. Namespace can mean the namespace of any page, but "pagename" will display, link, and transclude pages in the article namespace. So page name is equivalent to pagename only when the context is content, but when the context could be any page in the database, page name is equivalent to fullpagename for the entirety of the Wikipedia database space, except for the historical revisions database, where fullpagename becomes equivalent to a permanent and unique oldid.

Although the main page of Wikipedia has no title, the link for any page can always be made from that part of the page that is the string of characters in the URL after the last "/" character; the link for http://en.wikipedia.org/wiki/Main_page can be [[Main_page]]. The MediaWiki software will interpret all the possible URL characters correctly, such as translating the underscore to the space. (See Spaces, underscores, and character encoding below.) A title can be changed while everything else works as before, or a title can be moved and the page name will also move. (See Changing the displayed title below.)


Namespace, pagename, and fullpagename

The page name is Help:Categories. The pagename is Categories.
Namespaces
Subject namespaces Talk namespaces
0 (Main/Article) Talk 1
2 User User talk 3
4 Wikipedia Wikipedia talk 5
6 File File talk 7
8 MediaWiki MediaWiki talk 9
10 Template Template talk 11
12 Help Help talk 13
14 Category Category talk 15
100 Portal Portal talk 101
118 Draft Draft talk 119
710 TimedText TimedText talk 711
828 Module Module talk 829
Former namespaces
108 Book Book talk 109
442 Course Course talk 443
444 Institution Institution talk 445
446 Education Program Education Program talk 447
2300 Gadget Gadget talk 2301
2302 Gadget definition Gadget definition talk 2303
2600 Topic 2601
Virtual namespaces
-1 Special
-2 Media
Current list (API call)

The variables pagename corresponds to the concept of a basename in Unix, and serves the need for wikitext to render its own, base, page name. A "full page name" is as meaningless a term as "a page that is more fully a page", because it is the need for a namespace (in computer science) that creates the concept of a fullpagename.

On Wikipedia the namespace is heavily used because it enables two different pages with the same page name, (in different collections), to have the same subject yet serve a variable purpose. For example, this page, as it is displayed, will show that it is in the Wikipedia namespace: note the title or the URL. For example the page name Help:Categories (for the common editor), and the page name Wikipedia:Categories (for administrators) have the same pagename, Categories. So the pagename Categories is one, basic, base name, used in two namespaces.

Pagename is used where the mention of the namespace is avoidable because it is obvious. For content, the obvious namespace is "Main", so linking and searching is done with a pagename. And on article talk pages, where a reference to Help, Wikipedia, and Template namespaces often occurs, that link will be with a fullpagename, formulated [[namespace:pagename]], which is a namespace name followed by a ":" character followed by a base name.

Technically, the term pagename is valid only in reference to content, whereas typing out the two words "page name" is always valid.
A page name therefore is

  • the pagename if it is in the Main namespace.
  • the fullpagename if it is in any namespace. Fullpagename is denoted "namespace:pagename".

Note the important difference between "page name" and "pagename".

Placing the magic word {{FULLPAGENAME}} (all caps) in the wikitext will automatically render the page name of any page. In the Main namespace this will be the same as {{PAGENAME}}. In the Main namespace {{NAMESPACE}} doesn't render anything.

Problematic names

It may be desired to create an encyclopedia article whose title happens to begin with one of the standard namespace prefixes, followed by a colon, such as Wikipedia: The Big Adventure or Talk: Secrets are Bad. (The ":" character is not part of a namespace name.) This is technically possible, however the article would be in the wrong namespace, which would interfere with Search and other functionality, and that space after the colon would have to be added with DISPLAYTITLE as described below. In such situations the naming guideline recommends redirecting to an alternative title within mainspace.

A forward slash ( / ) in the pagename provides special functionality in a namespace where the subpage feature has been enabled. This feature is not active in Wikipedia's main namespace, so a forward slash in an article name has no particular effect (although it may affect the behaviour of the corresponding talk page, as subpages are enabled in talk space).

Invalid page names

For information on how to treat pages whose titles are affected by these limitations, see Wikipedia:Naming conventions (technical restrictions).

In general, a page name is any string of one or more Unicode characters. However, this is subject to certain restrictions. The following are not valid as page titles:

  • Base names beginning with a lowercase letter (in any alphabet).[1]
  • Titles containing any of the following characters: # < > [ ] | { } _ (which have special meanings in Wiki syntax), the non-printable ASCII characters 0–31 (dec), the delete character 127, or HTML character codes such as &amp;.[2]
  • Base names beginning with a colon (:).
  • Base names equal to "." or "..", or beginning "./" or "../", or containing "/./" or "/../", or ending "/." or "/..".
  • Base names that exceed 255 bytes in length. Be aware that non-ASCII characters may take up to four bytes in UTF-8 encoding, so the total number of characters that can fit into a title may be less than 255.
  • Titles beginning with a namespace alias (WP:, WT:, Project:, Image:). For example, the name Project:A-Kon is not possible.
  • Titles beginning with the virtual namespace prefixes Media: and Special:.
  • Titles beginning with a prefix that refers to another project, including other language Wikipedias, e.g. "fr:" (see Interwiki linking and Interlanguage links). For example, an article about the album "Q: Are We Not Men? A: We Are Devo!" cannot have that exact name, as the "q:" prefix leads to Wikiquote. Instead, the article is entitled "Are We Not Men? We Are Devo!". (The restriction includes the prefixes "w:" and "en:" that refer to English Wikipedia itself.[3])
  • Titles beginning with any non-standard capitalization of a namespace prefix, alias or interwiki/interlanguage prefix, or any of these with a space (underscore) before or after the colon. For example, it is not possible for a title to begin "HELP:", "HeLp:", "Help :" or "Help:_".
  • Titles consisting of only a namespace prefix, with nothing after the colon.
  • Titles beginning or ending with a space (underscore), or containing two or more consecutive spaces (underscores).
  • A title cannot contain 3 or more continuous tildes. (~~~)
  • A title can normally contain the character %. However it cannot contain % followed by two hexadecimal digits (which would cause it to be converted to a single character, by percent-encoding).

Changing the displayed title

It is possible to change the way a page title is displayed at the top of its page. This should only be done if the article meets the criteria for a non-standard title format, as detailed in the Article titles policy. The displayed title format is changed using the magic word DISPLAYTITLE. Under the present software configuration, only limited modifications can be made: the displayed title must still resolve to the true name of the page (i.e. if the displayed title is copied and pasted into a wikilink, the link should point to the original page). This means that DISPLAYTITLE can be used only for such modifications as changing an initial letter to lower case, adding initial colons, changing spaces to underscores, adding a space after a namespace prefix, and adding formatting (italics and bolding). The forbidden characters are not supported by DISPLAYTITLE.

The syntax for DISPLAYTITLE is {{DISPLAYTITLE:Desired Title}}. However it is often applied through a template. Currently available templates are {{lowercase title}}, used on such articles as eBay and iPod, and {{italic title}}. Both of these templates will work irrespective of where they are placed in the wikitext, but it is normal to place them at the beginning. There are also some infoboxes (such as {{Infobox film}}) which include a built-in DISPLAYTITLE to italicize the page title.

If there is more than one instance of DISPLAYTITLE, then the last overrides the previous ones. This means that if the DISPLAYTITLE automatically generated by an infobox template needs to be overridden, then an explicit DISPLAYTITLE must be placed after the infobox to make it work.

Alphabetical order

Where page titles are placed in alphabetical order by the system (as at Special:AllPages), ASCII-based ordering is used rather than the truly alphabetical ordering that would be expected. For details, see Help:Alphabetical order.

Spaces, underscores and character coding

In page names, a blank space is equivalent to an underscore. A blank space is displayed in the large font title at the top of the page, while the URLs show an underscore. Wikilinks can use either spaces or underscores (spaces are preferred in article space).

Character codes, such as %41 (which codes "A") and %C3%80 (which codes "À"), are treated in pagenames as equivalent to their corresponding characters. The codes are generally used for most non-alphanumeric and non-ASCII characters in URLs (although the characters themselves may sometimes work as well, depending on browser).

Codes are converted into corresponding characters in link labels: [[%41]] and %C3%80 are rendered as A and À. The URL of the latter page is http://en.wikipedia.org/wiki/%C3%80. It can be disputed whether the "real" name of the page is %C3%80 or À, but in any case there cannot be distinct pages with these names.

In some cases (such as in templates), it is necessary to convert a page name represented by a variable into a form suitable for use in URLs: with underscores for spaces and with % codes for special characters. This can be done using the magic words described below (for full details, see mw:Help:Magic words).

  • Certain variables ending with an extra "E" (PAGENAMEE, NAMESPACEE, etc.) return URL-encoded forms. For example, for this page, {{FULLPAGENAMEE}} gives Wikipedia:Page_name.
  • The localurl and fullurl functions can be used to generate relative and full URLs to a particular page. Fullurl can also be used for interwiki references (but may not work for links to pages on a project with a different $wgScript).

If pagename variables are used within the localurl/fullurl functions, then use standard variables ({{PAGENAME}} etc.) in the first parameter (where they will be encoded anyway), but the "EE" variables ({{PAGENAMEE}} etc.) in the second parameter (the query string), if present. For example:

  • {{fullurl:Special:Allpages|namespace=12&from={{PAGENAMEE}}}} gives here:

//en.wikipedia.org/w/index.php?title=Special:Allpages&namespace=12&from=Page_name

  • {{fullurl:Special:Allpages/{{PAGENAME}}|namespace=12}} gives here:

//en.wikipedia.org/w/index.php?title=Special:Allpages/Page_name&namespace=12

Wrong:

  • {{fullurl:Special:Allpages|namespace=12&from={{PAGENAME}}}} gives here:

//en.wikipedia.org/w/index.php?title=Special:Allpages&namespace=12&from=Page name (wrong link)

  • {{fullurl:Special:Allpages/{{PAGENAMEE}}|namespace=12}} gives here:

//en.wikipedia.org/w/index.php?title=Special:Allpages/Page_name&namespace=12 (works here, the underscore, converted from a space, is not affected by the second conversion, but it does not work with special characters).

See also

Notes

  1. ^ This is not true in all projects; for example, Wiktionary allows initial lower-case letters. This setting is configured using $wgCapitalLinks. Note that a title can be displayed with an initial lower-case letter, using DISPLAYTITLE or the {{lowercase title}} template.
  2. ^ Note that the plus sign + is allowed in page titles, although in the default setup for MediaWiki it is not. This is configured by setting the value of $wgLegalTitleChars in LocalSettings.php.
  3. ^ This self-reference restriction does not apply on all projects; for example, Wikiquote supports titles beginning "Q:".