Template talk:Commons category-inline/Archive 1

Archive 1

Reverted change

I've reverted the merge because according to AWB, this template is used on 378 pages which I wouldn't describe as a few. Merging this template would impact on the layout on each of these pages and there are instances where this is more appropriate. Adambro (talk) 10:15, 13 January 2008 (UTC)

agree. I created this as an equivalent to use like {{commons-inline}}, where the full {{commons}} is impractical. If there one template it can be merged with, it's the otehr inline template, NOT the box template. Circeus (talk) 16:08, 14 January 2008 (UTC)

Click here

Current (226183894)
Proposal 1
Proposal 2
Proposal 3

Currently (226183894), the link to the commons main page and the link to the category look the same. As people most likely look for the first, we could differentiate them as follows:

  1. link Wikimedia Commons instead of Commons:Main Page
  2. bold the link to the category
  3. link Wikimedia Commons instead of Commons:Main Page and bold the link to the category

Personally, I'd go with the first solution. -- User:Docu

Remove period

{{editprotected}}

Remove the period from the non-sentence by finding:

[[Wikimedia Commons]].<noinclude>

Replacing with:

[[Wikimedia Commons]]<noinclude>

Gary King (talk) 06:00, 2 October 2008 (UTC)

  Done. Not a complete sentence, so doesn't need a period. Huntster (t@c) 11:07, 3 October 2008 (UTC)

Accessibility fix

{{editprotected}}

As per WP:ALT #When to specify, images that are purely-decorative should not have links, so that they do not bog down screen readers used by visually impaired readers. Please install this sandbox patch to fix the purely-decorative image generated by this template. Thanks. Eubulides (talk) 07:54, 9 August 2009 (UTC)

Done. Should the alt text itself also be removed? --- RockMFR 23:25, 9 August 2009 (UTC)
It's not necessary. Actually the MediaWiki software turns that caption into both alt text and title text (the latter used for tooltips); maybe somebody likes the title text. It's not a big deal either way. Eubulides (talk) 23:29, 9 August 2009 (UTC)

Update to accessibility fix

{{editprotected}} Since the previous comment, the Mediawiki software has been changed so that it now creates an image with an accessibility problem if you don't also specify "|alt=", so that text should be replaced with "|alt=" now. Please see WP:ALT #Purely decorative images for details. I noted the problem when reviewing the featured article candidate Charles L. McNary for alt text problems. Please install this sandbox patch to fix the problem. Eubulides (talk) 20:13, 13 October 2009 (UTC)

  Done Plastikspork ―Œ(talk) 20:58, 13 October 2009 (UTC)

{{editprotected}}

Bold the link to the target page (the link that takes the reader to the additional media on the article subject).

Currently the link to the target page and the link to Wikimedia Commons are presented equally, which from an information-design point of view "affords" equal access to the two targets, when in all likelihood 90%+ of people want to the see that material related to the article subject rather than learn about Wikimedia Commons or browse it in general. I know I almost clicked on the Wikimedia Commons link by mistake when I came across this template.

(An alternative would be to make the text for "Wikimedia Commons" not be a link at all. In my opinion that link is overlinking and that'd be fine too, instead, and if you want to do that, do that instead (but it'd be slightly more of a major change.)) Herostratus (talk) 18:09, 21 July 2011 (UTC)

  Done --RL0919 (talk) 05:02, 1 August 2011 (UTC)
Although the bold link to the target does make it stand out from the link to Commons, it also makes it look unsighlty compared to other external links. Could we please try the alternative, removing the bolding from the target and taking out the link to "Wikimedia Commons"? Beyond My Ken (talk) 13:49, 1 August 2011 (UTC)
  Done Reaper Eternal (talk) 14:40, 1 August 2011 (UTC)
Thanks, I'll take a look. Beyond My Ken (talk) 16:24, 1 August 2011 (UTC)
Much better, IMO. Beyond My Ken (talk) 20:31, 1 August 2011 (UTC)

Reimplementation

