Manual:$wgNamespaceContentModels

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:$wgNamespaceContentModels and the translation is 50% complete.

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎magyar • ‎polski • ‎português • ‎日本語
Espacios de nombres: $wgNamespaceContentModels
Content types defined for a given namespace
Introducido en la versión:1.21.0
Eliminado en la versión:aún se usa
Valores permitidos:no especificado
Valor predeterminado:[]
Otros configuración: Alfabéticamente | Por Función

Detalles

Associative array mapping namespace IDs to the name of the content model pages in that namespace should have by default (use the CONTENT_MODEL_XXX constants). If no special content type is defined for a given namespace, pages in that namespace will use the CONTENT_MODEL_WIKITEXT (except for the special case of JavaScript and CSS pages).

Ejemplo

JSON

Suppose you have created a new custom namespace NS_JSON and you want all new pages in this namespace to have JSON content and to be supported by the appropriate content handler. Add the following to your LocalSettings.php file.

$wgNamespaceContentModels[NS_JSON] = CONTENT_MODEL_JSON;

P.S. If you already created pages in this namespace, see the talk page.