Jump to content

Template:Sister project links/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
→‎See also: remove userfied template
m →‎Usage{{anchor|Parameters}}: <syntaxhighlight lang="wikitext">
 
(6 intermediate revisions by 4 users not shown)
Line 19: Line 19:


==Usage{{anchor|Parameters}}==
==Usage{{anchor|Parameters}}==
{{Sister project links
{{Sister project links
|1= |display= |auto= |collapsible= |position= |style=
|1= |display= |auto= |collapsible= |position= |style=
|wikt= |c= |n= |q= |s= |b= |v=
|wikt= |c= |n= |q= |s= |b= |v=
|voy=yes |species=yes |species_author=John |iw=en |d=yes |m=yes |mw=yes
|voy=yes |species=yes |species_author=John |iw=en |d=yes |m=yes |mw=yes |f=yes
|commonscat= |author= |cookbook=
|commonscat= |author= |cookbook=
}}
}}
<syntaxhighlight lang="wikitext">
<pre style="overflow:auto;">
{{Sister project links
{{Sister project links
<!-- Configuration parameters. -->
<!-- Configuration parameters. -->
|1= |display= |auto= |collapsible= |position= |style=
|1= |display= |auto= |collapsible= |position= |style=


<!-- Note: The order of the projects is as they appear in the navbox. -->
<!-- Note: The order of the projects is as they appear in the navbox. -->
Line 35: Line 35:


<!-- Second part: Projects that default to "no" when auto=no -->
<!-- Second part: Projects that default to "no" when auto=no -->
|voy= |species= |species_author= |iw= |d= |m= |mw=
|voy= |species= |species_author= |iw= |d= |m= |mw= |f=


<!-- The following parameters specifying search options for pages above. -->
<!-- The following parameters specifying search options for pages above. -->
Line 42: Line 42:
|cookbook= <!-- (relevant for b) force link to cookbook at wikibooks -->
|cookbook= <!-- (relevant for b) force link to cookbook at wikibooks -->
}}
}}
</syntaxhighlight>
</pre>
'''Example with all parameters and all projects displayed (see right):'''
'''Example with all parameters and all projects displayed (see right):'''
<syntaxhighlight lang="wikitext">
<pre style="overflow:auto;">
{{Sister project links
{{Sister project links
|1= |display= |auto= |collapsible= |position= |style=
|1= |display= |auto= |collapsible= |position= |style=
|wikt= |c= |n= |q= |s= |b= |v=
|wikt= |c= |n= |q= |s= |b= |v=
|voy=yes |species=yes |species_author=John |iw=en |d=yes |m=yes |mw=yes
|voy=yes |species=yes |species_author=John |iw=en |d=yes |m=yes |mw=yes |f=yes
|commonscat= |author= |cookbook=
|commonscat= |author= |cookbook=
}}
}}
</syntaxhighlight>
</pre>


===Default display===
===Default display===
For any project parameter, there are four acceptable values:
For any project parameter, there are four acceptable values:
* '''"yes"''' means find a reasonable link for the sister project (wikidata, or default back to search)
* '''"yes"''' means find a reasonable link for the sister project (Wikidata, or default back to search)
* '''"no"''' means exclude this sister project: no link
* '''"no"''' means exclude this sister project: no link
* '''a string''' means link to the page with whose title is that string
* '''a string''' means link to the page with whose title is that string
* '''blank or missing''' means use the default
* '''blank or missing''' means use the default
** If {{para|auto|yes}}, default is either use wikidata (if present), or drop the link
** If {{para|auto|yes}}, default is either use Wikidata (if present), or drop the link
** If {{para|auto|no}}, if project is in the "yes" list above, either use wikidata or search. Otherwise drop the link.
** If {{para|auto|no}}, if project is in the "yes" list above, either use Wikidata or search. Otherwise drop the link.


