Jump to content

Template:Short linked pages

From mediawiki.org
Template documentation

Use this template to produce a list of short pages out of those linked from a given page. This template was originally meant to be useful in wikiprojects to produce a list of pages that need expansion out of a list of pages relevant to the wikiproject.

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

Usage

[edit]

Basic

[edit]
Markup Renders as
{{Short linked pages|Global templates}}
Loading...

Advanced

[edit]

Pages linked from Global templates that have the Template:Update, including an link to edit them.

Markup Renders as
{{Short linked pages
| page = Global templates
| namespace = *
| limit = 5
| editlink = true
}}
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="ShortLinkedPages"
    data-page="{{{page|{{{1|}}}}}}"
    data-namespace="{{{namespace|*}}}"
    data-limit="{{{limit|10}}}"
    data-editlink="{{{editlink|}}}"
    data-editintro="{{{editintro|}}}"
    >Loading...</div>[[Category:Gadget:ShortLinkedPages]]</includeonly>
    
  2. Create MediaWiki:Gadget-ShortLinkedPages.js with the following code:
    /**
     * ShortLinkedPages creates a list of the shortest pages linked from a given page
     * Documentation: https://www.mediawiki.org/wiki/ShortLinkedPages
     * Source code: https://www.mediawiki.org/wiki/MediaWiki:Gadget-Global-ShortLinkedPages.js
     */
    mw.loader.load( '//www.mediawiki.org/w/load.php?modules=ext.gadget.Global-ShortLinkedPages' );
    
  3. Add the following gadget to MediaWiki:Gadgets-definition:
    * ShortLinkedPages[ResourceLoader|hidden|default|categories=Gadget:ShortLinkedPages]|ShortLinkedPages.js
    

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

Template data

[edit]

Use this template to produce a list of short pages out of those linked from a given page

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Pagepage

Page from where to get the list of linked pages

Example
MediaWiki
Page namerequired
Namespacenamespace

Namespace number to which to limit the listed pages. Use * for all.

Default
0
Example
2
Numberoptional
Limitlimit

Max number of pages to list

Default
10
Example
100
Numberoptional
Edit linkeditlink

Whether to show a link to edit the listed pages

Example
yes
Booleanoptional
Edit introeditintro

Page with an edit intro to show when the editor loads

Page nameoptional

See also

[edit]