Extension:NamespacePopups

From MediaWiki.org
Jump to: navigation, search


MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
NamespacePopups

Release status:Extension status beta

ImplementationTemplate:Extension#type Link markup
DescriptionTemplate:Extension#description add a small popup (see Extension:PagePopups) link at the right of links of certain namespaces
Author(s)Template:Extension#username VictorPortontalk
Latest versionTemplate:Extension#version 0.0.3
MediaWikiTemplate:Extension#mediawiki 1.28
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
README
ParametersTemplate:Extension#parameters

$wgNamespacePopupsNamespaceMap, $wgNamespacePopupsAnchor

Hooks usedTemplate:Extension#hook
HtmlPageLinkRendererEnd

Translate the NamespacePopups extension if it is available at translatewiki.net

Check usage and version matrix.

NamespacePopups extension automatically adds a small popup (see Extension:PagePopups) link at the right of links of certain namespaces.

Normal namespaces are mapped to popup namespaces with $wgNamespacePopupsNamespaceMap configuration variable.

For an example see https://withoutvowels.org/wiki/Tanakh:Genesis_1:1 (at the time of writing this, only the first (from the right) word בראשית is tagged).

Installation[edit]

First install Extension:PagePopups.


  • Download and place the file(s) in a directory called NamespacePopups in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'NamespacePopups' );
    
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'NamespacePopups' );, you need to use:

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

Configuration parameters[edit]

$wgNamespacePopupsNamespaceMap
an associative array mapping a normal namespace into a popup namespace.

If '*' is mapped it is applied to every namespace (including empty namespace). If '*' is mapped to '*', for every link it is displayed a popup link with the same target.

Examples:

   $wgNamespacePopupsNamespaceMap = array('A' => 'B');

(display B:X popup link for every A:X link).

   $wgNamespacePopupsNamespaceMap = array('A' => 'B', 'C' => D);

(display B:X popup link for every A:X link and also display D:X popup link for every C:X link).

   $wgNamespacePopupsNamespaceMap = array('*' => 'B');

(display B-namespace popup link for every link to every namespace (including the empty namespace).

   $wgNamespacePopupsNamespaceMap = array('' => 'B');

(display B-namespace popup link for link with empty namespace.

   $wgNamespacePopupsNamespaceMap = array('*' => '*');

(near each link display a popup link with the same target as the main link).

$wgNamespacePopupsAnchor
the popup link text (default '↑')

After re-configuration of namespaces you need to run php maintenance/refreshLinks.php in order to get red/blue status of popup ("arrow") links right.

Bugs[edit]

  • Most likely it is wrong with interwiki links
  • Popup should be centered around the main link, not the supplementary popup link (do you agree?)
  • There is some problem on whether a link inside MediaWiki:Sitenotice is considered a self-link of a page (and thus is displayed as bold text without a link) or a regular link

See also[edit]