Jump to content

Handbuch:$wgNamespaceAliases

From mediawiki.org
This page is a translated version of the page Manual:$wgNamespaceAliases and the translation is 61% complete.
Outdated translations are marked like this.
Namensräume: $wgNamespaceAliases
Erlaubt alternative Namen für Namensräume
Eingeführt in Version:1.10.0 (r21720)
Entfernt in Version:Weiterhin vorhanden
Erlaubte Werte:(Array von Strings)
Standardwert:[]

Details

Dies erlaubt weitere Namen für primär vorhandene Namensräume die durch $wgExtraNamespaces und die Sprachdatei definiert sind.[clarification needed] Falls eine Seite mit einem solche Präfix aufgerufen wird, wird die Anfrage auf den Primärnamen weitergeleitet.

Dies sollte als Liste von Namensraum-Namen zu IDs definiert werden.

Beispiel:

$wgNamespaceAliases = [
	'Wikipedian' => NS_USER,
	'Wikipedian_talk' => NS_USER_TALK,
	'Our_wiki' => 4,
	'Our_wiki_talk' => 5,
];
Achtung! Achtung: Verwende Unterstriche statt Leerzeichen in Namensraumnamen. 'My Namespace' ist kein zulässiger Name; verwende stattdessen 'My_Namespace'. (When used later on the wiki in links and searches, either spaces or underscores can be used.)
Vor MediaWiki 1.17 war es nicht möglich, einen Alias für NS_MAIN anzulegen.
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.

Für eine einzelne Alternative:

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