Template talk:Commons category

From Wikipedia, the free encyclopedia
Jump to: navigation, search
See also Wikipedia:Sister projects


I think the colon should go. In prose writing, a colon separating (in this case) "related to" and the object is not accepted. Drmies (talk) 21:02, 23 January 2012 (UTC)

You got that right! Rich Farmbrough, 02:05, 7 May 2012 (UTC).(Using some automation)
It's a job for {{Commons}} though. Rich Farmbrough, 14:31, 7 May 2012 (UTC).(Using some automation)
Change has finally been made over there. — Martin (MSGJ · talk) 14:04, 27 September 2013 (UTC)

Nominated for deletion[edit]

Wikipedia:Templates_for_discussion/Log/2012_March_16#Link_templates_for_other_Wikimedia_projects. ASCIIn2Bme (talk) 14:49, 16 March 2012 (UTC)

Cat for empty parameter 1[edit]

I propose to track uses of this template that don't have an explicit Commons category set. The purpose is to prevent page moves from changing a valid use to an invalid use, by filling in the parameter 1. Code is in the sandbox. You can try it in the newly created testcases page. Rich Farmbrough, 01:47, 7 May 2012 (UTC).(Using some automation)

Should we be doing the same to {{Commons category-inline}}? Keith D (talk) 19:48, 24 May 2012 (UTC)

Wrong edit[edit]

Maybe this made it wrong? Newone (talk) 16:52, 31 July 2012 (UTC)

What is wrong? Keith D (talk) 23:58, 11 August 2012 (UTC)

Reverted the doc on "use colon"[edit]

I reverted the doc which claimed "use colon to put this template all by itself". Simply you can stash it in the last section, regardless of the presence of the "external links" section, as written in WP:SIS#Where to place links. Or, you can use {{commons-inline}} like:

--Ahora (talk) 07:41, 1 January 2013 (UTC)

Why italics?[edit]

Why is the category rendered in italics? (I think this occurs in {{Commons}}.) {{Commons-inline}}, IMO correctly, doesn't do that. -- Michael Bednarek (talk) 10:23, 19 March 2013 (UTC)

Edit request on 24 April 2013: Check Wikidata errors[edit]

Update: See new comments below. Legoktm (talk) 18:01, 25 April 2013 (UTC)

I'd like to add a snippet of code that would check for errors in the data stored on Wikidata. This won't change the page text in anyway, besides adding a tracking category. This would have the benefit of correcting errors that are present on Wikidata as well as errors that may exist here on the English Wikipedia. Wikidata data was imported from multiple wikis, so by identifying these errors, we can potentially correct them on multiple wikis extremely easily.

