Jump to content

Template:Top linked pages

From mediawiki.org
Template documentation

Use this template create a table of the most visited pages linked from a given page.

See the installation instructions to get it working in your wiki.

Usage

[edit]

Basic

[edit]
Markup Renders as
{{Top linked pages|Manual:Hooks}}
Loading...

Advanced

[edit]
Markup Renders as
{{Top linked pages
| page = Manual:Hooks
| days = 10
| limit = 5
}}
Loading...

Installation

[edit]

To install this template in your wiki:

  1. Create a template with the following markup. You can choose the template name, parameter names and defaults to suit your wiki.
    <includeonly><div class="TopLinkedPages"
    data-page="{{{page|{{{1|}}}}}}"
    data-days="{{{days|30}}}"
    data-limit="{{{limit|10}}}"
    >Loading...</div>[[Category:Gadget:TopLinkedPages]]</includeonly>
    
  2. Create MediaWiki:Gadget-TopLinkedPages.js with the following code:
    /**
     * TopLinkedPages creates a table of the most visited pages linked from a given page
     * Documentation: https://www.mediawiki.org/wiki/TopLinkedPages
     * Source code: https://www.mediawiki.org/wiki/MediaWiki:Gadget-Global-TopLinkedPages.js
     */
    mw.loader.load( '//www.mediawiki.org/w/load.php?modules=ext.gadget.Global-TopLinkedPages' );
    
  3. Add the following gadget to MediaWiki:Gadgets-definition:
    * TopLinkedPages[ResourceLoader|hidden|default|categories=Gadget:TopLinkedPages]|TopLinkedPages.js
    

Done! Add your template to any page to verify that the installation was successful.

Template data

[edit]

Use this template to create a table of the most visited pages linked from a given page

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Pagepage 1

Page from where to get the list of linked pages

Example
Manual:Hooks
Page nameoptional
Daysdays

How many days of stats to take into account

Default
30
Example
10
Numberoptional
Limitlimit

How many pages to list

Default
10
Example
99
Numberoptional

See also

[edit]