User talk:Adam Harangozó/template

About the idea
Hi, Adam. I received your mail and, if don't mind, I answer in this talk page.

In my opinion it's a feasible idea, because we have the tool that allow it: Wikidata.

However, I think that the level of evolution or design interest are variable among WPs. For instance, I presume that it would not be acceptable in cawiki; we are not technophobics, as enwiki or dewiki use to be, but we are in an open debate (since months ago) about reform, reduce or even eliminate the authority template, because part of the community don't find it useful. The discussion become complex, because once it is opened, people take advantage to discuss where should the link to Commons or Wikiquotes be, for instance, and debat never ending. Two years ago, as the number of identifiers properties grown up in WD, I changed all code related to social networks and cinema portals by concatenated icons shown at the foot of infobox (see:ca:template:Identifiers). The decision was discussed, but accepted. However, I think that any increase of contents will not be accepted.

Seeing some comments on your proposal to enwiki, I suggest that the list of elements to show in the template can be customized by each platform with some kind of blacklist parameter to ignore identifiers that are unliked for the community. If you finally go ahead with the project, can account with me to help you. And, when you have a beta version, ping me to propose to cawiki community. Never you know... Amadalvarez (talk) 15:47, 26 October 2020 (UTC)
 * Hi ,
 * Thank you very much for writing and apologies for my slow reply. Does this mean you would like to help with the coding itself or only in the later stages? Also, it is a good idea :to have a blacklist paramater for each wiki. Thanks. Adam Harangozó (talk) 20:25, 22 November 2020 (UTC)
 * Well, I've not too much time to work in code. I may take a glance in different steps of your idea, as a advisor or as a beta test, as you wish. Salut ! Amadalvarez (talk) 21:00, 22 November 2020 (UTC)
 * Sadly, coding is the only thing I can't do at all. I would be happy to describe all the necessary parts and coordinate but I can't code. Do you have any ideas for editors who could be interested? It might not need much coding just tweaking an authority control template but I can't do that either. --Adam Harangozó (talk) 22:45, 22 November 2020 (UTC)


 * Hi Adam, I like your idea very much. Unfortunately I've never worked on templates or Lua scripts so I can't help with that, but can help with WD structuring and whatever data wrangling is needed. I've commented on some of the bullets above --Vladimir Alexiev (talk) 10:45, 26 November 2020 (UTC)
 * Cool, I'm sure there will be something to contribute. :) We'll be coordinating the development here: User:Adam_Harangozó/template_specsAdam Harangozó (talk) 14:40, 2 December 2020 (UTC)
 * Hi Adam. I plan to work on a future such template, but it will be with Abstract Wikipedia. The goal will be to write a such template that we can use on each version of Wikipedia (I also plan infoboxes). It will surely take a little time, but the result will be better for the most people. Jérémy-Günther-Heinz Jähnick (talk) 11:01, 26 November 2020 (UTC) — Preceding unsigned comment added by Eihel (talk • contribs)
 * Hey, I haven't started delving into Abstract Wiki too much yet but I also thought that when creating new articles for smaller language Wikipedias, offering a collection of such sources could help. Please do keep an eye on the development of this template too if you can, hopefully it will be something to build on in the future.Adam Harangozó (talk) 14:40, 2 December 2020 (UTC)
 * Those interested in these pages should be interested in this wish page for 2021 (the project starts from there). Best regards. —Eihel (talk) 20:13, 13 December 2020 (UTC)

First tests
People who were/might be interested in this module, please, have a look, contribute:

I've created a module, Module:Sandbox/RexxS/Sources/data that contains the information from User:Adam Harangozó/template properties in a format that can be easily read and used by a Lua module. Hopefully it is not difficult to add new entries to that by copying the format used. I've made a test module to show how to pull information in from the list of sources at Module:Sandbox/RexxS/Sources and there's a simple demo of the code to read back the contents of the list in wiki-text format at Module talk:Sandbox/RexxS/Sources. The next step is to find some example articles where the template would be useful and I'll knock up some rough drafts of what the template might look like, pulling real data from Wikidata and from the sources list. Can anyone give me a list of a few articles to use for that, please? --RexxS (talk) 00:31, 14 December 2020 (UTC)

Based on the following WDQS https://w.wiki/qVT, https://w.wiki/qVU, https://w.wiki/qVY, https://w.wiki/qVZ and https://w.wiki/qVd, here are some examples:

