Template talk:Creator

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Info non-talk.svg Template:Creator has been protected indefinitely because it is a highly-used or visible template. Use {{Edit request}} on this page to request an edit.
Please test any changes in the template's /sandbox or /testcases subpages, or in a user subpage, and consider discussing changes at the talk page before implementing them.

Statistics (Please do not archive)[edit]

Date Number of Creator templates Number of Files using Creator template
6430 281k
7488 321k
8698 379k
10,285 452k
15,441 872k
24,783 1457k

Only says "birth" even if also death-info[edit]

The following:

 | Name              = Fortuné Méaulle
 | Birthdate         = 1844-04-11
 | Birthloc          = Angers
 | Deathyear         = 1901
 | Deathloc          = 

displays as:

Fortuné Méaulle (1844–1901) Link back to Creator infobox template

Name from Wikidata[edit]

The template will need a major rewrite, probably in Lua to make full use of Wikidata, but maybe we can already use Wikidata for name retrieval, so that we do not need to maintain all those {{langSwitch|en=blabla|ru=bloblbo|ar=bliblibli}}. I think that simply requires transforming all {{{Name|}}} into {{{Name| {{label|{{{Wikidata|}}} }} }}. --Zolo (talk) 08:59, 15 May 2016 (UTC)

This would be a major improvement. --Robert.Allen (talk) 08:32, 16 May 2016 (UTC)
  • I came here to post the same thing. Kind of silly to maintain this manually when Wikidata is already organizing the translations. czar 07:58, 13 July 2016 (UTC)
So user:Jarekt, would you implement this version ? Not a nice code for sure, but it should work until we get the Lua version. --Zolo (talk) 13:44, 16 July 2016 (UTC)
That is an ugly code but I agree that it would work. However once we pull name from the wikidata than I am afraid we will get request to pull dates or locations, or wikisource links. All of them would be great but it would overcomplicate the already messy template. Another solution would be to keep current template as "core" and write outer layer to deal with wikidata. I was experimenting with that in April, here, but in the end decided that it would be better to just rewrite it in Lua. I have started to work on Lua version and hope to finish it this summer. --Jarekt (talk) 02:49, 18 July 2016 (UTC)
I have a better (hopefully) idea: as part of rewriting Creator template in LUA, I wiss start with {{name}} template and write it to handle more cases, that will simplify template:Creator code and make it easier to add wikidata based name. --Jarekt (talk) 12:04, 18 July 2016 (UTC)
✓ Done For example Creator:Peter Paul Rubens is missing "name" field and it is pulling it from the wikidata. --Jarekt (talk) 17:25, 12 August 2016 (UTC)
Thanks for your work, Jarekt. But I am not sure if the code works right. With https://commons.wikimedia.org/wiki/Creator:Peter_Paul_Rubens?uselang=ar I expect to see the name in Arabic but it is written in Latin script. Or do I misunderstand the functionaliy? btw: the link goes to arwiki. Raymond 18:35, 12 August 2016 (UTC)
Raymond, That is due to phabricator:T140792 bug; If you switch your native language to ar the Creator:Peter_Paul_Rubens page will have correct translations. --Jarekt (talk) 18:53, 12 August 2016 (UTC)
Jarekt, thank you for pointing me to this bug. Raymond 19:02, 12 August 2016 (UTC)
@Zolo:, maybe the issue is with module:Wikidata. I can imagine that if "lang" is provided but not used in all parts of the code we would have that issue. For example if some parts of the code relied on "lang" provided by the template and some on {{int:lang}} we could have issues described in that phabricator ticket. Could you check? --Jarekt (talk) 19:07, 12 August 2016 (UTC)
It is actually related to the behavior of mw.wikibase.label() that is not compatible with ?uselang. I have disabled it here and it fixes the issue, with potentially large large cost on memory usage that will need to be addressed in a more technical place. --Zolo (talk) 20:03, 12 August 2016 (UTC)

dealing with duplicate templates[edit]

This query lists all the wikidata items linked to 2 Creator templates. Many of those are duplicates ( 2 templates for the same person) or templates with wrong wikidata codes. If someone needs a interesting puzzle please help me cleaning them up, which involves either combining 2 templates or removing link from one of the commons creator templates and removing one of the Commons Creator page (P1472) links. --Jarekt (talk) 02:21, 30 August 2016 (UTC)

Category:Creator templates with Wikidata link: item mismatching P373[edit]

Category:Creator templates with Wikidata link: item mismatching P373 is a category which detects mismatch between Wikidata's P373 (Commons category (P373) and Commons Creator, Homecat category. In most cases it is due either to old category name still kept on Wikidata or due to multiple categories related to the same person on Commons. If someone like puzzles, I invite to help me fix them. --Jarekt (talk) 18:03, 2 September 2016 (UTC)

Lua version of the code[edit]

We have very preliminary version of the LUA code that mimics the current display part of the {{Creator}} template at Module:Creator. See for example:

Eugeniusz Lokajski  (1908–1944) Link back to Creator infobox template wikidata:Q735173
Eugeniusz Lokajski
Alternative names "Brok"
Description Polish photographer and athlete
Date of birth/death 14 December 1908 25 September 1944
Location of birth/death Warsaw Warsaw
Work period 1944
Work location Warsaw Uprising mostly in Śródmieście district.
Authority control

I will be adding more capabilities to look up info from wikidata and will work on large section that creates maintenance categories. But I hope to have something ready for testing soon. --Jarekt (talk) 14:35, 15 September 2016 (UTC)

Protected edit request[edit]

{{edit protected}} This template's documentation is displaying on pages in the Creator namespace that use the template. I believe it's because of the following line under "automatic categorization of pages in Creator: namespace".


The template already includes its documentation within noinclude tags at the bottom of the template. Could someone remove the line shown above? Thanks. --Auntof6 (talk) 18:24, 8 October 2016 (UTC)

 Not done Auntof6 I am lost why do you want to remove that documentation, for example in Creator:Sorin_Adam, or any other. Documentation within noinclude tags at the bottom of the template adds documentation to the template. --Jarekt (talk) 04:13, 11 October 2016 (UTC)
@Jarekt: I don't understand why the creator pages need documentation on how to use the template. Doesn't template documentation need to be displayed on the template page, and not on the pages that use the template? There are two places in the template that include the documentation page: the one at the bottom that displays the doc on the template page, and the one I suggest removing that displays it on creator pages. There are other types of pages that use this template, and the doc doesn't display on those. Am I missing something? --Auntof6 (talk) 04:19, 11 October 2016 (UTC)
Auntof6, All templates including Creator or Institution templates should include documentation. Creator templates are more or less the same and do not need individual documentation, so a single documentation page is added to 20- something thousands creator pages with the command you are proposing to remove. --Jarekt (talk) 04:33, 11 October 2016 (UTC)
@Jarekt: I'm still not sure I understand. Are you saying that the creator pages are templates? --Auntof6 (talk) 04:35, 11 October 2016 (UTC)
Auntof6, they are pages used like templates, (transcluded to other pages,) but which are in a specialized namespace. --Jarekt (talk) 05:03, 11 October 2016 (UTC)
Ah! I didn't know that. Now it makes sense. Thanks for the explanation. --Auntof6 (talk) 05:08, 11 October 2016 (UTC)

Bugfix in this template[edit]

There are two tests using this code:

{{#ifeq: {{localurl:{{PAGENAME}}}} | {{localurl:{{{Homecat}}}}} || ... }}

It does not work at all, there's no such "localurl:" parserfunction. This causes a tracking category to be overpopulated.

I think that the purpose of this test was to compare the current page name (as returned by {{PAGENAME}}, where it may be HTML-encoded for some ASCII punctuation characters allowed by MediaWiki such as the apostrophe ', with the value of a plain-text parameter ({{{Homecat}}}) which may include non significant whitespaces or different lettercase in the first letter, and which is generally not URL-encoded). The work around is to use this simple code (passing the specified parameter to the PAGENAME parser function to normalize it the same way as for the current pagename returned by default):

{{#ifeq: {{PAGENAME}} | {{PAGENAME|{{{Homecat}}}}} || ... }}

Another equivalent solution uses #titleparts (reverse conversion from the HTML-encoded characters to plain UTF-8 characters), but still with the equivalent canonicalisation of pagenames (leading/trailing whitespaces removed, whitespaces compacted, canonicalisation for the namespace or for the leading character of the page title, resolution of relative URLs...).

Please unprotect this template to make this necessary change (two occurences). verdy_p (talk) 03:21, 10 October 2016 (UTC)

Info non-talk.svg
It is requested that an edit or modification be made to this protected page.

Administrators: Please apply <nowiki> or {{tl}} to the tag after the request is fulfilled.


Note: the Template:Creator/sandbox version fixes that (it also fixes various dangling newlines at end of the table, adds scope="col/row" in header cells and eliminates unnecessary HTML elements (notably the outer div to contain the table; it also fixes the layout of descriptions containing bulleted or numbered lists or multiple paragraphs). verdy_p (talk) 06:25, 10 October 2016 (UTC)
verdy_p, localurl magic word is explained here and it seems to me that it is working fine. Category:Creator templates with non-matching home categories holds creator pages whose name does not match the category name. It is not a problem by itself but since most creator template names match the home category names, if someone needs a list of creator pages and their home pages, one can often use a shortcut and guess the name of the home category based on creator page name. However creator pages in Category:Creator templates with non-matching home categories need to be treated differently. You are saying that "category [is] overpopulated". Can you give any examples? --Jarekt (talk) 17:37, 10 October 2016 (UTC)
It is one of the tracking categories tested using "localurl:"; all these page are cetegorized due to missing links to pages named with a "localurl:", edit one of these pages, you'll see at the bottom a red link for missing included "templates"... verdy_p (talk) 20:56, 10 October 2016 (UTC)
Note: localurl does not work correctly to compare pagenames as they are returned by the internal PAGENAME parser function (and similar), because they are HTML-encoded (this is a problem for all pages containined as ASCII apostrophe for example in their name becaues tests with "#ifeq:" will not match them. We need a name canonicalisation (and unfortunately localurl does not work coherently when there are optional namespaces). To have coherent results, "#titleparts:" works much better (it has been tested since lon in French wikis where there are many page titles with apostrophes, and even here on Commons.
For some resons the proposal to change the way PAGENAME returns HTML-encoded names has not been accepted (because PAGENAME is frequently used within attributes where quotes cause problems.
The alternate proposal to fix #ifeq: so that it will HTML-decode its parameters was also rejected. And anyway we need a way to canonicalize pagenames with their correct namespace name (replacing aliases) and a single capitalization form for namespaces, and a correct capitalization for pagenames outside the namespace. verdy_p (talk) 21:03, 10 October 2016 (UTC)
verdy_p I edited one of the pages and I see no red links for any missing pages. The purpose of localurl is to grab 2 strings that could be in many alternative formats and create a 2 strings in unified format (whatever that might be) so they can be compared. Can you point out a specific page where something is not working right? --Jarekt (talk) 04:06, 11 October 2016 (UTC)