Template talk:Credit line

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Licence field required?[edit]

This is great, thanks for doing it. I especially like how you automatically add a link when the "other" field is "Commons" or "Wikimedia Commons". I do wonder, though: should the licence field really be compulsory? For example, I'm not sure what the value of that field whould be for files tagged with {{Attribution}}. Pruneautalk 18:17, 11 September 2009 (UTC)


see w:Help:Books/Feedback#Image_credits_should_use_attribution_and_credit_line.  Docu  at 14:51, 12 September 2010 (UTC)


This template generates the following :

<td style="" class="fileinfo-paramfield fileinfotpl_credit">Attribution<br /> <small>(<a href="/wiki/Commons:Texte_d%27attribution" title="Commons:Texte d'attribution">imposé par la licence</a>)</small></td> <td>Photo: <a href="/wiki/User:Myrabella" title="User:Myrabella">Myrabella</a> / <a href="/wiki/Main_Page" title="Main Page">Wikimedia Commons</a> / <a rel="nofollow" class="external text" href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA-3.0</a></td>

I would suggest to have it add to the second td element a span element with the licensetpl_attr class

<td><span style="font-size: larger;" class="licensetpl_attr">Photo: <a href="/wiki/User:Myrabella" title="User:Myrabella">Myrabella</a> / <a href="/wiki/Main_Page" title="Main Page">Wikimedia Commons</a> / <a rel="nofollow" class="external text" href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA-3.0</a></span></td>

in order for it to match the behaviour of license templates, as documented in Commons:Machine-readable data.

What are your thoughts about it?

Jean-Fred (talk) 23:51, 22 November 2013 (UTC)

No objection --Jarekt (talk) 04:03, 23 November 2013 (UTC)
Good. I updated {{Information field/sandbox}} to allow this − see Template:Information field/testcases. Unless there is an opposition on the talk page I will update the template shortly.
See the final result at {{Credit line/sandbox}} & Template:Credit line/testcases. Jean-Fred (talk) 14:20, 23 November 2013 (UTC)
✓ Done last May. Jean-Fred (talk) 08:57, 2 September 2014 (UTC)

I think a better (also easier) way of matching Commons:Machine-readable data would be to change fileinfotpl_credit into an id:

<td style="" class="fileinfo-paramfield" id="fileinfotpl_credit">Attribution<br /> <small>(<a href="/wiki/Commons:Texte_d%27attribution" title="Commons:Texte d'attribution">imposé par la licence</a>)</small></td> <td>Photo: <a href="/wiki/User:Myrabella" title="User:Myrabella">Myrabella</a> / <a href="/wiki/Main_Page" title="Main Page">Wikimedia Commons</a> / <a rel="nofollow" class="external text" href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA-3.0</a></td>

Other {{Information}} metadata fields use the same convention. (See also the discussion at bug 57460.) --Tgr (WMF) (talk) 18:33, 24 November 2013 (UTC)

✓ Done last May. Jean-Fred (talk) 08:57, 2 September 2014 (UTC)

License optional for CC-BY???[edit]

In the documentation it is said « License portion of the Credit line. Required for CC-BY-SA and GFDL licenses but optional for […] CC-BY licenses. »

Where the hell does that come from? AFAIK mentionning the license is a requirement of all CC licenses, Share-alike or not. Unless there is an objection I will remove this misleading part.

Jean-Fred (talk) 13:49, 28 November 2013 (UTC)

[1] :) JKadavoor Jee 14:30, 28 November 2013 (UTC)
I guess it is my fault, but I have no idea what I was thinking when I wrote it 4 years ago. It contradicts what I wrote in Commons:Credit line at about the same time, after a lot of reading on the subject. It should be corrected. --Jarekt (talk) 02:59, 29 November 2013 (UTC)
It's OK; but what unfortunate is no one else including me didn't notice it even after several updates on that page. JKadavoor Jee 03:43, 29 November 2013 (UTC)
I've finally updated this for the English and French texts, but I'm not up to editing Japanese. --bjh21 (talk) 16:52, 24 January 2018 (UTC)

Adding title and source URI[edit]

