Template_talk:Commons-inline

Template talk:Commons-inline

Template talk:Commons-inline


Documentation

Usage

{{Commons-inline|Wikisource work}}

This template creates an inline link to the Wikicommons in list format.

Examples

Normal

{{Commons-inline|Work}}

Media related to Work at Wikimedia Commons

Text override

{{Commons-inline|Work|Puffle}}

Media related to Puffle at Wikimedia Commons

{{Commons-inline|links=[[commons:Foo|]] and [[commons:Bar|]]}}

Media related to Foo and Bar at Wikimedia Commons

List format

{{Commons-inline|list=
** [[commons:Foo|]]
** [[commons:Bar|]]
}}

Related media at Wikimedia Commons:

Improving the "no parameter" case

Right now, when this template is called with no parameters, it defaults to using the title of the page as a search at Commons. The old behavior of search at Commons would take the reader directly to a gallery or category if the search string matched the name. However, in the last year or so, the search has become more conservative, and our readers are taken to a crowded and possibly confusing search results page.

Instead, I propose that we use Wikidata to restore the old behavior for no parameters, when possible. The code in the sandbox does this. When there are no parameters, it calls Module:Commons link to first look for a Commons gallery associated with the article. If no such gallery is found, it looks for Commons category associated with the article. If neither is found, then it defaults back to the current behavior of searching Commons with the article title.

A few things to note about Module:Commons link:

  • It has been used at {{commons and category}} and {{commons and category-inline}} for a month now, with no complaints or negative feedback.
  • There are multiple entries in Wikidata that represent associated Commons galleries or categories. Module:Commons link checks all of them, and only uses them if they all agree. Otherwise, it defaults back to the current search behavior. This will protect against vandalism and false positives. If there is any inconsistency, the Lua code places the article in one of two tracking categories: 1 or 2, so we can fix it.

Note that this change only affects the "no parameter" case (see test cases). All other behaviors remain the same:

  • If a single parameter is provided, the link is directly to that page in Commons
  • The second parameter is still used as linktext.
  • The named arguments still work as before: |short=, |list=, |links=, |extratext=.

Any questions or comments before I turn this on? — hike395 (talk) 06:45, 16 March 2020 (UTC)

| short =

What's that? --Palosirkka (talk) 10:09, 21 June 2022 (UTC)


Share this article:

This article uses material from the Wikipedia article Template_talk:Commons-inline, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.