Jump to content

Manual:Namespace

From mediawiki.org
This page is a translated version of the page Manual:Namespace and the translation is 40% complete.
Outdated translations are marked like this.

Um namespace (espaço nominal) é uma coleção de páginas que tenham conteúdo com um propósito semelhante, ou seja, páginas em que o uso pretendido é o mesmo. Namespaces podem ser pensados como partições de diferentes tipos de informações dentro da mesma wiki, e mantêm o índice real separado de perfis de usuário, páginas de ajuda, etc. A namespace prefix is the first part of a page title (if present) indicating which namespace it belongs to. It is separated from the rest of the title by a colon (:). The so-called "main namespace" does not have a prefix. Every namespace has a number or index which the MediaWiki software uses to refer to the namespace instead of its name.

Visão técnica geral

Every page on a wiki has a unique title which may begin with a namespace prefix or not. Pages in different namespaces can otherwise share the same name (i.e., not counting their prefixes).

Por exemplo:

Título Namespace Código Page description
API 0 a page in the "main namespace"
Template:API Template 10 a template that can be transcluded into other pages
Manual:API Manual 100 a page in our MediaWiki manual (which, in this case, redirects to a different page)

Because the "main namespace" does not have a prefix, any page title having no prefix—or any page whose apparent prefix doesn't match any recognized namespace on the wiki (nor any interwiki/interlanguage prefix )—is interpreted as a page in the main namespace.

O "espaço nominal principal" não tem prefixo. Além disso, as páginas no namespace principal não podem ter nomes que começam com qualquer um dos prefixos de espaços nominais existentes seguidos por dois pontos. (If this has happened as the result of the creation of a new namespace, the namespaceDupes.php maintenance script can be used to fix the problem.)

As páginas podem ser movidas entre espaços nominais simplesmente alterando a parte do prefixo de seu título.

Namespace prefixes can be translated, and aliases (helpful in shortcuts) can be configured for each (see $wgNamespaceAliases ). All namespaces also have a "canonical" prefix, which works on all wikis regardless of configuration. Aliases and canonical names can be used in links, when performing a search, and in the page title with the help of the {{DISPLAYTITLE}} magic word.

Each namespace has a corresponding namespace index. Within the database, the title is split into namespace index and text title, and this is used for storage in the page.page_namespace and page.page_title columns, among others.

Assunto e discussão de espaços nominais

See Help:Páginas de discussão for instructions on how to use talk pages.

Most namespaces have an associated discussion namespace (or "talk" namespace). All discussion namespaces have odd-integer indices, and the discussion namespace index for a specific namespace with index n is n+1. The namespaces with even-integer indices are subject namespaces (note that this is a distinct concept from content namespaces). The subject-talk duality can be explored using the {{SUBJECTPAGENAME}} and {{TALKPAGENAME}} magic words. The ‎<body> tag of pages in talk namespaces has the ns-talk CSS class, which might be useful for styling.

Namespaces embutidos

MediaWiki ships with 18 built-in namespaces:

  • 16 "real" namespaces, corresponding to actual pages, numbered 0 to 15, and grouped in subject/talk pairs
  • 2 "virtual" namespaces (one for dynamically generated special pages, and one serving as an alias for direct file links), numbered -1 and -2, respectively. Since these namespaces don't correspond to pages stored in the database, one cannot create or delete pages in these namespaces, and there are no corresponding discussion namespaces.

A lista completa é apresentada na tabela abaixo.

ID Nome Propósito Discussão
0 (Main) Artigos de conteúdo "Reais" .[1] Talk 1
2 User Páginas do usuário .[2] User talk 3
4 Project Informações sobre a wiki[3] Project talk 5
6 File Páginas de descrição de mídia File talk 7
8 MediaWiki Personalização da interface do site[4] MediaWiki talk 9
10 Template Páginas de predefinições Template talk 11
12 Help Páginas de ajuda Help talk 13
14 Category Páginas de descrição de categorias Category talk 15
-1 Special Contém páginas especiais N/A
-2 Media Alias de links diretos para arquivos de mídia

Each namespace also has a constant derived from its name, with all letters in uppercase, spaces replaced by underscores, and prefixed by NS_. For example, the constant for the "User talk" namespace is NS_USER_TALK. A complete list can be found in Extension default namespaces .


  1. O espaço nominal do assunto não tem prefixo.
  2. A edição de uma página de discussão do usuário gera uma notificação para o usuário.
  3. Definido por $wgMetaNamespace , que a menos que seja definido manualmente de outra forma, o padrão é $wgSitename .
  4. Só editável por usuários com a permissão 'editinterface'.
    Algumas poucas páginas neste espaço nominal requerem permissões de editsitecss e editesitejs, além disso.

Namespaces personalizados

Extensões e administradores de site podem definir espaços para nome adicionais para agrupar classes adicionais de páginas. For a thorough overview, see Manual:Using custom namespaces .

Funcionalidade

Some namespaces, like Project and Help, only exist for convenience and do not have any extra functionality compared to the Main namespace.

Template namespace pages can be transcluded without namespace prefix.

User namespace pages are associated with user accounts or IP addresses. Changes to user talk pages generate an automatic message notification.

Pages in the "MediaWiki" namespace are used to override default messages in language file and can only be edited by administrators or other users with the editinterface permission.

File and Category pages have special functionality, as described in Ajuda:Gerenciamento de arquivos and Ajuda:Categorias . Os arquivos podem ser movidos por usuários com o direito "movefile". As páginas de categoria podem ser movidas por usuários com o direito "move-categorypages".

All pages in discussion namespaces have a "post a comment" feature.

Ver também

Site administration

Extensions

For extension developers