User:DKinzler (WMF)/Page type

Page types determine what kind(s) of content can exist on a given page, how it is displayed and edited, and what other actions are defined for it.

MediaWiki currently distinguishes several types of pages, but has no clear abstraction for modeling this distinction, and no concise way to define additional page types. The types of pages supported by core include:


 * Content pages: aka "normal" pages with no special behavior
 * Talk pages: not much special behavior, but could get a different editing interface or content model in the future
 * User pages: mostly like normal pages, but show additional UI elements.
 * User talk pages: mostly like talk pages, trigger notifications, have special permission handling
 * File pages: page shows media handler and upload history in addition page normal content, deletion and renaming has special handling, page cannot be moved to other namespaces.
 * Category pages: page display is different, caching behavior is different.
 * Message pages: shows default message if no content is defined, has magic behavior for subpages, purges message cache on edit.
 * Translation tables: currently treated like a message, but could/should have a dedicated editing interface.
 * CSS pages: need special permissions, are applied as stylesheets on preview.
 * JS pages: need special permissions, are executed on preview.

A page type handler would, for a given title, determine the following:


 * permissions needed to edit
 * UI shown on action=edit
 * Other action overrides, additional actions
 * Add/remove skin elements
 * internal updates to perform when the page changes (e.g. for message pages)
 * special behavior on preview (e.g. for css pages)
 * allowed content models for the main slot
 * allowed slots in addition to the main slot
 * layout of the contents of different slots on page view