跳转到内容

Template:Sisters

维基新闻,自由的新闻源
文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

This template creates a single-column bulleted list of links to pages on sister projects. Each link appears as an icon identifying the sister project, followed by the title of the page. Up to six links can be created.

Usage

[编辑]

By default, each parameter to the template is a page title, and the sister links are to Wikipedia. To change this default, add a parameter naming another sister project; the full name of the sister project can be spelled out (with any capitalization), or the usual abbreviations can be used:

b   commons   d   m   q   s   species   v   voy   w   wikt   wmf

Following a parameter naming a sister project, all links will be to the named sister until another sister-project name is given.

The parameter immediately after a sister name will always be interpreted as a page name (it isn't checked to see if it's a sister name); so in this way it's possible to link to a page whose name is the name of a sister project. For example, {{Sisters|Wiktionary|w}} generates

while {{Sisters|w|wiktionary}} generates

Extending the template

[编辑]

To add additional sister project names, add cases to the #switch statements in Template:Sisters/parse and Template:Sisters/link. Remember to add the additional names to this documentation.

To increase the maximum number of links listed, first create an additional sub-template for each additional number of links you want to support (following the directions at Template:Sisters/1), and then change the code in this template to call the sub-template for the new maximum number of links. Remember to update the maximum number of links in this documentation.

See also

[编辑]