Extension:NamespacePaths/fr

From Linux Web Expert

Manuel des extensions MediaWiki
NamespacePaths
État de la version : stable
Description Permet de faire la correspondance entre les chemins personnalisés des articles et les espaces de noms du wiki
Auteur(s) Daniel Friesen @ Redwerks (Dantmantalk)
Dernière version 1.2.0 (2022-10-07)
MediaWiki 1.35+
Modifie la base
de données
Non
Licence Licence publique générale GNU v2.0 ou supérieur
Téléchargement
Téléchargements trimestriels Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Utilisé par les wikis publics Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Traduire l’extension NamespacePaths sur translatewiki.net si elle y est disponible

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.

Installation

  • <translate> [[<tvar name=2>Special:ExtensionDistributor/NamespacePaths/fr</tvar>|Download]] and move the extracted <tvar name=name>NamespacePaths/fr</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/NamespacePaths%2Ffr
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'NamespacePaths/fr' );
    
  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.

<translate> To users running MediaWiki <tvar name=1>1.39</tvar> or earlier: </translate>

<translate> The instructions above describe the new way of installing this extension using <tvar name=LoadExtension>wfLoadExtension()</tvar>.</translate> <translate> If you need to install this extension on these earlier versions (MediaWiki <tvar name=1>1.39</tvar> and earlier), instead of <tvar name=code>wfLoadExtension( 'NamespacePaths/fr' );</tvar>, you need to use:</translate>

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