Manual:$wgNamespaceAliases
Appearance
| 名前空間: $wgNamespaceAliases | |
|---|---|
| 名前空間の別名を指定する。 |
|
| 導入されたバージョン: | 1.10.0 (r21720) |
| 除去されたバージョン: | 使用中 |
| 許容される値: | (文字列の配列) |
| 既定値: | [] |
| その他の設定: アルファベット順 | 機能順 | |
詳細
$wgExtraNamespaces および言語ファイルで定義された、地域化された本来の名前空間名に対して、この変数では別名を指定します。[clarification needed]
ページがこの別名の接頭辞でリクエストされた場合は、本来の名前にリダイレクトされます。
この変数には名前空間名から ID へのマッピングを設定してください。
例:
$wgNamespaceAliases = [
'Wikipedian' => NS_USER,
'Wikipedian_talk' => NS_USER_TALK,
'Our_wiki' => 4,
'Our_wiki_talk' => 5,
];
名前空間名では、空白の代わりにアンダースコア (_) を使用してください。 'My Namespace' は無効な名前であるため、代わりに 'My_Namespace' を使用します。 (When used later on the wiki in links and searches, either spaces or underscores can be used.) |
When adding new namespace aliases, run namespaceDupes.php as appropriate. Otherwise, you may make some pages inaccessible. |
MediaWiki 1.17 未満では、NS_MAIN の別名は作成できませんでした。
Namespace names, including aliases, are case-insensitive. 'Wikipedian', 'wikipedian', and 'WIKIPEDIAN' are all the same alias.
Notice how aliases are being defined here for two namespaces and their corresponding talk namespaces. Including similar aliases for talk namespaces is not strictly necessary, but not doing so can be confusing to users.
別名を 1 件だけ、または複数件を 1 件ずつ追加するには、以下の構文を使用します:
$wgNamespaceAliases['WP'] = NS_PROJECT;
$wgNamespaceAliases['WPT'] = NS_PROJECT_TALK;
$wgNamespaceAliases['WP_talk'] = NS_PROJECT_TALK;
This illustrates how multiple aliases can be used for the same namespace.
If this setting is set to a namespace that does not exist (e.g. the namespace has not been added to $wgExtraNamespaces but a constant has been defined) the alias will redirect to the main space.
| View the values of this configuration setting on the Wikimedia wikis in core-Namespaces.php. |