===Location===
===Location===
Line 73: Line 73:
** See [[Wikipedia:Wikimedia sister projects#Where to place links]] for more information and alternatives.
** See [[Wikipedia:Wikimedia sister projects#Where to place links]] for more information and alternatives.
* In [[WP:DAB|disambiguation pages]], this template should be listed above other text, but below any cleanup templates, images, infoboxes or navboxes.<!-- Per WP:ACCESS, cleanup templates, images, infoboxes, and navboxes are always first. -->
* In [[WP:DAB|disambiguation pages]], this template should be listed above other text, but below any cleanup templates, images, infoboxes or navboxes.<!-- Per WP:ACCESS, cleanup templates, images, infoboxes, and navboxes are always first. -->

===Interwiki link===
The {{para|iw}} parameter is for use in articles about languages themselves. It is designed to be used instead of the {{tl|InterWiki}} template: it links to the Main Page of Wikipedia that corresponds to the language code. See [[Template:InterWiki/doc]] for more information. Up to three sister Wikipedias can be linked, using {{para|iw}}, {{para|iw1}}, and {{para|iw2}}.


==TemplateData==
==TemplateData==
Line 84: Line 87:
"type": "string",
"type": "string",
"required": false,
"required": false,
"description": "Use if the ''search term'' differs from the pagename.",
"description": "Use if the ''search term'' differs from the pagename. E.g. to change the capitalization for Wiktionary links",
"default": "{{PAGENAME}}"
"default": "{{PAGENAME}}"
},
},
"auto": {
"auto": {
Line 92: Line 95:
"required": false,
"required": false,
"description": "If auto=\"yes\", then sister projects with wikidata sitelinks are filled-in, others are off by default. Each project can be overridden with its own parameter.",
"description": "If auto=\"yes\", then sister projects with wikidata sitelinks are filled-in, others are off by default. Each project can be overridden with its own parameter.",
"default": "No"
"default": "No"
},
},
"collapsible": {
"collapsible": {
Line 98: Line 101:
"description": "Set to \"yes\" to make the template collapsible. Set to \"collapsed\" to make the template collapsible and initially collapsed.",
"description": "Set to \"yes\" to make the template collapsible. Set to \"collapsed\" to make the template collapsible and initially collapsed.",
"type": "string",
"type": "string",
"default": "No"
"default": "No"
},
},
"display": {
"display": {
Line 105: Line 108:
"required": false,
"required": false,
"description": "Use if the ''display name'' is different from the search term. For example, the bear article would be 'Bears'.",
"description": "Use if the ''display name'' is different from the search term. For example, the bear article would be 'Bears'.",
"default": "{{PAGENAME}}"
"default": "{{PAGENAME}}"
},
},
"author": {
"author": {
Line 227: Line 230:
"required": false,
"required": false,
"description": "MediaWiki link to show. Acceptable values are a page name, \"yes\" and \"no\".",
"description": "MediaWiki link to show. Acceptable values are a page name, \"yes\" and \"no\".",
"default": "No"
},
"f": {
"label": "Wikifunctions link",
"type": "string",
"required": false,
"description": "Wikifunctions link to show. Acceptable values are a page name, \"yes\" and \"no\".",
"default": "No"
"default": "No"
},
},
Line 233: Line 243:
"description": "Specifies whether the box floats to the left or right. The only acceptable value is \"left\" which causes the box to float to the left. Any other value (not specifying this parameter) activates the default. (Float to the right.)",
"description": "Specifies whether the box floats to the left or right. The only acceptable value is \"left\" which causes the box to float to the left. Any other value (not specifying this parameter) activates the default. (Float to the right.)",
"type": "string",
"type": "string",
"default": "right"
"default": "right"
},
},
"style": {
"style": {
Line 258: Line 268:
"cookbook",
"cookbook",
"v",
"v",
"voy",
"voy",
"species",
"species",
"species_author",
"species_author",
"iw",
"iw",
"d",
"d",
"m",
"m",
"mw"
"mw",
"f"
]
]
}
}
Line 284: Line 295:
:[[File:Wikimedia Community Logo.svg|27x27px|link=|alt=]] [[:File:Wikimedia Community Logo.svg|Meta-Wiki logo]] <code>m</code><br/>
:[[File:Wikimedia Community Logo.svg|27x27px|link=|alt=]] [[:File:Wikimedia Community Logo.svg|Meta-Wiki logo]] <code>m</code><br/>
:[[File:MediaWiki-2020-icon.svg|27x27px|link=|alt=]] [[:File:MediaWiki-2020-icon.svg|MediaWiki logo]] <code>mw</code>
:[[File:MediaWiki-2020-icon.svg|27x27px|link=|alt=]] [[:File:MediaWiki-2020-icon.svg|MediaWiki logo]] <code>mw</code>
:[[File:Wikifunctions-logo-en.svg|27x27px|link=|alt=]] [[:File:Wikifunctions-logo-en.svg|Wikifunctions logo]] <code>f</code>