In an effort to standardise the way that sisterlinks are presented inline I've created {{sister-inline}} by analogy to {{sister}}. There's some code in the new sandbox which reimplements this template in that mould. There are a couple of semantic differences:

  • The bullet parameter is gone and the template defaults to no bullet. This is preferable for consistency with other external link templates, though it'll have a minor impact on existing transclusions until they're updated.
  • A new list parameter can be used to pass in a bulleted list of different links if required.

There's a test cases page to play about with. I won't sync for now but plan to in future. Chris Cunningham (user:thumperward) - talk 12:00, 3 October 2011 (UTC)

I've now synced this from the sandbox. As I say, this will have a minor aesthetic impact on existing transclusions which expect a bullet if they are presented in the middle of a bulleted list; however, the gains in overall consistency and maintainability make this a win overall IMO. Chris Cunningham (user:thumperward) - talk 12:10, 26 October 2011 (UTC)

Edit request on 3 May 2012

  • Please add a position parameter so it can be displayed on the right (as {{sister-inline}} does ?)
  • Also, please change it so it only displays the linked text like {{commons-inline}} does – not the external link arrow icon

Thanks.

92.6.211.228 (talk) 20:14, 3 May 2012 (UTC)

I corrected the documentation for {{Sister-inline}}. There is no position parameter even though the documentation said that there was. See {{commons}} which by default displays on the right but can be made to display on the left. Frankly I don't understand why the external link icon is displayed. –droll [chat] 03:17, 6 May 2012 (UTC)
It's because this template used {{sec link auto}} for some additional magic when used on the secure server, but to be honest if secure links require every template to be manually hacked to work properly with them then that's a problem for the secure server people to work out. I've stripped it out. Chris Cunningham (user:thumperward) (talk) 09:37, 9 May 2012 (UTC)
() Thank you, both of you. As a further alternative to {{Sister-inline}}, I figured out this one can be lined up with bullets in an ext links section hackily with &nbsp;&nbsp;{{Commons category-inline|Food}} for anyone who thinks the Commons logo icon and a graphical bullet is overkill. With longer (e.g) titles I don't know why {{commons}} sizes the box differently depending on which side it's used... Anyway, I appreciate the doc and code fixes. --92.6.211.228 (talk) 15:28, 11 May 2012 (UTC)

Use non-sandbox version

This template currently use the sandbox version of {{sister-inline}}, which I consider to be wrong. There is no difference between the sandbox and sister-inline proper . So please replace sister-inline/sandbox with sister-inline. --180.19.218.244 (talk) 23:59, 14 February 2013 (UTC)

Yes, so   Done --Redrose64 (talk) 12:00, 15 February 2013 (UTC)

Categorisation

If the page is an article or category, {{commons category}} puts the page into one of: Category:Commons category without a link on Wikidata; Category:Commons category with page title different than on Wikidata; Category:Commons category with local link different than on Wikidata; Category:Commons category with page title same as on Wikidata; Category:Commons category with local link same as on Wikidata. It also puts the page in Category:Commons category template with no category set when the first positional parameter is absent. Why does {{commons category-inline}} not do any of this? --Redrose64 (talk) 11:55, 28 August 2014 (UTC)

Use wikidata

@MSGJ: Thanks for linking {{Commons category}} to wikidata. It would only be logical if you can do the same for the inline version, like I did in the sandbox. Thanks! -- P 1 9 9   17:39, 6 April 2016 (UTC)

  Done — JJMC89(T·C) 18:20, 6 April 2016 (UTC)
Thank you. -- P 1 9 9   19:59, 6 April 2016 (UTC)

Many instances of this template are now dead because a recent change killed the default. Can someone update this template to use the article's name as the Commons category if there is no entry in the article's corresponding wikidata? czar 22:25, 20 April 2016 (UTC)

