Safer Nicotine Wiki:Namespace: Difference between revisions
→Talk namespaces: Add shortcut. |
Richardpruen (talk | contribs) m 1 revision imported |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{Short description|A prefix before an article's name}} | ||
{{dablink|"WP:NS" redirects here. You may be looking for [[Wikipedia:WikiProject Nova Scotia]].}} | |||
{{pp-semi-vandalism|small=yes}}{{pp-move-indef}} | {{pp-semi-vandalism|small=yes}}{{pp-move-indef}} | ||
{{Infopage|WP:NS|WP:NSPACE|style=margin:1.0em auto;}} | {{Infopage|WP:NS|WP:NSPACE|style=margin:1.0em auto;}} | ||
| Line 6: | Line 7: | ||
A Wikipedia '''namespace''' is a set of Wikipedia pages whose [[Help:page name|names]] begin with a particular reserved word recognized by the [[MediaWiki]] software (followed by a colon). For example, in the ''user namespace'' all titles begin with the prefix ''User:''. In the case of the article (or main) namespace, in which encyclopedia articles appear, the reserved word and colon are absent. (Note: main space articles can optionally include a colon at the beginning with no reserved word, so <code>[<nowiki/>[Article]]</code> and <code>[<nowiki/>[:Article]]</code> are equivalent. This is usually only necessary for the advanced technique of [[WP:Transclusion|transcluding]] a main space article into another page.) | A Wikipedia '''namespace''' is a set of Wikipedia pages whose [[Help:page name|names]] begin with a particular reserved word recognized by the [[MediaWiki]] software (followed by a colon). For example, in the ''user namespace'' all titles begin with the prefix ''User:''. In the case of the article (or main) namespace, in which encyclopedia articles appear, the reserved word and colon are absent. (Note: main space articles can optionally include a colon at the beginning with no reserved word, so <code>[<nowiki/>[Article]]</code> and <code>[<nowiki/>[:Article]]</code> are equivalent. This is usually only necessary for the advanced technique of [[WP:Transclusion|transcluding]] a main space article into another page.) | ||
Wikipedia has | Wikipedia has 30 current namespaces: 14 subject namespaces, 14 corresponding talk namespaces, and 2 virtual namespaces. These are all listed in the box to the right. While surfing Wikipedia, a list of namespaces is available in two clicks: do an empty search, then click ''Advanced'' under the search box. The list also makes itself available where needed in the dropdown menus of, for example, [[Special:Prefixindex]], [[Special:Allpages]], [[Special:Recentchanges]], and [[Special:Contributions]]. | ||
The aliases '''WP''' for '''Wikipedia''', and '''WT''' for '''Wikipedia talk''', work for page names in the search box, and making links as well as inclusions. See [[#Aliases|Aliases]] below for other aliases. (The pseudo-namespaces such as '''H''' for '''Help''', and '''CAT''' for '''Category''', are extremely limited. See ''[[#Pseudo-namespaces|Pseudo-namespaces]]'' below.) | The aliases '''WP''' for '''Wikipedia''', and '''WT''' for '''Wikipedia talk''', work for page names in the search box, and making links as well as inclusions. See [[#Aliases|Aliases]] below for other aliases. (The pseudo-namespaces such as '''H''' for '''Help''', and '''CAT''' for '''Category''', are extremely limited. See ''[[#Pseudo-namespaces|Pseudo-namespaces]]'' below.) | ||
| Line 38: | Line 39: | ||
* '''[[Wikipedia:Module namespace|Module namespace]]''' (prefix '''Module:'''): contains [[mw:Extension:Scribunto|Scribunto]] modules – Lua scripts implementing special-purpose [[mw:Manual:Parser functions|parser functions]] for use in templates, beyond the [[Help:Magic words#Parser functions|basic set]] included with MediaWiki and its [[mw:Extensions FAQ|extensions]]. | * '''[[Wikipedia:Module namespace|Module namespace]]''' (prefix '''Module:'''): contains [[mw:Extension:Scribunto|Scribunto]] modules – Lua scripts implementing special-purpose [[mw:Manual:Parser functions|parser functions]] for use in templates, beyond the [[Help:Magic words#Parser functions|basic set]] included with MediaWiki and its [[mw:Extensions FAQ|extensions]]. | ||
=== | ===Deprecated=== | ||
* '''Gadget namespace''' (prefix '''Gadget:'''): installed but not currently in use.<ref>[[Wikipedia:Village pump (technical)/Archive 139#New "Gadget:" and "Gadget definition:" namespaces?]]</ref> [[Wikipedia:Gadget|Gadgets]], which are small [[Snippet (programming)|snippets]] enabled in [[Special:Preferences#mw-prefsection-gadgets|user preferences]], currently use the [[Help:MediaWiki namespace| | * '''Gadget namespace''' (prefix '''Gadget:'''): installed but not currently in use.<ref>[[Wikipedia:Village pump (technical)/Archive 139#New "Gadget:" and "Gadget definition:" namespaces?]]</ref> [[Wikipedia:Gadget|Gadgets]], which are small [[Snippet (programming)|snippets]] enabled in [[Special:Preferences#mw-prefsection-gadgets|user preferences]], currently use the [[Help:MediaWiki namespace|MediaWiki namespace]] with the ''MediaWiki:Gadget-'' page name prefix. It is a [[mw:Manual:Using custom namespaces|custom namespace]] installed by the [[mw:Extension:Gadgets|Gadget extension]]. | ||
* '''Gadget definition namespace''' (prefix '''Gadget definition:'''): installed but not currently in use; see above for more information. Gadget definitions currently use the [[MediaWiki:Gadgets-definition]] page. | * '''Gadget definition namespace''' (prefix '''Gadget definition:'''): installed but not currently in use; see above for more information. Gadget definitions currently use the [[MediaWiki:Gadgets-definition]] page. | ||
===Not installed=== | ===Not installed=== | ||
On [[MediaWiki]] installations other than the English Wikipedia, additional namespaces may be installed by [[mw:Manual:Extensions|MediaWiki extension]]s; the list of default IDs for these namespaces is at [[mw:Extension default namespaces|Extension default namespaces]]. | On [[MediaWiki]] installations other than the English Wikipedia, additional namespaces may be installed by [[mw:Manual:Extensions|MediaWiki extension]]s; the list of default IDs for these namespaces is at [[mw:Extension default namespaces|Extension default namespaces]]. | ||
*'''[[Wikipedia:Flow|Flow namespace]]''' (prefix '''Topic:''') was a proposed talk page replacement, formerly installed on English Wikipedia by [[mw:Extension:StructuredDiscussions|Extension:StructuredDiscussions]]. It is no longer installed after being rejected by the community. | |||
* '''[[Wikipedia:Course pages|Education Program namespace]]''' (prefix '''Education Program:'''): uninstalled in 2018, and replaced with the [[wmfdashboard:|Programs & Events Dashboard]].<ref>[https://outreach.m.wikimedia.org/wiki/Education/News/January_2018/Education_Extension_scheduled_shutdown Education_Extension_scheduled_shutdown, Wikimedia outreach]</ref><ref>[[Wikipedia:Education noticeboard/Archive 18#NOTICE:_EducationProgram extension is being deprecated]]</ref> However, the namespace was re-added later that year to allow access to old talk pages in the Education program talk: namespace. The namespace was then uninstalled again in 2021 after the remaining talk pages were moved to subpages of [[Wikipedia talk:Education program archive]]. | |||
* '''[[Wikipedia:Books|Book namespace]]''' (prefix '''Book:'''): contained entries for Wikipedia books, collections of articles about one theme, which were used to generate downloadable files or printable documents or order books from PediaPress. In 2017, the online book rendering service was withdrawn, leading to the removal of most links leading to the namespace in 2019. The namespace and its transclusions were still retained in the hope that the WMF would come up with a solution,<ref>{{Section link|Wikipedia:Village pump (technical)/Archive 176|Suppress rendering of Template:Wikipedia books}}</ref> but in 2021 the namespace was uninstalled after all remaining books were moved to subpages of [[Wikipedia:Books/archive]]. | |||
===Aliases and pseudo-namespaces=== | ===Aliases and pseudo-namespaces=== | ||
| Line 72: | Line 73: | ||
=== Special === | === Special === | ||
{{main|Help:Special page}} | {{main|Help:Special page}} | ||
The ''Special:'' namespace consists of pages (called ''special pages'') that are created by the software on demand, such as [[Special:RecentChanges]]. These pages can be linked as usual, as with <nowiki>[[Special:RecentChanges]]</nowiki>, except when they have parameters. To use parameters, the full URL must be given as an external link. For example, {{SERVER}}{{SCRIPTPATH}}/index.php?title=Special:Recentchanges&days=3&limit=10, which returns the last ten changes in the last three days. | The ''Special:'' namespace consists of pages (called ''special pages'') that are created by the software on demand, such as [[Special:RecentChanges]]. These pages can be linked as usual, as with <nowiki>[[Special:RecentChanges]]</nowiki>, except when they have parameters. To use parameters, the full URL must be given as an external link. For example, https:{{SERVER}}{{SCRIPTPATH}}/index.php?title=Special:Recentchanges&days=3&limit=10, which returns the last ten changes in the last three days. | ||
You can create a [[Wikipedia:redirect|redirect]] to a Special page, but the redirect will not be followed automatically. | You can create a [[Wikipedia:redirect|redirect]] to a Special page, but the redirect will not be followed automatically. | ||
| Line 117: | Line 118: | ||
An alias cannot be used as the actual namespace in a page title. For example, you cannot create page ''WP:123''; if tried, the page name is instantly converted to ''Wikipedia:123''. It ''is'', however, possible to [[Wikipedia:Page name#Changing the displayed title|change the ''displayed'' title]] on page ''Wikipedia:123'' to make it ''WP:123'' or ''Project:123''. | An alias cannot be used as the actual namespace in a page title. For example, you cannot create page ''WP:123''; if tried, the page name is instantly converted to ''Wikipedia:123''. It ''is'', however, possible to [[Wikipedia:Page name#Changing the displayed title|change the ''displayed'' title]] on page ''Wikipedia:123'' to make it ''WP:123'' or ''Project:123''. | ||
<span class="plainlinks">This is very handy for the creation of [[Wikipedia:Shortcut|shortcuts]]. For example, the shortcut for this section is [[WP:ALIAS]], as shown in the right-side box. When the link is clicked, it automatically translated to [https://en.wikipedia.org/w/index.php?title=Wikipedia:ALIAS&redirect=no Wikipedia:ALIAS]. At this page is a [[Help:Redirect|redirect]] to [[Wikipedia:Namespace#Aliases]]. This means that the shortcut goes directly to this section from anywhere | <span class="plainlinks">This is very handy for the creation of [[Wikipedia:Shortcut|shortcuts]]. For example, the shortcut for this section is [[WP:ALIAS]], as shown in the right-side box. When the link is clicked, it automatically translated to [https://en.wikipedia.org/w/index.php?title=Wikipedia:ALIAS&redirect=no Wikipedia:ALIAS]. At this page is a [[Help:Redirect|redirect]] to [[Wikipedia:Namespace#Aliases]]. This means that the shortcut goes directly to this section from anywhere on Wikipedia. It can also be entered as a [[URL]] in the browser address bar as https://en.wikipedia.org/wiki/WP:ALIAS .</span> | ||
=== Pseudo-namespaces === | === Pseudo-namespaces === | ||
<!-- This section is linked from [[Wikipedia:Glossary]] --> | <!-- This section is linked from [[Wikipedia:Glossary]] --> | ||
{{Shortcut|WP:PNS}} | {{Shortcut|WP:PNS}} | ||
Apart from Wikipedia's 32 regular namespaces and their aliases, and 2 virtual ones, there are several title prefixes appearing in [[Help:Shortcut|shortcut redirects]] pointing to frequently-referred-to Wikipedia pages. These prefixes are referred to as '''pseudo-namespaces''' and include the following: | |||
* '''[[Special:Prefixindex/CAT:|CAT:]]''' for shortcuts to the [[Wikipedia:Category namespace|Category namespace]]. See also [[:Category:Redirects to category space]] | * '''[[Special:Prefixindex/CAT:|CAT:]]''' for shortcuts to the [[Wikipedia:Category namespace|Category namespace]]. See also [[:Category:Redirects to category space]] | ||
| Line 134: | Line 135: | ||
Pseudo-namespaces are not in any way recognised by the wiki software; they are purely a community custom. Titles in pseudo-namespaces actually belong technically in the main (article) namespace and are treated as such by the software: they are case-sensitive and appear in [[Help:Search#Syntax|search results]] restricted to the main namespace. An alias is treated like a real namespace, resulting in a search for the [[WP:page name|pagename]] in its namespace, but the "pseudo-namespace:pagename" search is in mainspace, not its pseudo-namespace. For example, searching for "H:S" will not search '''Help'''. | Pseudo-namespaces are not in any way recognised by the wiki software; they are purely a community custom. Titles in pseudo-namespaces actually belong technically in the main (article) namespace and are treated as such by the software: they are case-sensitive and appear in [[Help:Search#Syntax|search results]] restricted to the main namespace. An alias is treated like a real namespace, resulting in a search for the [[WP:page name|pagename]] in its namespace, but the "pseudo-namespace:pagename" search is in mainspace, not its pseudo-namespace. For example, searching for "H:S" will not search '''Help'''. | ||
To learn some of these shortcuts, first follow the pseudo-namespace link above, then follow one of the redirects listed on that page. It will take you to the target, where you then notice any {{tl|shortcut}} boxes to the right of the page, which may also list some additional shortcuts to that same area. By observing these steps repeatedly, you can discover ways to shorten your typing. You will use pseudo-namespace names more often if you are an advanced editor, highly active in many namespaces, or constantly linking to pages that have a pseudo-namespace | To learn some of these shortcuts, first follow the pseudo-namespace link above, then follow one of the redirects listed on that page. It will take you to the target, where you then notice any {{tl|shortcut}} boxes to the right of the page, which may also list some additional shortcuts to that same area. By observing these steps repeatedly, you can discover ways to shorten your typing. You will use pseudo-namespace names more often if you are an advanced editor, highly active in many namespaces, or constantly linking to pages that have a pseudo-namespace shortcut. | ||
To understand the appropriateness of redirects of this type, see [[Wikipedia:Cross-namespace redirects]]. All shortcuts are discoverable by | To understand the appropriateness of redirects of this type, see [[Wikipedia:Cross-namespace redirects]]. All shortcuts are discoverable by [[Help:Searching|searching]] for redirects. There is also the category [[:Category:Wikipedia redirects|Wikipedia redirects]]. | ||
As a final example, every [[Wikimedia Foundation]] project has a "[[m:Help:Transwiki|Transwiki:]]" pseudo-namespace (sometimes a real namespace) for importing articles manually. A wiki project that would manually move many pages between [[wp:sister|sister projects]] uses this tag. Redirects/shortcuts are not directly involved here, as described above. Instead the page title is [[WP:move|move]]d to "Transwiki:''namespace:pagename''", and that content is then copied and pasted into a new page name of that temporary title on the target wiki. When it is accepted the title is then moved out of the '''Transwiki''' pseudo-namespace there and becomes a real page name in its respective namespace. | As a final example, every [[Wikimedia Foundation]] project has a "[[m:Help:Transwiki|Transwiki:]]" pseudo-namespace (sometimes a real namespace) for importing articles manually. A wiki project that would manually move many pages between [[wp:sister|sister projects]] uses this tag. Redirects/shortcuts are not directly involved here, as described above. Instead, the page title is [[WP:move|move]]d to "Transwiki:''namespace:pagename''", and that content is then copied and pasted into a new page name of that temporary title on the target wiki. When it is accepted, the title is then moved out of the '''Transwiki''' pseudo-namespace there and becomes a real page name in its respective namespace. | ||
==<span id="Interwiki links"></span>Interwiki and interlanguage links == | ==<span id="Interwiki links"></span>Interwiki and interlanguage links == | ||
| Line 147: | Line 148: | ||
Important points to note: | Important points to note: | ||
* In the presence of an interwiki prefix and the absence of an interlanguage prefix, the link will | * In the presence of an interwiki prefix and the absence of an interlanguage prefix, the link will be to a specified project in the current language. So <code><nowiki>[[w:Internet]]</nowiki></code> links to "[[w:Internet|Internet]]" on the English Wikipedia, if the link is on any English-language Wikimedia project. | ||
* In the presence of a interlanguage prefix and the absence of an interwiki prefix, the link will | * In the presence of a interlanguage prefix and the absence of an interwiki prefix, the link will be to a specified language in the current project. So <code><nowiki>[[:en:Internet]]</nowiki></code> will link to "[[:en:Internet|Internet]]" on the English Wikipedia, if the link is on a Wikipedia project in any language. | ||
When making links to other language Wikipedias, add an initial colon if you want the link to appear inline rather than in the skin's sidebar under "Languages"; see [[Help:Colon trick]] for an explanation. So <code><nowiki>[[:de:Internet]]</nowiki></code> is an inline link to "[[:de:Internet|Internet]]" in the German Wikipedia; but if using an interwiki prefix this is unnecessary, for example <code><nowiki>[[w:de:Internet]]</nowiki></code> is the same inline link. | When making links to other language Wikipedias, add an initial colon if you want the link to appear inline rather than in the skin's sidebar under "Languages"; see [[Help:Colon trick]] for an explanation. So <code><nowiki>[[:de:Internet]]</nowiki></code> is an inline link to "[[:de:Internet|Internet]]" in the German Wikipedia; but if using an interwiki prefix this is unnecessary, for example <code><nowiki>[[w:de:Internet]]</nowiki></code> is the same inline link. | ||
| Line 176: | Line 177: | ||
* Change the functionality of <kbd><nowiki>{{</nowiki>[[WP:Transclusion|pagename]]<nowiki>}}</nowiki></kbd> so that it defaults to the set of pagenames in '''Template'''. | * Change the functionality of <kbd><nowiki>{{</nowiki>[[WP:Transclusion|pagename]]<nowiki>}}</nowiki></kbd> so that it defaults to the set of pagenames in '''Template'''. | ||
* Tailor ''[[Wikipedia:Edit notices|edit notices]]'' to a particular namespace's edit page, informing an editor of certain aspects about the content of that namespace. | * Tailor ''[[Wikipedia:Edit notices|edit notices]]'' to a particular namespace's edit page, informing an editor of certain aspects about the content of that namespace. | ||
* Allow ''[[Wikipedia:Templates|templates]]'' behave differently on pages of different namespaces. | * Allow ''[[Wikipedia:Templates|templates]]'' to behave differently on pages of different namespaces. | ||
The namespace functionality is often visible in the URL, where you will see a namespace number. These are given in the table below. | The namespace functionality is often visible in the URL, where you will see a namespace number. These are given in the table below. | ||
| Line 188: | Line 189: | ||
== Programming == | == Programming == | ||
{{anchor|Enumeration}} | {{anchor|Enumeration}} | ||
The | The 32 namespaces in the English Wikipedia are numbered for programming purposes. The prefix for each namespace is generated by a [[m:Help:Variable|variable]], using the [[Help:Magic words#Paths|magic word]] <nowiki>{{ns}}</nowiki>, in the form <nowiki>{{ns:</nowiki>''xx''}}, as shown in the table below. | ||
{| border="0" cellpadding="4" cellspacing="0" class="wikitable" | {| border="0" cellpadding="4" cellspacing="0" class="wikitable" | ||
| Line 251: | Line 252: | ||
|<nowiki>{{ns:101}}</nowiki> | |<nowiki>{{ns:101}}</nowiki> | ||
|{{ns:101}} | |{{ns:101}} | ||
|- | |- | ||
|<nowiki>{{ns:118}}</nowiki> | |<nowiki>{{ns:118}}</nowiki> | ||
| Line 261: | Line 257: | ||
|<nowiki>{{ns:119}}</nowiki> | |<nowiki>{{ns:119}}</nowiki> | ||
|{{ns:119}} | |{{ns:119}} | ||
|- | |- | ||
|<nowiki>{{ns:710}}</nowiki> | |<nowiki>{{ns:710}}</nowiki> | ||
| Line 288: | Line 279: | ||
|} | |} | ||
Alternative variables are available for most namespaces, for example <nowiki>{{ns:talk}}</nowiki>, <nowiki>{{ns:user}}</nowiki>, and <nowiki>{{ns:user_talk}}</nowiki> for <nowiki>{{ns:1}}</nowiki>, <nowiki>{{ns:2}}</nowiki> and <nowiki>{{ns:3}}</nowiki>. The portal | Alternative variables are available for most namespaces, for example <nowiki>{{ns:talk}}</nowiki>, <nowiki>{{ns:user}}</nowiki>, and <nowiki>{{ns:user_talk}}</nowiki> for <nowiki>{{ns:1}}</nowiki>, <nowiki>{{ns:2}}</nowiki> and <nowiki>{{ns:3}}</nowiki>. The portal namespace is numbered in the 100-plus range, as are all MediaWiki nonstandard namespaces. | ||
All namespaces with a positive number or zero in this list are searchable. Specifically, the {{ns:-2}} and {{ns:-1}} namespaces are not searchable. | All namespaces with a positive number or zero in this list are searchable. Specifically, the {{ns:-2}} and {{ns:-1}} namespaces are not searchable. | ||