Manual:$wgNamespacesWithSubpages

From MediaWiki.org
Jump to: navigation, search
This page is a translated version of the page Manual:$wgNamespacesWithSubpages and the translation is 40% complete.

Other languages:
English • ‎español • ‎français • ‎日本語 • ‎polski • ‎português do Brasil • ‎中文
Namespaces: $wgNamespacesWithSubpages
Which namespaces should support subpages?
導入されたバージョン: pre 1.1.0
除去されたバージョン: 使用中
可能な値: 下記参照
既定値: 下記参照
他の設定: アルファベット順 | 機能順

詳細

The variable holds an array indicating which namespaces allow sub-pages. The array is indexed by the numeric namespace ID, and each array value is either 0 (no sub-pages) or 1 (sub-pages allowed). A categoryspace (namespace 14) subpage will work like any other category.

Help:下位ページHelp:Subpages を参照してください。

名前空間の有効化

NS_... コードの一覧は、Manual:名前空間の定数Manual:Namespace constants も参照してください。

The normal way to enable subpages for a given namespace is to edit the LocalSettings.phpManual:LocalSettings.php and insert the following:

# Enable subpages in the main namespace
$wgNamespacesWithSubpages[NS_MAIN] = true;

# Enable subpages in the template namespace
$wgNamespacesWithSubpages[NS_TEMPLATE] = true;

# など

名前空間の無効化

Disable subpages in a namespace (where it is enabled by default). For example NS_TALK has subpages enabled by default in MediaWiki. To disable them, set false:

$wgNamespacesWithSubpages[NS_TALK] = false;

すべての名前空間の有効化

# Enable subpages in all namespaces
$wgNamespacesWithSubpages = array_fill(
 	0, 200, true
 	);

This assumes you have no more than 200 namespaces.

If you only wanted to enable subpages for all talk namespaces, you would use:

# Enable subpages in all talk namespaces
$arr = array_fill(
 	0, 200, true
 	);
foreach( $arr as $key => $value ) {
	if( $key & 1 ) { // Bit checking
		unset ( arr[$key] );
	}
}
$wgNamespacesWithSubpages = array_merge(
 	$wgNamespacesWithSubpages, $arr
 	);

Again, this assumes you have no more than 200 namespaces.

既定値

$wgNamespacesWithSubpages = array(
 	NS_TALK => true,
 	NS_USER => true,
 	NS_USER_TALK => true,
 	NS_PROJECT => true,
 	NS_PROJECT_TALK => true,
 	NS_FILE_TALK => true,
 	NS_MEDIAWIKI => true,
 	NS_MEDIAWIKI_TALK => true,
 	NS_TEMPLATE_TALK => true,
 	NS_HELP => true,
 	NS_HELP_TALK => true,
 	NS_CATEGORY_TALK => true
 	);

注 注: The default of this setting has changed over the years. To be sure which one applies to your wiki check this setting in "DefaultSettings.php".

関連項目