That's certainly how it used to work. Perhaps JJMC89 (talk · contribs) broke it with this edit. --Redrose64 (talk) 00:44, 21 April 2016 (UTC)
@Czar and Redrose64:   Fixed I forgot this line when I added the Wikidata functionality. — JJMC89(T·C) 01:33, 21 April 2016 (UTC)
@JJMC89, thanks! Might it be useful to also have this template throw a maintenance category for all the instances where the commons category is yet to be imported into Wikidata? (kind of like {{official website}} in this regard) czar 01:49, 21 April 2016 (UTC)
@Czar: I see that Redrose64 asked about this back in 2014. I've added the same maintenance categories that {{Commons category}} uses. — JJMC89(T·C) 03:24, 21 April 2016 (UTC)
Much obliged!   czar 04:13, 21 April 2016 (UTC)

Italics

Is there any way to have the title automatically italicized when invoked in the template? Does Wikidata store this information somewhere or can we add a parameter flag to the template? czar 15:00, 24 April 2016 (UTC)

@Czar: |2= can be used to italicize the category link (e.g. {{Commons category-inline|dogs|''dogs''}}  Media related to dogs at Wikimedia Commons). A parameter (e.g. |italic title=) could be added to conditionally italicize the category link, or italics could be added like in {{commons category}}. However, the {{sister-inline}} templates should function similarly, and the others don't have the links in italics. Perhaps we should have a central discussion to update the functionality of all of them. — JJMC89(T·C) 21:44, 24 April 2016 (UTC)
Thanks—I knew about |2= but I wanted to know if there was a way to automate it with Wikidata. If there was a flag to set there, any template where it would be relevant would know without someone setting it manually. czar 21:46, 24 April 2016 (UTC)
@Czar: I'm not very familiar with Wikidata, but I don't think there is anything that indicates that it should be in italics. Perhaps d:Property:P31 could be parsed to check if it is a book, film, etc. — JJMC89(T·C) 22:34, 24 April 2016 (UTC)
That's a great idea. I didn't think of that czar 22:36, 24 April 2016 (UTC)

All right, I have a version up in the sandbox. Any feedback? It uses {{is italicized}} to throw italics when P31 = video game, book, film. Feel free to add more types. czar 23:58, 25 April 2016 (UTC)