==Tracking categories==
==Tracking categories==
Line 303: Line 315:
<includeonly>{{sandbox other||
<includeonly>{{sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:Interwiki link templates| ]]
[[Category:Interwiki link sidebar templates| ]]

}}</includeonly>
}}</includeonly>

Latest revision as of 12:26, 26 December 2023

The {{Sister project links}} template provides one box with links to corresponding pages on various Wikimedia sister projects. The following pages are sought, in order:

  • An explicit page chosen by an editor (if provided)
  • A sitelink in Wikidata (if exists)
  • A search page on the sister project

Sending a reader to a search page can be an unpleasant experience, if there is no corresponding page for that subject. Editors have a choice between two methods to prevent this negative experience:

  • Manually check each project for a relevant page, if missing, then set argument to "no" (e.g., |wikt=n)
  • Use "automatic mode", which only displays a sister project by default if sitelink exists (e.g., |auto=yes)

Note that {{Sister project auto}} is equivalent to {{Sister project links|auto=yes}}.

Usage[edit]

{{Sister project links
<!-- Configuration parameters. -->
 |1= |display= |auto= |collapsible= |position= |style=

<!-- Note: The order of the projects is as they appear in the navbox. -->
<!-- First part: Projects that default to "yes" when auto=no -->
 |wikt= |c= |n= |q= |s= |b= |v=

<!-- Second part: Projects that default to "no" when auto=no -->
 |voy= |species= |species_author= |iw= |d= |m= |mw= |f=

<!-- The following parameters specifying search options for pages above. -->
 |commonscat= <!-- (relevant for c) force link to commons category -->
 |author= <!-- (relevant for s) force search for author name in wikisource -->
 |cookbook= <!-- (relevant for b) force link to cookbook at wikibooks -->
}}

Example with all parameters and all projects displayed (see right):

{{Sister project links
 |1= |display= |auto= |collapsible= |position= |style=
 |wikt= |c= |n= |q= |s= |b= |v=
 |voy=yes |species=yes |species_author=John |iw=en |d=yes |m=yes |mw=yes |f=yes
 |commonscat= |author= |cookbook=
}}

Default display[edit]

For any project parameter, there are four acceptable values:

  • "yes" means find a reasonable link for the sister project (Wikidata, or default back to search)
  • "no" means exclude this sister project: no link
  • a string means link to the page with whose title is that string
  • blank or missing means use the default
    • If |auto=yes, default is either use Wikidata (if present), or drop the link
    • If |auto=no, if project is in the "yes" list above, either use Wikidata or search. Otherwise drop the link.

Location[edit]

If using a large, graphical template produces odd layout problems, like the excessive white space shown on the right of this screenshot, then switch to a different sister template.

Generally:

☒N Do not place this template in a section all by itself.
☒N Do not place this template in a section containing columns.

Specifically:

Interwiki link[edit]

The |iw= parameter is for use in articles about languages themselves. It is designed to be used instead of the {{InterWiki}} template: it links to the Main Page of Wikipedia that corresponds to the language code. See Template:InterWiki/doc for more information. Up to three sister Wikipedias can be linked, using |iw=, |iw1=, and |iw2=.

TemplateData[edit]

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Sister project links in articles based on its TemplateData.

TemplateData for Sister project links

Displays a terminal window with a set of commands. If the titles in the individual sister projects differ, use the following parameters, which are taken from [[Help:Interwiki linking]]. The value "Yes" means that the page will be found automatically.

Template parameters

