|
Page titles in MediaWiki are composed of two parts: an optional namespace name, and the remainder of the title. For example, this page has the title By default, a wiki using the MediaWiki software has 18 namespaces, including:
In addition to these 18 namespaces, the Wikipedia specially adds to these the Portal: and Portal talk: namespaces. Other wiki projects may have their own additional custom namespaces. But take note:
Namespace usesNamespaces allow, among other things, a separation of content from policy and discussion. They encourage separation of the pages of a wiki into a core set intended for public viewing, and private information intended for the editing community. The core set is the main namespace. Other namespaces that are also useful to viewers are:
By default, searches and the random page feature are restricted to the main namespace, thus the user interface is directed towards readers who are not part of the community. Note that this separation of community and readership is not a feature of many wiki engines. It may not be required for your editing community. You are always free to put discussion and policy in the main namespace, if you desire. On most Wikimedia wikis, pages in the main namespace and a few other ones are actively policed by the community, with inappropriate content being quickly removed. The rules for the other namespaces are generally more relaxed.
From MediaWiki 1.5 Recent changes ditto.
User contributions can show all or be restricted to a namespace of choice. The subpage feature can be enabled for selected namespaces. It is possible to customize the visual appearance of pages and the appearance and function of templates based on namespace. See sections Template programming and CSS based namespace detection below. List of namespacesThe two pseudo-namespaces, main namespace and 15 auxiliary namespaces in this project (Meta) are as follows (the variables for them are also shown). Note that the number of pages in each namespace may not be displayed on all MediaWiki projects, because this counting feature may be disabled): on this Wiki, per-namespace page counting is currently disabled.
Note that all characters of namespace prefixes are case-insensitive, so one can write, for example, "mediawiki". Also, underscores in namespace prefixes are equivalent to any non-zero number of spaces (leading or trailing spaces or underscores are ignored) : underscores are used only when encoding URLs but treated otherwise like spaces. These names are set in the MessagesXX.php language files. The English defaults are below:
/* private */ $namespaceNames = array(
NS_MEDIA => 'Media',
NS_SPECIAL => 'Special',
NS_MAIN => '',
NS_TALK => 'Talk',
NS_USER => 'User',
NS_USER_TALK => 'User_talk',
NS_WIKIPEDIA => $wgMetaNamespace,
NS_WIKIPEDIA_TALK => $wgMetaNamespace . '_talk',
NS_IMAGE => 'Image',
NS_IMAGE_TALK => 'Image_talk',
NS_MEDIAWIKI => 'MediaWiki',
NS_MEDIAWIKI_TALK => 'MediaWiki_talk',
NS_TEMPLATE => 'Template',
NS_TEMPLATE_TALK => 'Template_talk',
NS_HELP => 'Help',
NS_HELP_TALK => 'Help_talk',
NS_CATEGORY => 'Category',
NS_CATEGORY_TALK => 'Category_talk'
);
Generic namespace namesOn the column "Alternate syntax" in the table at the beginning of the previous section, a list of project-independent namespace names (also called generic namespace names) is shown in the form of {{ns:namespace name}}, the same as those on Meta and the English Wikipedia, except that "Meta" and "Wikipedia" are replaced by "Project". The prefixes are the terms listed, followed by a colon. The prefix "Project:" is for every project automatically converted to the project namespace, e.g. try the link Project:xyz. It is like a piped link. Therefore a page name starting with "Project:" is not possible (unless, of course, that is the name of the project). Similarly the other project-independent namespace prefixes are also automatically converted to the project-specific ones. An exception to the rule that the link label is the name used in the wikitext and not the converted name, applies if the target of a redirect is expressed using a project-independent namespace name: in that case the converted name is shown on the redirect page, compare [1] with the preview of [2]. Prefixes in various languagesFor Wikimedia projects this project prefix is "Wikipedia:", "Wiktionary:", "Wikibooks:", "Wikisource:", "Wikiquote:", "Meta:", and in the case of In Memoriam also "Wikipedia:". In languages other than English, the Wikipedia project has its own prefixes: in French "Wikipédia:", in Czech "Wikipedie:", in Russian "Википедия:", in Korean "위키백과:", in Hindi "विकिपीडिया:", in Hebrew ":ויקיפדיה" and in Arabic ":ويكيبيديا". The last two are RTL languages which put the prefixes on the right. In URLs the prefixes are always on the left. To check which prefix is used in a project, you may edit and preview a page in the project to render the variable {{ns:Project}} (and cancel the edit after the check), though what you will see is deprived of a colon. Another way: visiting any project page there, you will find it at the left (in LTR languages) or the right (in RTL languages) of the page title. This applies even for non-existing pages, so, in view of the conversion explained in the previous section, you can use a URL like http://ar.wikipedia.org/description/Project:A. Also you may go to a project page of a target language from a project page of a language familiar to you (e.g. en:Wikipedia:Contact us) by clicking an interlanguage link, if applicable. "Talk", "User", "Image" and combinations can also be translated in the case of non-English wikis. see m:Locales for the Wikipedia Software. Colon in page nameAdding a colon to a page name does not automatically create a new namespace. To see the namespace of a page, use {{NAMESPACE}} which returns the namespace. For this page it returns "Help". The same code would return an empty string for a page in the main namespace. Similarly, {{PAGENAME}} returns the page name without prefix. For this page it returns "Namespace". {{FULLPAGENAME}} returns both namespace and pagename; for this page, that is "Help:Namespace". To take some examples from Wiktionary: Wiktionary:FAQ has Talk page Wiktionary talk:FAQ, but Wiktionary Appendix:Colours has Talk page Talk:Wiktionary Appendix:Colours, because the first is in the project preface namespace and the second is not. In Special:Allpages, accordingly, the first is, unlike the second, not in the list of articles, but in the page list of the namespace Wiktionary. Special namespaceMain article: Help:Special page The namespace "Special:" consists of "special pages", which are created by the software on demand, for example Special:Recentchanges. Custom namespacesFor instructions on creating a custom namespace or for more information, see Help:Custom namespaces. A project can have additional namespaces. For example, if a single project is multilingual (as opposed to the case of sister projects, each in one language) there may be a namespace Help and also a namespace Hilfe:, for help pages in the English and German language, respectively. A list of all namespaces is in the dropdown menus of Special:Prefixindex, Special:Allpages, Special:Recentchanges, and "My contributions". With the Query extension a list including also the numbers of the namespaces is given by {{SERVER}}{{SCRIPTPATH}}/api.php?action=query&meta=siteinfo&siprop=namespaces , for this project http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces . Custom namespaces are numbered from 100, on this project starting with Portal, 101 = Portal_talk. See m:Help:MediaWiki help policy for a list of custom namespaces on Meta. Template programmingTemplates can automatically detect namespaces and thus change how they look or what they do, depending on what type of page they are used on. They can do this by using magic words such as The English Wikipedia has several meta-templates that make it easy to detect namespaces. Then you don't have to handle magic words and parser functions in your own template code. Or you can use them as code examples to learn how to do it. Here are two of them:
If you copy these templates to another language Wikipedia or other Wikimedia project, then read the section "Copying to other projects?" in their documentation. CSS based namespace detectionWhen MediaWiki renders a page it adds some CSS classes in the HTML body tag to indicate the namespace of the page. This can be used in CSS code to detect namespace. For instance for this page the body tag looks like this: <body class="mediawiki ltr ns-12 ns-subject page-Help_Namespace skin-monobook"> The "ns-12" class indicates that this is a "Help:" page. And the "ns-subject" class indicates that this is a subject page, that is not a talk page and not a "Special:" page.
This can be used in CSS code to detect namespace and change looks of something or even hide it based on what type of page the object is shown on. For instance like this:
.ns-subject .somebox { /* Green border when on subject pages. */
border: 1px solid #00FF00;
}
.ns-talk .somebox { /* Blue border when on talk pages. */
border: 1px solid #0000FF;
}
Wikipedia uses this to change the colour of the pages based on namespace. See the lines with ".ns-0" in MediaWiki:Monobook.css. See also
Wikipedia-specific helpAliases:
Like all namespace names the aliases are fully case-insensitive. Thus for instance the link wp:help desk leads to Wikipedia:Help desk. Redirects are used for further shortening of the link. To learn more about these "shortcuts", see WP:WP. The transwiki namespace is a cross-project pseudo-namespace used for temporarily storing articles which need to be moved from one Wikimedia project to another. See transwiki in the Meta-Wiki for a full explanation. Wikipedia has two customised namespaces:
A table namespace was created on the English Wikipedia in May 2007, without special properties. It was removed within a few days after objections. See also bug 2194. Google does not index pages in namespace 1, see Template:Google_custom#Problem_with_the_Talk:_namespace. To search in this namespace use e.g. AltaVista instead, or with the MediaWiki search feature, use http://en.wikipedia.org/description/Special:Search?ns1=1&fulltext=Search&search=x and replace the x in the URL by the search term. Wikipedia-specific See alsoThis page is a copy of the master help page at Meta (for general help information all Wikimedia projects can use), with two Wikipedia-specific templates inserted. To update the main text, edit the master help page for all projects at m:Help:Namespace. For Wikipedia-specific issues, use Template:Ph:Namespace (the extra text at the bottom of this page) or Template:Phh:Namespace for a Wikipedia-specific lead (text appears at the top of this page). You are welcome to replace the full wikitext of this page with that of the master page at Meta at any time. To view this page in other languages see the master page at Meta. Página espejo de la WikipediaDirectorio de Enlaces Directorio dmoz Directorio espejo dmoz Pedro Bernardo |