User talk:Adam Harangozó/template

Latest comment: 3 years ago by Adam Harangozó in topic About the idea

About the idea

edit

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)Reply

Hi @Amadalvarez:,
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)Reply
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)Reply
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)Reply

First tests

edit

People who were/might be interested in this module, please, have a look, contribute: @Vojtěch Dostál, Amadalvarez, Vladimir Alexiev, Llywelyn2000, Epìdosis, Tpt, Mfchris84, Ijon, Susannaanas, Amire80, Zache, and Andrew Gray:

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)Reply

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:

Label Qx Article Property ID
Adelyn Dohme Breeskin Q4682105 https://en.wikipedia.org/wiki/Adelyn_Dohme_Breeskin P4823 1701390
P2332 breeskina
Alain Locke Q2120917 https://en.wikipedia.org/wiki/Alain_LeRoy_Locke P4823 2000599
P2332 lockea
Albert Barnes Q710269 https://en.wikipedia.org/wiki/Albert_C._Barnes P4823 1700049
P2332 barnesa
Albert Eugene Gallatin Q2117132 https://en.wikipedia.org/wiki/Albert_Eugene_Gallatin P4823 1701509
P2332 gallatina
Brenda Fassie Q186840 https://en.wikipedia.org/wiki/Brenda_Fassie P7578 brenda-fassie
P1417 biography/Brenda-Fassie
Bruce Lee Q16397 https://en.wikipedia.org/wiki/Bruce_Lee P1417 biography/Bruce-Lee
P4823 1801347
Dorothy Crowfoot Hodgkin Q7487 https://en.wikipedia.org/wiki/Dorothy_Hodgkin P7578 dorothy-hodgkin
P1417 biography/Dorothy-Hodgkin
P3219 dorothy-mary-crowfoot-hodgkin
Emily Dickinson Q4441 https://en.wikipedia.org/wiki/Emily_Dickinson P7578 emily-dickinson
P1417 biography/Emily-Dickinson
P4823 1600453
P3219 emily-dickinson

Is that what you wanted, @RexxS: ? Otherwise you can ask me precisely what you want ;) —Eihel (talk) 06:24, 14 December 2020 (UTC)Reply

@Eihel and Adam Harangozó: 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:
Demo of "sources"
Article Result
Adelyn Dohme Breeskin (Q4682105)
Alain LeRoy Locke (Q2120917)
Albert Coombs Barnes (Q710269)
Albert Eugene Gallatin (Q2117132)
Brenda Fassie (Q186840)
Bruce Lee (Q16397)
Dorothy Hodgkin (Q7487)
Emily Dickinson (Q4441)
Emily Dickinson (Q4441) - lang=it
Emily Dickinson (Q4441) - lang=zh
Let me know what sort of changes you want. --RexxS (talk) 21:58, 17 December 2020 (UTC)Reply
Looks fantastic! I've added more reference works to the module list, I'll work on expanding it more. My questions:

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?

  • 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:

{{User:RexxS/sandbox/sources | Q7487 }}

Sources for Dorothy Hodgkin
Sources
  • 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.

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)Reply

So, @RexxS:, 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 "World War I (Q361) 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)Reply

@Adam Harangozó: Those questions are functionality, so I'm happy to address them:
  • The module determines the "local" language in the following way:
  1. If a |lang= parameter is supplied and it is a valid language code, it uses that.
  2. Otherwise, if a user has a language preference set (on a multi-lingual wiki) and it is a valid language, it uses that.
  3. 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 {{BASEPAGENAME}} 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 {{#invoke:Sandbox/RexxS/Sources |demo |qid=Q361 |lang=nl}}?
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)Reply
@RexxS: 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)Reply