Manual:$wgNamespaceContentModels

From mediawiki.org
This page is a translated version of the page Manual:$wgNamespaceContentModels and the translation is 70% complete.
コンテンツ ハンドラーと記憶域: $wgNamespaceContentModels
特定の名前空間に定義されたコンテンツタイプ
導入されたバージョン:1.21.0
除去されたバージョン:使用中
許容される値:未指定
既定値:[]

詳細

名前空間識別子と、当該の名前空間の命名規則によるコンテンツモデル ページの既定の名称を対応付けする連想配列 (CONTENT_MODEL_XXX 定数を採用)。 当該の名前空間に対して特殊なコンテンツ タイプを定義していない場合は、その名前空間にあるページに対して CONTENT_MODEL_WIKITEXT が使用されます (特例として JavaScript ページや CSS は対象外です)。

JSON

Suppose you have created a new custom namespace NS_JSON and you want all new pages in this namespace to have JSON content and to be supported by the appropriate content handler. Add the following to your LocalSettings.php file.

$wgNamespaceContentModels[NS_JSON] = CONTENT_MODEL_JSON;

If you already created pages in this namespace, see the talk page.