ParameterDescriptionTypeStatus
Search term1

Use if the ''search term'' differs from the pagename. E.g. to change the capitalization for Wiktionary links

Default
{{PAGENAME}}
Stringoptional
Display namedisplay

Use if the ''display name'' is different from the search term. For example, the bear article would be 'Bears'.

Default
{{PAGENAME}}
Stringoptional
Use wikidata to fill defaultsauto

If auto="yes", then sister projects with wikidata sitelinks are filled-in, others are off by default. Each project can be overridden with its own parameter.

Default
No
Stringoptional
Collapsible?collapsible

Set to "yes" to make the template collapsible. Set to "collapsed" to make the template collapsible and initially collapsed.

Default
No
Stringoptional
Positionposition

Specifies whether the box floats to the left or right. The only acceptable value is "left" which causes the box to float to the left. Any other value (not specifying this parameter) activates the default. (Float to the right.)

Default
right
Stringoptional
CSS stylestyle

Optional CSS style specifications. Use with caution. (And don't use for evil!)

Stringoptional
Wiktionary linkwikt

Wiktionary link to show. Acceptable values are a page name, "yes", and "no".

Default
Yes
Stringoptional
Commons linkc commons

Commons link to show. Acceptable values are a page name, "yes" and "no".

Default
Yes
Stringoptional
Commons category?commonscat

Specifies whether a link to a category on Wikimedia Commons is shown. Can be "yes" or "no".

Default
No
Stringoptional
Wikinews linkn

Wikinews link to show. Acceptable values are a page name, "yes" and "no".

Default
Yes
Stringoptional
Wikiquote linkq

Wikiquote link to show. Acceptable values are a page name, "yes" and "no".

Default
Yes
Stringoptional
Wikisource links

Wikisource link to show. Acceptable values are a page name, "yes" and "no".

Default
Yes
Stringoptional
Wikisource author?author

Use for articles about authors to force the Wikisource links to include the "Author:" prefix. Can be set to "yes" or "no".

Default
No
Stringoptional
Wikibooks linkb

Wikibooks link to show. Acceptable values are a page name, "yes" and "no".

Default
Yes
Stringoptional
Cookbookcookbook

If yes, link to Cookbook at wikibooks. If string, use that string as article title in Cookbooks.

Default
No
Stringoptional
Wikiversity linkv

Wikiversity link to show. Acceptable values are a page name, "yes", and "no".

Default
Yes
Stringoptional
Wikivoyage linkvoy

Wikivoyage link to show. Acceptable values are a page name, "yes" and "no".

Default
No
Stringoptional
Wikispecies taxon linkspecies

Wikispecies link to show. Acceptable values are a page name, "yes" and "no".

Default
No
Stringoptional
Wikispecies author linkspecies_author

Wikispecies author link to show. Acceptable values are a page name, "yes" and "no". Even if "yes" it will be only displayed when species ≠ "yes"

Default
No
Stringoptional
Interwiki linkiw

Link to other language edition. Acceptable values are a Wikipedia language code (e.g., "de"), "yes" and "no".

Default
No
Stringoptional
Wikidata linkd

Wikidata link to show. Acceptable values are a QID, "yes" and "no".

Default
No
Stringoptional
Meta linkm

Meta link to show. Acceptable values are a page name, "yes" and "no".

Default
No
Stringoptional
MediaWiki linkmw

MediaWiki link to show. Acceptable values are a page name, "yes" and "no".

Default
No
Stringoptional
Wikifunctions linkf

Wikifunctions link to show. Acceptable values are a page name, "yes" and "no".

Default
No
Stringoptional

Images used[edit]

This template potentially displays the following images:

Wiktionary logo wikt
Wikimedia Commons logo c or commons
Wikinews logo n
Wikiquote logo q
Wikisource logo s
Wikibooks logo b
Wikivoyage logo voy
Wikiversity logo v
Wikispecies logo species or species_author
Wikipedia logo iw
Wikidata logo d
Meta-Wiki logo m
MediaWiki logo mw
Wikifunctions logo f

Tracking categories[edit]

See also[edit]