Manual:$wgContentHandlers

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

Other languages:
English • ‎español • ‎magyar • ‎polski • ‎čeština • ‎日本語
Muestra: $wgContentHandlers
Mapping of content type handlers
Introducido en la versión:1.21.0
Eliminado en la versión:aún se usa
Valores permitidos:(Array of content model ID constants)
Valor predeterminado:(véase más abajo)

Detalles

Plugins for page content model handling. Each entry in the array maps a model ID constant to a PHP class name.

Versión de MediaWiki: 1.34

When undeploying an extension that provides handling for a content model, that content model becomes unsupported, leading to MWUnknownContentModelExceptions to be raised. To avoid this, the content model in question can be defined to use the UnknownContentHandler:

   $wgContentHandlers['foo-bar'] = 'UnknownContentHandler';

This allows pages that use the new unsupported content model to still be accessible, even though their content can no longer be shown.

Alternatively, if the content model in question is a text based model, it can be re-defined to be handled as plain text:

   $wgContentHandlers['foo-bar'] = 'TextContentHandler';

The content of pages that use this content model remain readable and editable, but lose any special capabilities and markup support.

Valor predeterminado

Versión de MediaWiki: 1.31
$wgContentHandlers = [
	// the usual case
	CONTENT_MODEL_WIKITEXT => WikitextContentHandler::class,
	// dumb version, no syntax highlighting
	CONTENT_MODEL_JAVASCRIPT => JavaScriptContentHandler::class,
	// implementación simple, para que lo usen extensiones, etc.
	CONTENT_MODEL_JSON => JsonContentHandler::class,
	// dumb version, no syntax highlighting
	CONTENT_MODEL_CSS => CssContentHandler::class,
	// texto plano, para que lo usen extensiones, etc.
	CONTENT_MODEL_TEXT => TextContentHandler::class,
];
Versiones de MediaWiki: 1.24 – 1.30
$wgContentHandlers = [
	// the usual case
	CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler',
	// dumb version, no syntax highlighting
	CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler',
	// simple implementation, for use by extensions, etc.
	CONTENT_MODEL_JSON => 'JsonContentHandler',
	// dumb version, no syntax highlighting
	CONTENT_MODEL_CSS => 'CssContentHandler',
	// plain text, for use by extensions, etc.
	CONTENT_MODEL_TEXT => 'TextContentHandler',
];
Versiones de MediaWiki: 1.21 – 1.23
$wgContentHandlers = array(
	// the usual case
	CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler',
	// dumb version, no syntax highlighting
	CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler',
	// dumb version, no syntax highlighting
	CONTENT_MODEL_CSS => 'CssContentHandler',
	// plain text, for use by extensions etc
	CONTENT_MODEL_TEXT => 'TextContentHandler',
);