CC best practices suggest a combination of title, author, source and license as an ideal attribution. Now I see the Media Viewer use file-name without extension as the title and it looks good to me. I contacted Bawolff and he suggested me {{#invoke:FileName|removeExtension}}; it works fine for me when I use Source: [{{fullurl:{{FULLPAGENAME}}}} "{{#invoke:FileName|removeExtension}}"]. Hope it is useful and can be implemented if a user use Other=TITLE in {{Credit line}}. JKadavoor Jee 11:19, 8 December 2013 (UTC)

Thanks Jarekt. JKadavoor Jee 06:12, 9 December 2013 (UTC)
I am not all done yet. I did not have a chance to test it. --Jarekt (talk) 12:51, 9 December 2013 (UTC)
✓ Done See documentation for the new options--Jarekt (talk) 13:32, 9 December 2013 (UTC)

Inconsistent use of licensetpl_attr[edit]

@Jarekt, Jean-Frédéric, Bawolff, Tgr (WMF): This template sets licensetpl_attr to include the license. This is inconsistent with other uses, and duplicates the license information that is available through other machine-readable metadata. Indeed, when {{Credit line}} is used, the duplication of license information is often error-prone (license URLs are sometimes forgotten or point to the wrong page, for example).

I think in the long run this duplication should be deprecated, but the license IMO certainly shouldn't be included in licensetpl_attr. This is inconsistent with other uses of licensetpl_attr, for example in Template:Attribution, and makes predictable programmatic use of the metadata harder.

If there are no objections, I'll adapt the template accordingly (feel free to beat me to it). We'll also need to test or modify MediaWiki:Gadget-Stockphoto.js accordingly.--Erik Moeller (WMF) (talk)

I agree that the current metadata is just broken. Either we add specific distinct classnames and define how those should be scraped, but reusing classes/ids with such specific meaning, is hijacking and not really improving the state of the machine readability of our pages. When I created licensetpl_attr, it was supposed to only be present inside an actual license, so I consider this invalid usage of the classname. —TheDJ (Not WMF) (talkcontribs) 10:08, 2 September 2014 (UTC)
licensetpl_attr was recently added by @Jean-Frédéric:. Jean, can you review this request for change? Otherwise I have no objection with Erik correcting it. --Jarekt (talk) 14:23, 2 September 2014 (UTC)
@Jarekt, Erik Moeller (WMF): Sure, ✓ Done in {{Credit line/sandbox}} in Special:Diff/133493635. Please review Template:Credit line/testcases, and I’ll migrate the version in the real template. Jean-Fred (talk) 15:20, 2 September 2014 (UTC)
@Jean-Frédéric, Tgr (WMF): It looks like the trailing slash is included within the licensetpl_attr span right now; it should be outside the span. Otherwise it looks good to me. Gergo, any concerns from your end?--Erik Moeller (WMF) (talk) 21:35, 2 September 2014 (UTC)

Uhh. TheDJ is right that this is fundamentally broken - .licensetpl_attr needs to be inside a .licenstpl wrapper to work (and it is really for licenses). I think CommonsMetadata ignores it the way it is used in this template; it actually uses #fileinfotpl_credit to parse the attribution. Which makes more sense semantically, but is also inflexible, since COM:MRD requires the id to be on a td element (and not even the one that contains the text). So I guess,

  1. remove both id=fileinfotpl_credit and classvalue=licensetpl_attr (and also class=fileinfotpl_credit which has no effect whatsoever but could be confusing)
  2. add another {{Information field}} with id=fileinfotpl_credit and style=display:none, with the same value as the old one, except without the license
  3. hide in the corner and cry.

--Tgr (WMF) (talk) 22:38, 2 September 2014 (UTC)

Except that style only affects the left-side td, so Information_field would need a new parameter as well. --Tgr (WMF) (talk) 22:41, 2 September 2014 (UTC)

@Tgr (WMF): I see what you mean. Indeed, where the attribution is solely specified through {{Credit line}} (and not, as is frequently the case, also through other templates!), it looks like CommonsMetadata currently returns a result that includes the <span class="licensetpl_attr"> wrapper due to the behavior you describe: example.
I think the approach you describe, as hackish as it is, would work. The one alternative I could see would be to get rid of fileinfotpl_credit entirely (is it set by any other templates?) and to use any licensetpl_attr reference outside of the context of a given specific license as the default attribution for all licenses (which IMO is still semantically defensible, since it's a property shared by all licenses requiring attribution). Between those two options, what do you guys think? The latter, once the edit by Jean-Fred is applied, would require a modification of the CommonsMetadata parser.--Erik Moeller (WMF) (talk) 05:16, 3 September 2014 (UTC)
I updated the documentation of {{Information field}} in the attempt to understand the logic behind some of those metadata parameters. Please update in case you end up adding more metadata parameters to it as proposed by Tgr (WMF) --Jarekt (talk) 12:18, 3 September 2014 (UTC)

Pinging User:Guillaume (WMF) to dig into this since he is organizing a cleanup drive of templates and other file metadata.--Erik Moeller (WMF) (talk) 08:01, 12 September 2014 (UTC)

@Jean-Frédéric, Erik Moeller (WMF): I've dived into this rabbit hole (not sure I've come back up yet!) and I agree with Tgr (WMF) that the quickest and easiest way to fix this for now is to have an hidden information field with the attribution minus the license. I've gone ahead and made the changes to sandbox templates (Special:Diff/139894713 to be able to hide the value cell, and Special:Diff/139895037 to add the ghost cell with the correct markers). You can see the result on a test image (see API data, search for "Attribution":).
Unless someone objects, I'll go ahead and echo those changes on the actual templates, and let the job queue propagate them to the files. I've also started a longer discussion at Commons talk:Credit line#Improving attribution and credit lines to discuss how to proceed in the medium and long term. Guillaume (WMF) (talk) 00:18, 19 November 2014 (UTC)
@Guillaume (WMF): Look good to me. Jean-Fred (talk) 18:15, 19 November 2014 (UTC)
And this is now ✓ Done! Guillaume (WMF) (talk) 19:43, 20 November 2014 (UTC)

Language transmission[edit]

IMO it would be very useful to add /deed.{{int:Lang}} at the end of the Creative Commons links (so you get http://creativecommons.org/licenses/by-sa/3.0/deed.{{int:Lang}} etc.), because it transmits the users to the correct language of the website. Is it realizable? --kaʁstn Dis/Cat 11:16, 8 February 2016 (UTC)

Edit request[edit]

{{Edit request}}

Hello! When using the template for example "CC-BY-SA" is displayed. The first hyphen is wrong. It should be "CC BY-SA". That's not a problem for the parameter, but the user should see the correct abbreviation without the first hyphen. It's "Creative Commons BY-SA". And there is no hyphen between the licence name and the version number: "CC BY-SA 4.0". Thanks. --XRay talk 05:10, 28 July 2016 (UTC)

✓ Done --Jarekt (talk) 16:16, 28 July 2016 (UTC)
Sorry, IMO there is done too much. The category names should be still "CC-BY-SA-3.0" and so on. Only the displayed licence in the credit line should be fixed. It's wrong, yes, but otherwise you must create all the categories. In this case really a problem. --XRay talk 05:01, 30 July 2016 (UTC)
You are right. That was my mistake. I think I fixed it now. --Jarekt (talk) 12:25, 30 July 2016 (UTC)

Remove mention of license when License=skip, etc.[edit]

{{Edit request}} It would be wonderful if " (required by the license)" in the field name could be omitted when License=skip, since the preference of the template user is probably that license stuff should not be mentioned. Also, when License=skip, currently an extra " / " is shown, with nothing after it; it would be awesome if this could likewise be omitted when License=skip. Thanks for a wonderful template! --Hhm8 (talk) 05:29, 6 June 2017 (UTC)

✓ Done--Jarekt (talk) 01:50, 19 June 2017 (UTC)
Thank you so much :-) --Hhm8 (talk) 03:30, 19 June 2017 (UTC)

Add support for CC BY-SA 2.0?[edit]

{{Edit request}}

Could CC BY-SA 2.0 please be added to the list of licences with shortcuts? I'm asking because I think we ought to have credit lines to preserve the original titles of images from Geograph Britain and Ireland. Commons has some 1.7 million such pictures, so I think a shortcut is worthwhile. I think the shortcut can be made by just duplicating the line for CC BY-SA 3.0 and changing every instance of "3.0" to "2.0". --bjh21 (talk) 16:30, 24 January 2018 (UTC)

✓ Done --Jarekt (talk) 13:45, 22 February 2018 (UTC)

Is this a sensible way to include a title?[edit]

As mentioned above, I'm likely to cause {{Credit line}} to appear on quite a lot of images, and I'd like to make sure I'm not doing it wrongly, so can someone who knows (Jarekt?) take a look at how I've used it on these pictures and comfirm that it's reasonable?

The last one demonstrates why I went for using italics rather than quotation marks – quite a few Geograph pictures have quotation marks in their titles. --bjh21 (talk) 00:40, 25 January 2018 (UTC)

CC-BY-SA-4.0 & GFDL ?[edit]

Is it not possible to have CC-BY-SA-4.0 & GFDL? --Codrin.B (talk) 12:49, 6 September 2018 (UTC)

@Codrinb: Now it is :) Jean-Fred (talk) 13:55, 6 September 2018 (UTC)

(required by the license)© John Doe / Wikimedia Commons / CC BY-SA 4.0 & GFDL © John Doe / Wikimedia Commons