Extension:TopTenTemplate

From MediaWiki.org

Jump to: navigation, search

               

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
Top Ten Template

Release status: beta

Implementation  Tag, User activity, Page action
Description Shows most viewed Pages that include a template
Author(s)  Greg Doermann and Sascha
Last Version  0.1 (2008-10-28)
MediaWiki  1.7+, earlier may work
License No license specified
Download View
Download
Example  <TopTenTemplate template="deprecated" namespace="usertalk">5</TopTenTemplate>

check usage (experimental)

Contents

[edit] Function

Shows the most popular Pages that contain a specified template. This is a derivation of the Top Ten Pages extension. It is compatible with TopTenPages and both extensions can be used simultaneously. I use it on our company wiki to track deprecated pages that get frequented the most.

[edit] Variables

TEMPLATE
Format: Name of an existing template
Default: None- Required (will be current page so you can place this on the extension documentation page)
OFFSET
Format: Integer
Default: 0
How many of the most popular Pages to ignore. (e.g. offset="1" to ignore the main page)
NAMESPACE
Format: One of these Strings ("talk", "user", "image", "template", "help", "category")
Default: Normal Articles (NS_MAIN) if string is missing or mistyped
NUMBEROFPAGES
Format: Integer
Default: 10
How many most popular pages should be listed.

[edit] Usage

<TopTenTemplate template=TEMPLATE [offset=OFFSET] [namespace=NAMESPACE]>[NUMBEROFPAGES]</TopTenTemplate>

[edit] Examples

To show 5 most popular Pages:

<TopTenTemplate template="deprecated" >5</TopTenTemplate>

To omit the most popular page(s):

<TopTenTemplate template="deprecated" offset=1/> 

To show most popular (article-)talk-pages:

<TopTenTemplate template="deprecated" namespace="talk"/> 

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

[edit] Demo

Fishbowl Inventory Deprecated Template

[edit] Installation

Copy to your Extensions Directory.

To activate the extension, include it from your LocalSettings.php with:

include("extensions/TopTenTemplate.php");

The Extension is pretty much the same as the TopTenPages with a different sql query and a couple of different variables. This extension could be merged with TopTenPages (with the consent of Sascha) in the future.

[edit] Disclaimer

Use at your own risk.