Jump to content
MediaWiki

Content handlers

From mediawiki.org
(Redirected from Content model)
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.
About
About the ContentHandler
Content handlers and their implementation
Usage
Changing the content model of a page
Changing the content model of a namespace
Extensions using the ContentHandler
Adding content models with an extension
Examples:
Configuration settings
$wgContentHandlers
$wgNamespaceContentModels
$wgContentHandlerTextFallback
$wgContentHandlerUseDB
Support and development
Latest technical documentation (Git)
Phabricator
v · d · e

This page contains information about different content models and their implementations. It may be incomplete as any extension can add their own content model. Content model refers to the internal ID that represents that content type. The content format is the mime-type of ways the content can be represented (serialized) in.

Core content handlers

[edit ]

These are the content handlers which are included in MediaWiki. The "content handler" column pertains to a content handler class found in the MediaWiki core repository.

Content handler Content model Content format(s) Usage
CssContentHandler css text/css For pages that contain CSS, like MediaWiki:Common.css
JavaScriptContentHandler javascript text/javascript For pages that contain JavaScript, like MediaWiki:Common.js
JsonContentHandler json application/json A generic model that stores information in the JSON format. Many extension content handlers build on top of this.
TextContentHandler text text/plain A generic model that displays plain text (no formatting). It is not intended to be used directly, but it can be.
WikitextContentHandler wikitext text/x-wiki Wikitext! The default in most pages.

Extension content handlers

[edit ]

Table of content handlers defined by extensions. See also Category:ContentHandler extensions .

Content model Content format(s) Extension Usage
Campaign application/json UploadWizard (Campaigns) See Extension:UploadWizard/Campaigns
EntitySchema application/json EntitySchema Schemas to describe how the data of Wikibase entities should be arranged
flow-board application/json StructuredDiscussions For Structured Discussions pages
GadgetDefinition application/json Gadgets
GeoJson application/json Maps For GeoJson pages in maps.
JsonConfig
<Customizable>
application/json+pretty JsonConfig Provides a wiki-based JSON configuration system
JsonSchema application/json EventLogging See Extension:EventLogging/Guide#Creating a schema
MassMessageListContent application/json MassMessage
Newsletter application/json Newsletter
proofread-index text/x-wiki (default) ProofreadPage
proofread-page text/x-wiki (default), application/json ProofreadPage
sanitized-css text/css TemplateStyles For sanitized CSS intended for use with TemplateStyles
Scribunto text/plain Scribunto For Scribunto (Lua) modules in the Module namespace
SecurePoll application/json SecurePoll For managing SecurePoll elections on-wiki
smw/schema application/json SemanticMediaWiki For implementing a JSON schema in Semantic MediaWiki (see https://www.semantic-mediawiki.org/wiki/Help:Schema)
StructuredNavigation application/json StructuredNavigation
tei application/tei+xml TEI
translate-messagebundle text/plain Translate
wikibase-item application/json (default), application/vnd.php.serialized Wikibase Repository See wikidata:Help:Items
wikibase-lexeme application/json (default), application/vnd.php.serialized WikibaseLexeme See wikidata:Wikidata:Lexicographical data
wikibase-mediainfo application/json (default), application/vnd.php.serialized WikibaseMediaInfo
wikibase-property application/json (default), application/vnd.php.serialized Wikibase Repository See wikidata:Help:Properties
zobject text/plain WikiLambda

AltStyle によって変換されたページ (->オリジナル) /