Open main menu

Extension:FlexiblePrefix

MediaWiki extensions manual
OOjs UI icon advanced.svg
FlexiblePrefix
Release status: beta
Implementation Special page , Hook
Description A more flexible version of Special:Prefixindex that lets you omit namespaces and redirects if there is only one result.
Author(s) (Gittenburgtalk)
Latest version 0.1.0 (2019-05-04)
License MIT License
Download
Example example using FlexiblePrefixDetails hook
$wgFlexiblePrefixNamespaces
Translate the FlexiblePrefix extension if it is available at translatewiki.net
Check usage and version matrix.

The FlexiblePrefix extension provides a more flexible version of Special:PrefixIndex that lets you omit namespaces and redirects if there is only one result.

UsageEdit

  • Special:FlexiblePrefix/Title
Searches across $wgFlexiblePrefixNamespaces.
  • Special:FlexiblePrefix/Namespace:Title
Searches in the given namespace.
  • Special:FlexiblePrefix/:Title
Searches in the main namespace.

InstallationEdit

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

Configuration parametersEdit

$wgFlexiblePrefixNamespaces
Array of ids of the enabled namespaces.

TipsEdit

  • The FlexiblePrefixDetails(Title $title, &$details, $context) hook lets you add details to results (details is an associative array mapping keys to HTML strings).
  • The FlexiblePrefixBeforeDisplay(&$items, $context) hook lets you modify the result list before display.
  • The SpecialFlexiblePrefix class can be integrated elsewhere (either by direct instantiation or inheritance).

CreditsEdit

This extension is a rewrite of SimilarNamedArticles by Mathias Ertl.