Manual:$wgNamespacesWithSubpages/ja

From MediaWiki.org
Jump to: navigation, search
名前空間: $wgNamespacesWithSubpages
どの名前空間がサブページをサポートするか?
導入されたバージョン: pre 1.1.0
除去されたバージョン: 使用中
可能な値: (下記参照)
既定値: (下記参照)

他の設定: アルファベット順 | 機能順


詳細[edit | edit source]

変数は名前空間の配列を保持しており、 -1(Special:)から番号付けされており-2は含みません(直接リンクされたメディア)。どの名前空間がサブページを許可しているのかを示しています。配列は数値の名前空間IDによってインデックス化され、それぞれのインデックスは0(サブページを持たない)もしくは1(サブページが許可される)のどちらかを保持します。A categoryspace (namespace 14) subpage will work like any other category.

Help:Subpages/ja をご覧ください

Enabling for a namespace[edit | edit source]

See also Manual:Namespace constants/ja for a list of the NS_... codes.

The normal way to enable subpages for a given namespace is to edit the 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;
 
# etc.

指定した名前空間で無効にする[edit | edit source]

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;

すべての名前空間で有効にする[edit | edit source]

# 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.

デフォルトの値[edit | edit source]

The default is to enable subpages, but not within the 'main' namespace. They are enabled only within talk pages and user pages.

Note: Enabling on all 'talk' pages actually requires many entries in this array; one for each talk namespace. Each version of MediaWiki only went as far as the maximum namespace existing at the time.

1.5.0 以降[edit | edit source]

 array(
 	NS_TALK           => true,
 	NS_USER           => true,
 	NS_USER_TALK      => true,
 	NS_PROJECT_TALK   => true,
 	NS_IMAGE_TALK     => true,
 	NS_MEDIAWIKI_TALK => true,
 	NS_TEMPLATE_TALK  => true,
 	NS_HELP_TALK      => true,
 	NS_CATEGORY_TALK  => true
 );
言語: English  • français • 日本語 • 中文