Extension:NamespacePaths/zh

Category:Extensions with invalid or missing type/zhCategory:GPL licensed extensions/zh
NamespacePaths
Category:Stable extensions/zh
描述 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+Category:Extensions with manual MediaWiki version/zh
GNU通用公眾授權條款2.0或更新版本
下載 Category:Extensions in Wikimedia version control/zh
$wgNamespacePaths
前往translatewiki.net翻譯NamespacePaths
Category:All extensions/zh

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.

安裝

  • 下载,并将解压后的NamespacePaths移动到extensions/目录中。
    开发者和代码贡献人员应从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.

致MediaWiki 1.39或更早版本的

上面的说明介绍的是安装此的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.39和更早版本)中安装此,而不是wfLoadExtension( 'NamespacePaths' );,您需要使用:

require_once "$IP/extensions/NamespacePaths/NamespacePaths.php";
Category:All extensions/zh Category:Extensions in Wikimedia version control/zh Category:Extensions still supporting pre-registration versions Category:Extensions with invalid or missing type/zh Category:Extensions with manual MediaWiki version/zh Category:GPL licensed extensions/zh Category:GetLocalURL::Article extensions/zh Category:Stable extensions/zh Category:WebRequestPathInfoRouter extensions/zh