Extension:TopTenPages

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
Top Ten Pages

Release status: beta

TopTenPages.png
Implementation Tag, User activity, Special page
Description Allows to display the most popular pages of a wiki on a page
Author(s) Saschatalk
Latest version 0.3.2 (2014-06-25)
MediaWiki 1.19+
PHP 5.3+
Database changes No
License No license specified
Download see here
Example
Parameters

$wgttpAlwaysStartAtOne <TopTenPages/> or

<TopTenPages offset="1">5</TopTenPages>

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

Check usage and version matrix; code metrics

The TopTenPages extension allows to display the most popular pages of the wiki on a page.

Usage[edit | edit source]

 <TopTenPages [offset=OFFSET]>[NUMBEROFPAGES]</TopTenPages>

Or:

 {{Special:TopTenPages/OFFSET/NUMBEROFPAGES}}
OFFSET
Format: Number
Default: 0 or -
How many of the most popular Pages to ignore. (e.g. 1 to ignore the main page)
NUMBEROFPAGES
Format: Number
Default: 10
Maximum number of pages to be listed.

Examples[edit | edit source]

To show 10 most popular Pages:

<TopTenPages/> 

To show 5 most popular Pages:

<TopTenPages>5</TopTenPages>

To omit the most popular page(s):

<TopTenPages offset=1/> 

This Extension makes use of the Wiki-Builtin-Function Special:Popularpages with similar functionality (which is disabled in some installations).

Image description[edit | edit source]

The Image was created by this code:

==Most visited pages==
<TopTenPages>10</TopTenPages>
[[Special:PopularPages|mehr >>]]

Installation[edit | edit source]

Copy Code files to your extensions directory.

To install the extension, add to your LocalSettings.php:

require_once("$IP/extensions/TopTenPages.php");

Configuration[edit | edit source]

$wgttpAlwaysStartAtOne
By default, if the offset is set, the numbering will start based on the offset. If you specifiy offset=1 as in the example above your list will start with 2. ie. "2 The art of cooking" instead of "1 The art of cooking". This is probably not the desired behavior. Set this variable to true to avoid this.
$wgttpAlwaysStartAtOne = true;

Sites that use TopTenPages[edit | edit source]