Is that what you wanted, ? Otherwise you can ask me precisely what you want ;) —Eihel (talk) 06:24, 14 December 2020 (UTC)
 * That's fine, thanks. I've now created a demo function in Module:Sandbox/RexxS/Sources. It can take a qid parameter, which defaults to the current page if omitted. It can take a lang parameter which defaults to the site content language (or the user's set language on multilingual wikis). It uses Template:Hlist to produce the horizontal list output, so you would have to decide whether to build that into the module for export to wikis that don't have hlist. Her's a demo of what it can do so far:


 * Let me know what sort of changes you want. --RexxS (talk) 21:58, 17 December 2020 (UTC)
 * Looks fantastic! I've added more reference works to the module list, I'll work on expanding it more. My questions:
 * Can this hlist template be integrated in any "design" templates like navboxes, etc? I still think the design should be similar to Template:Medical resources but with the differences already discussed (not showing ID for example).
 * Can the other language list be made collapsed? I'm afraid some wikis would object to a long list of non-local sources but if it's collapsed it doesn't take that much space.
 * Could you include a few non-person articles in the next demo? Here are some ideas: Q12548, Q42934, Q12539, Q6583 Adam Harangozó (talk) 12:03, 20 December 2020 (UTC)
 * Could you include a few non-person articles in the next demo? Here are some ideas: Q12548, Q42934, Q12539, Q6583 Adam Harangozó (talk) 12:03, 20 December 2020 (UTC)

Was it reasonably straightforward to add the extra works to the list? Might we need some instructions, or do you think it's not too difficult to copy the existing format? → Eventually, we should have a module to extract the info from Wikidata and a template that calls the module, putting it in whatever format is desired. It would be good to decide on the name of the template (and hence the module) as I think it's now about ready to move from my sandboxes into proper template/article space. --RexxS (talk) 15:34, 20 December 2020 (UTC)
 * The hlist template or class is in use in all design templates where a horizontal list is required. The demos I made are only to show what content can be extracted, not how it is to be displayed. Here's a template demo without the language ids inside an infobox similar to Template:Medical resources:
 * I'm loathe to have content collapsed by default because of accessibility considerations. A collapsed list will probably take up almost as much space as a non-collapsed one. Nevertheless, I've implemented a simple collapsed other languages section for you to see.
 * Please feel free to make your own demos. They should be simple enough to construct by copying what I've done above.

So,, I had the time finally to test, etc. It seems to work great and I think it's easy to add sources. I have a few questions and comments, some might be design territory as I'm not completely sure where that begins:
 * When you insert this template will it automatically use the local name for the item too? "Première Guerre mondiale" for World War I on French Wiki, etc. Also, will it use the local names for the sources?
 * What should we do when there are no local sources for an item? If the list is not collapsed then I guess the other languages are shown anyway. Otherwise I would make it automatic that it does not show the empty line for the local, only the other language list.
 * I see that the module can handle multiple identifiers from one source which is great but it shows them as separate, repeated items on the list. Can we somehow group them? See here the Dutch sources for World War I: User:Adam Harangozó/template test

I think the module should be called "Reference works". That is a wide enough category for these sources and then the template could display something like " in reference works". Do you think we should create a template as well (with the medical resource design) or only the module and propose it to the community? Adam Harangozó (talk) 12:03, 4 January 2021 (UTC)
 * Those questions are functionality, so I'm happy to address them:
 * The module determines the "local" language in the following way:
 * If a lang parameter is supplied and it is a valid language code, it uses that.
 * Otherwise, if a user has a language preference set (on a multi-lingual wiki) and it is a valid language, it uses that.
 * Otherwise, it uses the "content language" of the server (the language of the Wiki or English for projects like Commons).
 * However, I don't actually understand what you mean by "the local name for the item". The code I've worked on doesn't use the name of the article, if that's what you mean? If you are thinking of the demo I made above, it just fetches the Wikidata label for the article (so would work for any language that had a label on Wikidata in their language), but that's simply part of the demo, not part of the code I wrote in the module. On any language wiki, you can always use  to display the name of the article in the local language (e.g. in the template caption), if that's what you wanted.
 * I've amended the code so that if there no local sources, the other sources will be displayed as you can see for the last entry in the demo table above.
 * I wrote the code so that it would group multiple values of identifiers together, but obviously it will still display the same text that you defined in the first item for each entry in Module:Sandbox/RexxS/Sources/data. As it hasn't got anything else to use as display text, I'm not sure what further grouping I can do. Perhaps you could sketch out a demo of how you think it should look for ?
 * When I've sorted the grouping issue, I'll create a new, tidied-up module called "Reference works" and a template to match, based on my demo at User:RexxS/sandbox/sources and let you know when they are ready to advertise. --RexxS (talk) 03:56, 5 January 2021 (UTC)
 * Hey, I think the grouping is a minor issue we can address later (as this is probably quite rare to happen). One option though would be to include the further IDs as numbered links in brackets after the source so: Cultureel Woordenboek (1, 2) - where the first ID is linked on Cultureel Woordenboek and the others on the numbers. But this might not be the best solution but it's not so important now. Is there anything else you need for the module and the template? --Adam Harangozó (talk) 17:35, 2 March 2021 (UTC)
 * Hey, I think the grouping is a minor issue we can address later (as this is probably quite rare to happen). One option though would be to include the further IDs as numbered links in brackets after the source so: Cultureel Woordenboek (1, 2) - where the first ID is linked on Cultureel Woordenboek and the others on the numbers. But this might not be the best solution but it's not so important now. Is there anything else you need for the module and the template? --Adam Harangozó (talk) 17:35, 2 March 2021 (UTC)