Manual:$wgContentHandlers

From MediaWiki.org
Jump to navigation Jump to search

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎polski • ‎português • ‎português do Brasil • ‎日本語
Content Models and Handlers
MediaWiki allows for page content types other than wikitext. It offers built-in support for JavaScript, CSS, JSON and plain text. Extensions can use MediaWiki's ContentHandler mechanism to add new content models for accepting different formats and controlling how they are rendered, stored and edited.
Icon apps query.svg About
Icon tools.svg Usage
Examples:
Icon-gears.svg Configuration settings

Support and development
Git-logo.svg Latest technical documentation (Git)
Wikimedia Phabricator logo.svg Phabricator
Output: $wgContentHandlers
Mapping of content type handlers
Introduced in version:1.21.0
Removed in version:still in use
Allowed values:Array of content model ID constants
Default value:(see below)
Other settings: Alphabetical | By function

Details[edit]

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

Default value[edit]

The default value, as of 1.24.0, is:

$wgContentHandlers = array(
	// 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',
);