Some testing:
  1. Grand Theft Auto V: {{Commons category-inline/sandbox}}  Y
  2. Grand Theft Auto V: {{Commons category-inline/sandbox|Dogs}} – was italicized but shouldn't be –   fixed
  3. Grand Theft Auto V: {{Commons category-inline/sandbox|Dogs|cats}} – was italicized but shouldn't be and |2= didn't work – |2=   fixed
  4. Book of Mormon: {{Commons category-inline/sandbox}}  N not italicized but is an instance of book – To fix this {{is italicized}} needs to be able to handle items that have multiple P31.
  5. Anywhere: {{Commons category-inline/sandbox|Grand Theft Auto V}}  N not italicized but should be – In {{#invoke:Wikidata|getValueFromID|{{{1|}}}|P31|FETCH_WIKIDATA}} from {{is italicized}} |1= has to be a QID and not an article title.
Something to consider: should it work like {{Italic title}}, only italicizing the part of the pagename not in parentheses? — JJMC89(T·C) 05:27, 26 April 2016 (UTC)

Italics for scientific names

I have added the following to the template "Template:Commons category-inline/doc" used by this page to show binomials displayed in italics - if suitable please allow this page to display this or something similar:


{{Commons category-inline|Ursus maritimus|''Ursus maritimus''}}

yields:   Media related to Ursus maritimus at Wikimedia Commons — Preceding unsigned comment added by Alandmanson (talkcontribs) 07:25, 5 May 2017 (UTC)

  Not done: please make your requested changes to the template's sandbox first; see WP:TESTCASES. also, please don't update template documentation to imply the presence of a feature which has not been provided. --Redrose64 🌹 (talk) 09:35, 5 May 2017 (UTC)

New version

I've posted a new version of this template that uses the Commons sitelink from Wikidata, and rejigs the tracking categories, to match that implemented in {{Commons category}} and discussed at Template_talk:Commons_category#Please_test_a_new_version_of_this_template. Please let me know if there are any issues - or if need be, revert this edit. I'd suggest keeping the discussion centralised at the other talk page. Thanks. Mike Peel (talk) 23:20, 26 November 2018 (UTC)

Hi Mike Peel... been trying to fix an issue but I'm not super-great with the template coding. This new version is leaving a trailing space in the link. So for example:
  Media related to Felis silvestris catus at Wikimedia Commons has a linked trailing space between "catus" and "at Wikimedia Commons".
Should read: Media related to Felis silvestris catus at Wikimedia Commons
Hoping you can fix it? —Joeyconnick (talk) 19:58, 25 December 2018 (UTC)
Sorry... should add this seems to be an issue when only one parameter is provided. If you explicitly provide link text, the trailing linked space is not included. —Joeyconnick (talk) 20:00, 25 December 2018 (UTC)
@Joeyconnick: I think I've fixed it in the sandbox, compare;
Live:   Media related to Felis silvestris catus at Wikimedia Commons
Sandbox:   Media related to Felis silvestris catus at Wikimedia Commons
Does that look better to you? Thanks. Mike Peel (talk) 20:13, 25 December 2018 (UTC)
Yes, that does it. Weirdly I made similar changes to sandbox but when using the "Preview" function it wasn't showing the same change... (and still isn't with your change now). I guess I should have saved the changes in sandbox and tried them out explicitly... but here I thought I could rely on previewing. sigh But yes, that looks like it's fixed. If you can implement, that would be great! Thanks kindly 😀 —Joeyconnick (talk) 20:18, 25 December 2018 (UTC)
OK, that change is now live - but might take a bit of time to propagate due to caching. Thanks. Mike Peel (talk) 20:22, 25 December 2018 (UTC)
Thanks! I'm already seeing it so that's great. I appreciate your speedy assistance! —Joeyconnick (talk) 20:37, 25 December 2018 (UTC)

Mike Peel, I find this message rather annoying:

Warning: Commons category does not match the Commons sitelink on Wikidata – please check (this message is shown only in preview)

Not wanting to spend potentially two or more hours trying to figure out how to solve this issue I don't even understand, I just removed the offending template, but I was understandably reverted: "This links to a useful category. What's wrong with it?" – well I did explain "what's wrong with it" in my edit summary, but that's a good question nonetheless.

If the template is smart enough to know what the "Commons sitelink on Wikidata" is, then surely you can make it smart enough to link to that, for the convenience of patrollers. Because, as I said, I don't want to spend a couple hours trying to hunt down the "Commons sitelink on Wikidata", whatever that is. – wbm1058 (talk) 16:23, 30 March 2021 (UTC)

@Wbm1058: I think you did the right thing, the correct Commons category is linked to at the bottom of the article, I redid your change. Thanks. Mike Peel (talk) 18:57, 30 March 2021 (UTC)

Template-protected edit request on 16 November 2020

If you look at Template:Commons category you'll see a message: This template is used on approximately 785,000 pages, or roughly 2% of all pages. First is that correct? and second it would be appropriate to have its equivalent on this page, or not? Broichmore (talk) 13:56, 16 November 2020 (UTC)

  DoneJonesey95 (talk) 14:12, 16 November 2020 (UTC)

The text generated by this template begins with a   common icon, which new users could easily mistake for a link to the target category (not realizing that they must click on the text wikilink instead) and, upon clicking the icon, be confused when they land on the icon image page. I've done this myself, both as a new user and as an old dog who is slow to learn new tricks. I realize that clicking on an image will typically take one to the associated image file but, in this case, would it make more sense to link the icon to the target category, so that clicking on the icon would take users to the expected commons category? Lambtron talk 15:16, 1 May 2021 (UTC)

Support – Sounds like a good idea. At minimum, that image should not be linked at all. However, the real work is done by {{Sister-inline}} where this was issue raised in September 2017 and rejected because of attribution concerns. Really? -- Michael Bednarek (talk) 02:39, 2 May 2021 (UTC)

(Mostly) pure Lua version

We can implement this template (including its current tracking categories) in Lua (except for {{Sister-inline}}) This is already supported in Module:Commons link, a well-tested module currently used on 91,000+ pages. The sandbox implements this. You can see from the testcases that everything works, with two minor changes:

  1. An extraneous empty span has been removed from the output
  2. When the template is called with no arguments, and there is no corresponding Wikidata item, the new code does a Commons search with the article title, while the old code takes you to the category with the same name as the article title. If that category exists, then the final behavior is identical between current and new. If the category does not exist, then the current code takes you to a non-existent page, while the new code attempts to find something relevant. I think the new code is more user-friendly.

One advantage of the Lua implementation: Module:Commons link is more conservative about Wikidata items than the current Wikidata matching code in Module:WikidataIB. There are a number of possible items that can be the Commons category corresponding to an en article (e.g., the sitelink, the Commons category property, the sitelink of the wikidata topic category). The current code returns the first non-empty item. The new code checks to see if all of them agree, and, if not, defaults back to search. This makes the template more robust to error or (rare) Wikidata vandalism.

What do editors think? May I turn this on? Any comments or questions? — hike395 (talk) 16:47, 19 May 2021 (UTC)

  Done I copied the sandbox version into the main version. If any editor sees a problem, please ping me here. — hike395 (talk) 01:55, 23 May 2021 (UTC)
@Hike395: What's going on with cases like Arbat Street? It seems to be in Category:Commons category link is defined as the pagename but should be in Category:Commons category link is on Wikidata. Thanks. Mike Peel (talk) 13:48, 23 May 2021 (UTC)
Also a whole load of articles in Category:Commons category link is the pagename that shouldn't be there. Can you fix this quickly or revert please? Thanks. Mike Peel (talk) 13:50, 23 May 2021 (UTC)
@Mike Peel: This is the result of Module:Commons link being more conservative than Module:WikidataIB. For Arbat Street, the sitelink is Commons:Category:Arbat Street. But for Arbat Street (Q269373), the topic's main category is Category:Arbat District (Q6985396) (this is probably wrong). The sitelink for Category:Arbat District (Q6985396) is Commons:Category:Arbat. There's an inconsistency in Wikidata, so Module:Commons link is not returning a Wikidata entity, and so Arbat Street is being put into Category:Commons category link is defined as the pagename.
I think this is working as intended. Inconsistent Wikidata is being placed into Category:Inconsistent wikidata for Commons category. I don't see Arbat Street there yet: it may be a lag in updating. I can certainly fix the wikidata for Arbat Street -- we can collectively spend time cleaning up WD for such entities. I was just doing that today when I got your ping. — hike395 (talk) 14:05, 23 May 2021 (UTC)
@Mike Peel: Wait, hold on. I may have misinterpreted the meaning of Category:Commons category link is defined as the pagename. Let me double-check versus the old code. — hike395 (talk) 14:14, 23 May 2021 (UTC)
I think I see what you mean - for Arbat Street the previous code would go for the first category sitelink found, the new one apparently doesn't? But what about 1865 in literature? That looks like it should be fine, but is in Category:Commons category link is the pagename and your new tracking category. Thanks. Mike Peel (talk) 14:18, 23 May 2021 (UTC)
That's inconsistent too. 1865 in literature (Q1580600) has a Commons category (P373) of Commons:Category:1865 books, but the topic's main category is Category:1865 in literature (Q9401275), whose sitelink and Commons category property are both Commons:Category:1865 in literature.
What I'll do is remove the preview warning when Wikidata returns nothing, and only warn when there is an active mismatch between what the editor provided and what Wikidata returned. If you'd like to change the tracking categories to distinguish between inconsistent Wikidata being silent and actively wrong Wikidata being returned, please let me know. I can implement it in Lua if you want. — hike395 (talk) 14:32, 23 May 2021 (UTC)
@Hike395: Wait, are you using Commons category (P373)? Please just ignore that, it's often wrong, just use the sitelink. This is what the old code did. Thanks. Mike Peel (talk) 14:35, 23 May 2021 (UTC)
@Mike Peel: Ah, now I understand the intent behind your edit from last year. With the more conservative logic, having Module:Commons link look at Commons category (P373) will hardly ever generate a wrong Wikidata link. The worst that usually happens when Commons category (P373) is wrong is that Module:Commons link doesn't return anything (as in 1865 in literature (Q1580600)), and the Commons link turns into a search link. Removing Commons category (P373) from the places to look will hurt those cases where Commons category (P373) is the only source of a commons link. Is getting rid of Commons category (P373) now a good idea, given the increased vigilance of Module:Commons link? — hike395 (talk) 14:55, 23 May 2021 (UTC)
I went back and looked at some test cases (User:Hike395/Commons_link_stats2 and User:Hike395/Commons_link_stats3) and it appears that Commons category (P373) doesn't provide any significant benefit. I will remove it from the search chain. — hike395 (talk) 15:04, 23 May 2021 (UTC)
@Mike Peel: After poking around, now I'm back to not being sure removing P373 is correct. Take a look at Boeing 737 MAX (Q139289). The sitelink is Commons:Boeing 737 MAX, Commons category (P373) is Commons:Category:Boeing 737 MAX, Commons gallery (P935) is Commons:Boeing 737 MAX, and there is no topic's main category (P910). If I remove Commons category (P373), then no category gets returned. This is a relatively rare case, but I worry about making it impossible to get wikidata for an item. Commons category (P373) still serves a purpose here. — hike395 (talk) 15:18, 23 May 2021 (UTC)
@Hike395: I come along those cases so often I have a helper script to fix them on Wikidata [1]. I've just fixed this example. I also have a script that goes through the tracking category looking for such cases. Either the link is locally defined here, or it ends up in Category:Commons category link is the pagename and I spot it reasonably quickly. We don't need a *third* copy of the link to check. Thanks. Mike Peel (talk) 16:53, 23 May 2021 (UTC)
@Hike395: Then, sorting these out on Wikidata results in edit wars with an editor. [2] if you can help? Thanks. Mike Peel (talk) 07:16, 28 May 2021 (UTC)

Updating tracking categories

I have an idea that will both clean up categories like Category:Commons category link is defined as the pagename and resolve the Commons category (P373) to Mike's satisfaction:

  1. Whenever Module:Commons link fails to find a Wikidata item (due to inconsistency), regardless of whether args[1] is empty, then put the article into the existing Category:Inconsistent wikidata for Commons category.
  2. Stop placing items into Category:Commons category link is the pagename (because it overlaps with Category:Inconsistent wikidata for Commons category).
  3. Remove Commons category (P373) from considering as a Commons category link.

If we separate out inconsistent wikidata items into their own category, no matter how we decide to treat Commons category (P373), an editor can go and clean it up. Because of this, I'm willing to defer to Mike and remove P373. This will also clean up the other tracking categories.

What do other editors think? I'll work on this in Module:Commons link/sandbox. — hike395 (talk) 16:01, 23 May 2021 (UTC)

Sandbox is ready to go. I'll wait to go live and see if Mike or anyone else has comments. — hike395 (talk) 16:36, 23 May 2021 (UTC)
@Hike395: #2 - that category catches cases where there is no locally defined category, and nothing on Wikidata. It's worth keeping. #3 is definitely a good way forward. #1 could end up with a *lot* of articles in it. Thanks. Mike Peel (talk) 16:47, 23 May 2021 (UTC)
Sounds like we've settled on the following:
  1. Whenever Module:Commons link detects a Wikidata inconsistency, place the article into Category:Inconsistent wikidata for Commons category. I think this will be less than 1,000 articles (depending on how much noise P373 added).
  2. Whenever the module doesn't find anything in Wikidata at all, and no default is given, place article into Category:Commons category link is the pagename. This is the current behavior.
  3. Remove Commons category (P373) from being considered as a Commons link. This was the previous behavior of the template.
I've got it all tested in the sandbox. I'll promote it to the live template. — hike395 (talk) 02:58, 24 May 2021 (UTC)

{{Wikisourcecat inline}}

FYI Template:Wikisourcecat inline (edit | talk | history | links | watch | logs) has been nominated for deletion. It appears to also be a commons category inline link template -- 65.92.246.142 (talk) 05:21, 12 March 2022 (UTC)