{{#if: {{#property:P373}} | {{#ifeq: {{#property:P373}} | {{#if:x| {{{1| {{PAGENAME}} }}} }} | | [[Category:Articles where the Commons category differs from Wikidata]] }}

I haven't created this category yet, so if the accepting admin could create it and add {{hiddencat}} to it. Legoktm (talk) 09:58, 24 April 2013 (UTC)

I'm test driving this on the Dutch Wikipedia. It's a bit more extensive. It adds 5 possible categories:
  1. Local link same as link on Wikidata (1 is set). Good! At some point in the future we want to remove the local contents (move to 3)
  2. Local link different as link on Wikidata (1 is set). Need fix!
  3. Local page title same as link on Wikidata (1 is not set). Good! All done
  4. Local page title different as link on Wikidata (1 is not set). Need fix!
  5. No link on Wikidata, we need to import something
You might want to wait a bit until we got all the bugs out of it and just copy that code. Multichill (talk) 20:07, 24 April 2013 (UTC)
Wow great. Sounds like a good idea :) Legoktm (talk) 02:26, 25 April 2013 (UTC)
Very nice idea, I like it! -- Duesentrieb-formerly-Gearloose (?!) 12:24, 25 April 2013 (UTC)
This is very cool. Once you folks work it out I’ll copy it to the French language Wikipedia as well. :-) Jean-Fred (talk) 16:14, 25 April 2013 (UTC)
Ok, modified it a bit to only work in article and category namespace. Should be in a includeonly section:
<!-- Some tracking categories to see if we're ready to switch to Wikidata -->
{{#switch:{{NAMESPACE}}||{{ns:14}}=<!-- Only articles and categories. -->
 | {{#if:{{{1|}}}
  | {{#ifeq:{{#property:P373}}|{{{1|}}}
   | [[Category:Commons category with local link same as on Wikidata]] <!-- We want to end up here -->
   | [[Category:Commons category with local link different than on Wikidata]] <!-- Figure out the best link -->
  | {{#ifeq:{{#property:P373}}|{{PAGENAME}}
   | [[Category:Commons category with page title same as on Wikidata]] <!-- Ending up here is just fine -->
   | [[Category:Commons category with page title different than on Wikidata]] <!-- Figure out the best link here too -->
 | [[Category:Commons category without a link on Wikidata]] <!-- These we still need to import -->
Feel free to improve the naming of the categories. What do you think? Is it ready?
A note, a small number of pages will end up in the wrong category, see Bugzilla: 47619. Multichill (talk) 17:53, 25 April 2013 (UTC)
Wow, great. I've re-enabled the editprotected template and will create those categories shortly. Legoktm (talk) 18:01, 25 April 2013 (UTC)
Yes check.svg Done James F. (talk) 18:15, 25 April 2013 (UTC)
Woo thanks! Category:Commons category Wikidata tracking categories is slowly being populated :) Legoktm (talk) 18:47, 25 April 2013 (UTC)

I think it may be a good idea to extract this code to some generic template as similar stuff might need to be done in a number of other templates. --DixonD (talk) 19:41, 25 April 2013 (UTC)

Yes, of course, but let's take it one step at a time and see what happens. We'll probably have some nice lessons learned before we mass enable something. Multichill (talk) 20:15, 25 April 2013 (UTC)

Category:Ben & Jerry's matches with "Ben &#38; Jerry&#39;s" so most titles with ampersands and apostrophes are listed as different than on Wikidata as false positives. --Vriullop (talk) 10:13, 30 April 2013 (UTC)

See my earlier remark and Bugzilla: 47619. Multichill (talk) 11:13, 30 April 2013 (UTC)
It's the same problem as {{PAGENAME}} that encodes some characters. I've made a simple conversion at ca:Module:Encode according with mw:Manual:PAGENAMEE encoding and it matches correctly changing to #ifeq:{{#property:P373}} | {{#invoke:encode | pagename | {{{1|}}} }}. --Vriullop (talk) 12:36, 30 April 2013 (UTC)
This is really great. – SJ + 15:51, 18 May 2013 (UTC)

Why is the category being added every time someone uses Visual Editor (e.g. [1]) and is it really necessary? DrKiernan (talk) 14:31, 24 July 2013 (UTC)

The category should not be added directly to articles in this way as it is a tracking category added via the template. May be it is a problem with the visual editor that should be reported at WP:VEF. Keith D (talk) 18:36, 24 July 2013 (UTC)

Edit request on 28 September 2013, pagename encode[edit]

Please, update from sandbox. Parameter is encoded as a pagename via Lua avoiding false possitives in Category:Commons category with local link different than on Wikidata. See Wikipedia:Lua requests/Archive 3#Pagename and three special characters. Vriullop (talk) 08:51, 28 September 2013 (UTC)

Yes check.svg Done, sorry for the delay — Martin (MSGJ · talk) 11:56, 2 October 2013 (UTC)

Syntax error[edit]

If you add {{commonscat}} with no additional parameters, then the link goes to [[Commons:Category:{{PAGENAME}}]]. The link should go to [[Commons:Category:{{#property:P373}}]] instead. The error is here:

|Category:{{#if:x| {{{1| {{PAGENAME}} }}} }}<!--

These lines should probably be

|Category:{{#if:x| {{{1| {{#property:P373| {{PAGENAME}} }} }}} }}<!--

or similar instead.

Example: The article Free Art License has {{commonscat}} without additional parameters. d:Q152332 tells that the Commons category is Commons:Category:FAL, but the template links to Commons:Category:Free Art License instead. --Stefan2 (talk) 19:43, 6 October 2013 (UTC)

Comment - as far as I know there is no agreement to use wikidata entries in this way. Can you can point to some agreement on this? The entry can be corrected by piping to the correct page in the article. Keith D (talk) 21:01, 6 October 2013 (UTC)
Not done: please establish a consensus for this alteration before using the {{edit protected}} template. --Redrose64 (talk) 21:07, 6 October 2013 (UTC)
Calling this a "Syntax error" is a bit weird, this might be the next step, but that needs to be discussed first. I rather keep it like this for now and do things step by step. Multichill (talk) 21:40, 6 October 2013 (UTC)
People have been removing category names from the {{commonscat}} template, so I assumed that consensus had been established, but that the template contained a typo. See for example the article Free Art Licence which now points at the wrong category because a user removed parameter {{{1}}}. --Stefan2 (talk) 21:46, 6 October 2013 (UTC)
People shouldn't be removing the parameter, unless they are replacing it with a better parameter. Every page using {{commons category}} is placed into one of the five subcats of Category:Commons category Wikidata tracking categories; those without the parameter are also placed into Category:Commons category template with no category set. The aim is to depopulate the latter and certain subcats of the former - possibly as many as four of the five, the exception being Category:Commons category with local link same as on Wikidata‎. --Redrose64 (talk) 21:56, 6 October 2013 (UTC)
I thought that's exactly Wikidata's purpose; the template {{Authority control}} uses it that way. Stefan2's proposal should be implemented. -- Michael Bednarek (talk) 09:40, 7 October 2013 (UTC)
Based on the comments above, I got the impression that the template isn't ready for this yet. If someone currently uses {{commonscat}} without parameters, but Wikidata lists the category name as different to the {{PAGENAME}}, then Wikipedia and Wikidata disagree about the name of the Commons category. It may be necessary to check and correct these template calls first. --Stefan2 (talk) 09:54, 7 October 2013 (UTC)

Placement in "See also" section[edit]

In nearly all articles I've worked on, the template is placed in the "references" section (usually the last section on the page in articles without an "external links" section).
As soon as references are displayed in columns, though, the template placement becomes a problem, as it is then in one of the phohibited placements that shows up as an additional column by itself. And in articles with a multitude of references, columns display better.
It works and looks better in the second-to-last section, always the "See also" section. Here it not only displays perfectly and fills up some white space in the process, but it's also right on topic as a "see also" item. See South African Class 6E1, Series 10 for a trial run example.
Would there be any WP:MOS objections to making this standard practice? André Kritzinger (talk) 11:28, 19 November 2013 (UTC)

See "Links to sister projects" in MOS:LAYOUT. Keith D (talk) 12:46, 19 November 2013 (UTC)
Just came across that too. Thanks! André Kritzinger (talk) 13:12, 19 November 2013 (UTC)
I think that this template's doc page and WP:ELLAYOUT already cover all of the problems described by Andre Kritzinger - is there anything missing from those? --Redrose64 (talk) 15:23, 19 November 2013 (UTC)
Asked too quickly - found the answer, thanks. André Kritzinger (talk) 16:07, 19 November 2013 (UTC)

Tag with bad wikilink[edit]

Almost the first thing on the Template page is a flag (bar? label? banner?) that says

Wikimedia Commons has media related to Commons category.

(I think the link is an internal wikilink ([[...]]), but I'm using an external link ([...]) here, with the URL as it comes out in the rendered page, namely



It yields the wikiversion of 404, "This page does not currently exist." --Thnidu (talk) 05:24, 18 May 2014 (UTC)

When the template is used on an article, it derives that link either from the first supplied parameter, or if there isn't one, from {{PAGENAME}}. Since {{PAGENAME}} at Template:Commons category is Commons category, it constructs the link accordingly. Part of this is done in {{commons}}, which uses the internal link syntax, so you get [[commons:Category:{{PAGENAME}}]]commons:Category:Commons category. But if used without parameters on an article like Paris, you get commons:Category:Paris --Redrose64 (talk) 11:24, 18 May 2014 (UTC)
Thanks, Redrose64, but can it be fixed? I still don't understand it. Can you or someone else make it work right? --Thnidu (talk) 08:37, 19 May 2014 (UTC)
Please give an example of a page where it is broken. --Redrose64 (talk) 08:46, 19 May 2014 (UTC)
@Redrose64: Right here, on the page we're Talking about. This page where we're talking is a Template talk page. I said "Almost the first thing on the Template page…" So:
  1. Go to Template:Commons category.
  2. At the top of that page, on the right, is a box with the text "Wikimedia Commons has media related to Commons category."
  3. The last two words, "Commons category", are highlighted as a link. Click on them.
  4. You'll be sent to a page with the wikiversion of 404: "This page does not currently exist."
--Thnidu (talk) 05:53, 20 May 2014 (UTC)
That's just the template page. I meant an actual article where the link isn't working as it should. --Redrose64 (talk) 11:26, 20 May 2014 (UTC)
I am so sorry for wasting your time, and I feel so dumb. I was focusing on the first header below the page title, "Template documentation", and I didn't recognize that that link-box is (the rendering of) the template. I was interpreting it as applying to the page. And you were making it clear already ("When the template is used on an article"). I wish we could just forget the whole thing. --Thnidu (talk) 22:34, 20 May 2014 (UTC)