SimilarNamedArticlesHeader

Aus Free Software
Zur Navigation springen Zur Suche springen
Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
SimilarNamedArticlesHeader

Release status: stable

Implementation Special page
Description Display a list of pages matching a given prefix together with additional information on top of pages.
Author(s) Mathias Ertl (Mati talk)
Version 2.0.1 (2008-04-18)
MediaWiki 1.11.0 or later
License GPL v3 or any later version.
Download see Download
Documentation
Changelog
Parameters $wgSimilarNamedArticlesHeaderEnable, $wgSimilarNamedArticlesHeaderOnNamespaces, $wgSimilarNamedArticlesHeaderOnSubpages, $wgSimilarNamedArticlesHeaderIncludeSubpages, $wgSimilarNamedArticlesHeaderPREG
Hooks used

OutputPageBeforeHTML

This is a very simple extension that extends the SimilarNamedArticles-Extension. It prints the list much like the list given by Special:SimilarNamedArticles on top of each page. The functionality of this extension was provided by SimilarNamedArticles until version 2.0 of that extension.

Download

The source code of this extension is managed on GitHub. You can find the repository at mathiasertl/SimilarNamedArticlesHeader. To get the most recent version of this extension, fetch the current HEAD:

git clone https://github.com/mathiasertl/SimilarNamedArticlesHeader.git SimilarNamedArticlesHeader

Older versions are marked as tags, you can view available tags with git tag -l and move back to the current HEAD with git checkout <tag-name>. Versions for older versions of MediaWiki, if available, are managed as branches, use git branch and git checkout <branch> to move to a specific branch. To move back to the newest version, use git checkout master.

Note that GitHub allows you to download older different commits as tarball if you do not want to install git.

Installation & Configuration

You need to require_once the .php file and set a few configuration variables:

require_once( "extensions/SimilarNamedArticlesHeader/SimilarNamedArticlesHeader.php" );

# set to false to disable:
$wgSimilarNamedArticlesHeaderEnable = true;

# we want the list on the same namespaces asSimilarNamedArticles. 
$wgSimilarNamedArticlesHeaderOnNamespaces = $wgSimilarNamedArticlesNamespaces;

# set to true to also print on subpages:
$wgSimilarNamedArticlesHeaderOnSubpages = false;

# set to false to exclude subpages from list
$wgSimilarNamedArticlesHeaderIncludeSubpages = true;

# Search for articles with a pagename up to this regular expression (see extra documentation below):
$wgSimilarNamedArticlesHeaderPREG = '/ (VO|VU|VL|VD|UE|LU|PS|SE|PR|AR|AG|KO|KU).*/';


$wgSimilarNamedArticlesHeaderPREG 
Of course, the search for similar named articles cannot use the whole pagename as the search word, it would always find only itself. To compute the search string, the extension takes the name of the current page and replaces the given regular expression with an empty string.

Changelog

2.0.1
  • improved handling of pages that look like subpages
<= 2.0

See also

  • This extension uses the SimilarNamedArticles-extension and up until 2.0, this extension was part of it.

ToDo

The whole matching is a bit strange:

Licence

GPL v3 or any later version.