From Celeste Wiki

<languages/> Template:PD Help PageTemplate:ContentHandler

<translate> Special:ChangeContentModel while using the MonoBook skin.</translate>

<translate> The <tvar|1>Special:ChangeContentModel</> page can be used to change the "content model" of a page.</translate> <translate> A content model, very broadly, is the format or type of a given page on a wiki.</translate> <translate> By default a page's content model is wikitext, a rich text format that makes use of wiki markup.</translate> <translate> Content models used on Wikimedia projects include <tvar|1>css</> and <tvar|2>javascript</> for storing code, <tvar|3>wikibase-item</> for entries on Wikidata, and <tvar|4>Campaign</> on Wikimedia Commons for upload campaigns such as Wiki Loves Monuments.</translate> <translate> A list of content models is available at [[<tvar|1>Special:MyLanguage/content handlers</>|content handlers]].</translate> <translate> More technical information is available at [[<tvar|1>Special:MyLanguage/Manual:ContentHandler</>|Manual:ContentHandler]].</translate>

<translate> All actions are logged to <tvar|1>Special:Log/contentmodel</>, with a convenient "<tvar|2>Template:Int</>" link to undo changes if necessary.</translate> <translate> Users must have the <tvar|1>editcontentmodel</> permission to be able to change content models.</translate> <translate> On Wikimedia projects this permission is currently granted to [[<tvar|1>Special:MyLanguage/Manual:Administrators</>|sysops]].</translate>


Background[edit source]

</translate> <translate> Traditionally, the only types of pages you could create on MediaWiki were wikitext pages: rich text documents written in wikitext markup.</translate> <translate> This is acceptable for writing encyclopedia entries on Wikipedia, but falls short for content of other types, such as blocks of source code, structured data content, or complex workflows.</translate>

<translate> With the advent of the Wikidata project (and the [[<tvar|1>Special:MyLanguage/Wikibase</>|Wikibase]] extension) in 2012, the ContentHandler branch was developed to allow the creation of pages other than wikitext documents.</translate> <translate> As of MediaWiki 1.21, ContentHandler is a part of the core MediaWiki software.</translate>

<translate> Some generic content models include those meant for storing and presenting source code, but they can also be used to create customized editing interfaces.</translate> <translate> For example, instead of using a horrible mess of templates to structure content on a page, you could store the underlying data in a structured format such as JSON and then write a [[<tvar|1>Special:MyLanguage/Manual:Extensions</>|MediaWiki extension]] that builds a custom editing interface on top of this structured data.</translate> <translate> This approach is used by [[<tvar|1>Special:MyLanguage/Extension:MassMessage</>|MassMessage]] to create delivery list pages and by [[<tvar|2>Special:MyLanguage/Extension:CollaborationKit</>|CollaborationKit]] for creating WikiProjects.</translate> <translate> Although these extensions have their own workflows for creating pages, <tvar|1>Special:ChangeContentModel</> can also be used.</translate>

<translate> As an alternative to setting content models on a page-by-page basis, you can specify alternative defaults for a given namespace.</translate> <translate> For example, the default content model in the <tvar|1>Module</> namespace is <tvar|2>ScribuntoContent</>.</translate> <translate> Similarly, you can enforce that a given content model is only used in a given namespace; <tvar|1>ScribuntoContent</> can only be used in the <tvar|2>Module</> namespace.</translate>


Viewing a page's current content model[edit source]

</translate> <translate> To view a page's current content model, click "<tvar|pageinfo>Template:Int</>" in the sidebar toolbox.</translate> <translate> You can also append <tvar|1>?action=info</> to a URL to get the same page.</translate>


Changing a page's content model[edit source]

</translate> <translate> Go to <tvar|1>Special:ChangeContentModel</> (or follow the "change" link on the "Page information" page), enter the page name you wish to change.</translate> <translate> This can be a non-existent page if you wish to create a new page that uses a different content model from the default.</translate> <translate> Next, choose the content model you wish to change to.</translate> <translate> Click "<tvar|change>Template:Int</>" to make the change.</translate>

<translate> Note that not all conversions are possible.</translate> <translate> If you are trying to convert a page that already exists and the MediaWiki software cannot figure out how to re-interpret the current page's content, the content model will not be converted and you will get an error message.</translate> <translate> When this happens, it is recommended that you archive the old page and create the page anew in the new content model.</translate> <translate> For instance, you could rename "Project:Foo" to "Project:Foo/old" and then use <tvar|1>Special:ChangeContentModel</> to create a new page at "Project:Foo".</translate> <translate> If possible, you should include a link to "Project:Foo/old" on the new page.</translate>


Undoing a change[edit source]

</translate> <translate> All content model changes are logged at <tvar|1>Special:Log/contentmodel</> on your wiki.</translate> <translate> To undo a change, go to the relevant entry in the log and click "<tvar|revert>Template:Int</>".</translate> <translate> You will see a pre-filled form; click "<tvar|change>Template:Int</>" to carry out the revert.</translate> <translate> If you are viewing the page history and the most recent change was the one that changed the content model, you can use the undo feature to change the content model back.</translate> <translate> Rollback will also undo any content model changes.</translate>

<translate> Note that this may not always work, particularly if the page was edited after the content model was changed in such a way to make it incompatible with the old content model.</translate> <translate> When this happens, you will have to undo the edits that made it incompatible.</translate> <translate> Alternatively, you could carry out the content model change anew and archive the old content.</translate> <translate> Ideally, content model changes are few and far between.</translate> <translate> In most situations, a page will not have to change content model more than once.</translate>

[[Category:ContentHandler{{#translation:}}]] [[Category:Help{{#translation:}}|ChangeContentModel]]