Extension:NamespacePaths

From mediawiki.org
This page is a translated version of the page Extension:NamespacePaths and the translation is 67% complete.
MediaWiki 拡張機能マニュアル
NamespacePaths
リリースの状態: 安定
説明 Allows custom article paths to be mapped to namespaces of the wiki
作者 Daniel Friesen @ Redwerks (Dantmanトーク)
最新バージョン 1.2.0 (2022-10-07)
MediaWiki 1.35+
データベースの変更 いいえ
ライセンス GNU 一般公衆利用許諾書 2.0 以降
ダウンロード
$wgNamespacePaths
Quarterly downloads 2 (Ranked 142nd)
translatewiki.net で翻訳を利用できる場合は、NamespacePaths 拡張機能の翻訳にご協力ください

The NamespacePaths extension extends custom article paths to allow namespaces to be mapped to extra paths separate from the article path. For example mapping the help namespace to /help/$1 so pages like "Help:Contents" go to /help/Contents.

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のNamespacePathsという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/NamespacePaths
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'NamespacePaths' );
    
  1. Configure the $wgNamespacePaths with the paths you want to use for namespaces, the key is the namespace id (you can use the NS_ constants), and the value is a $wgArticlePath style string like "/help/$1".
  2. Configure your webserver to pass the extra paths to MediaWiki. Consult the short URL documentation you set the article paths for your wiki and extend it to map the extra paths to "index.php".
Note: You don't want to try mapping things to ⁄index.php?title=$1, doing so will break the paths. If you just make sure that ⁄index.php is run for these extra article paths as long as your webserver sets REQUEST_URI correctly the extension will take it from there and extract the correct title on it's own.
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

MediaWiki 1.39以前を稼働させている利用者へ:

上記の手順では、wfLoadExtension()を使用してこの拡張機能をインストールする新しい方法を記載しています。 この拡張機能をこれらの過去のバージョン (MediaWiki 1.39以前) にインストールする必要がある場合は、wfLoadExtension( 'NamespacePaths' );の代わりに以下を使用する必要があります:

require_once "$IP/extensions/NamespacePaths/NamespacePaths.php";