$title = $this->getTitle();
$id = $title->getArticleID();
$config = $this->context->getConfig();
+ $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
$pageCounts = $this->pageCounts( $this->page );
. ' ' . $this->msg( 'parentheses', $pageLang )->escaped() ];
// Content model of the page
+ $modelHtml = htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) );
+ // If the user can change it, add a link to Special:ChangeContentModel
+ if ( $title->quickUserCan( 'editcontentmodel' ) ) {
+ $modelHtml .= ' ' . $this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink(
+ SpecialPage::getTitleValueFor( 'ChangeContentModel', $title->getPrefixedText() ),
+ $this->msg( 'pageinfo-content-model-change' )->text()
+ ) )->escaped();
+ }
+
$pageInfo['header-basic'][] = [
$this->msg( 'pageinfo-content-model' ),
- htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) )
+ $modelHtml
];
// Search engine status
"pageinfo-article-id": "Page ID",
"pageinfo-language": "Page content language",
"pageinfo-content-model": "Page content model",
+ "pageinfo-content-model-change": "change",
"pageinfo-robot-policy": "Indexing by robots",
"pageinfo-robot-index": "Allowed",
"pageinfo-robot-noindex": "Disallowed",
"pageinfo-article-id": "The numeric identifier of the page.\n{{Identical|Page ID}}",
"pageinfo-language": "Language in which the page content is written.",
"pageinfo-content-model": "The model in which the page content is written.\n\nUsed as label at [{{fullurl:Main Page|action=info}} action=info]. Followed by one of the following messages:\n* {{msg-mw|Content-model-wikitext}}\n* {{msg-mw|Content-model-javascript}}\n* {{msg-mw|Content-model-css}}\n* {{msg-mw|Content-model-text}}",
+ "pageinfo-content-model-change": "Link text for a link to Special:ChangeContentModel. The link will be wrapped in parenthesis.",
"pageinfo-robot-policy": "The search engine status of the page.\n\nUsed as label. Followed by any one of the following messages:\n*{{msg-mw|Pageinfo-robot-index}}\n*{{msg-mw|Pageinfo-robot-noindex}}",
"pageinfo-robot-index": "An indication that the page is indexable by search engines, that is listed in their search results.\n\nPreceded by the label {{msg-mw|Pageinfo-robot-policy}}.\n{{Identical|Allowed}}",
"pageinfo-robot-noindex": "An indication that the page is not indexable (that is, is not listed on the results page of a search engine).\n\nPreceded by the label {{msg-mw|Pageinfo-robot-policy}}.",