Jump to content

Template:Linked pages with templates

From mediawiki.org
Template documentation

Use this template to list pages linked from a given page with one or more given templates. This template was originally meant to be useful in wikiprojects to produce, say, a list of pages lacking references out of the wikiproject's watchlist.

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

Usage

[edit]

Basic

[edit]

Pages linked from Global templates that have the Template:Update.

Markup Renders as
{{Linked pages with templates
| page = Global templates
| templates = Update
}}
Loading...

Advanced

[edit]

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

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

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

Template data

[edit]

Use this template to list pages linked from a given page and with one or more given templates

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
Templatestemplates

Comma-separated list of templates to search

Example
Update, Under construction
Stringrequired
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]