Jump to content

Manual:$wgContentNamespaces

From mediawiki.org
This page is a translated version of the page Manual:$wgContentNamespaces and the translation is 25% complete.
Espacios de nombres: $wgContentNamespaces
Namespaces which are considered to contain real content, or articles
Introducido en la versión:1.7.0 (r14738)
Eliminado en la versión:aún se usa
Valores permitidos:(Array of namespace indexes)
Valor predeterminado:[ NS_MAIN ]

Detalles

$wgContentNamespaces exists to allow custom namespaces to be acknowledged as containing useful content for the purpose of the following features:

Extension:Popups, Special:Random, Special:Statistics, Special:AncientPages, Special:DeadendPages, Special:FewestRevisions, Special:LonelyPages, Special:MostCategories, Special:MostInterwikis, Special:RandomPage, Special:ShortPages, Special:LongPages, Special:UncategorizedPages, Special:WithoutInterwiki, {{NUMBEROFARTICLES}}, Notifications#Features [1]

Useful if additional namespaces also contain "content" which should be considered when choosing a random page or generating a count of the number of articles in the wiki. It also serves as the default for $wgExemptFromUserRobotsControl , which means that __NOINDEX__ and __NOFOLLOW__ magic words won't work in these namespaces.

The main namespace is considered a content namespace, as are other namespaces in this array, referenced by index.

Ejemplo:

$wgContentNamespaces = [ 0, 12, 112 ];

o

$wgContentNamespaces = [ NS_MAIN, NS_HELP, NS_PROJECT, NS_CUSTOMNAMESPACE ];
If you change this variable, you'll have to run updateArticleCount.php to update the count in Special:Statistics and {{NUMBEROFARTICLES}}.

This does not control which namespaces the full-text search engine defaults to searching; that must be configured separately using $wgNamespacesToBeSearchedDefault .

The set of content namespaces for a wiki can be retrieved via the siteinfo API endpoint, e.g. action=query&meta=siteinfo&siprop=namespaces, and filter for namespaces with "content": true.

Véase también

References

  1. Page link notifications work for content namespace pages