Module talk:Cycling race

Active discussions

See also:

There is no automatic archiving set up for this talk page.

test the moduleEdit

Suggestions and commentsEdit

@ Psemdel: I come to you as if I am not mistaken, you made the last global changes.  

Hello, as I wrote before, I can't read Russian and had no possibility to test it in this language. I am therefore not surprised that there are some issues. Still the changes were required to improve the module. Personally, I have no more idea of improvement, so I hope that once we correct your issues, the version will reach a kind of stability.

So I look at Тур Даун Андер 2019, I suppose it is the basis for this discussion.

Cycling race/startlistEdit

  1. If the driver’s spelling in English is absent in the WD, the module in the ru-wiki gives an error.
Startlist uses the function "getRiderLink" for the rider (which I didn't create). I had the idea, that you probably don't want the "official name" with latin alphabet, if it is not present in cyrillic. Therefore, I made this "if". If there is no official name, then it looks for label in the language of the wiki, if not found then it makes link = getLabelFallback(riderID, {'en', 'de'}). I corrected right now an issue with the loop for (label missing) which was damaged. I insert the 'fr' and 'es' fallback in addition. It can help.
  1. Make it possible to display the list of commands minimized by default by adding some parameter as in the calendar. For example, "closed". You can of course manually hide it through the template, but then the text becomes smaller and the place on the sides disappears.
What do you mean with "the list of commands"? What do you want to customize?
Like this. I apologize for the curvature inside, it is difficult to quickly understand your patterns. For example, in the way {{Cycling race/startlist|Q57082387|close=1}}GAN (talk) 22:20, 15 January 2019 (UTC)
Ok understood.
We should add something like that, but I don't get it correct. Can somebody correct?
<div class="NavFrame" style="margin:auto; clear:both; border-style:solid;border-color:#AAA; background-color:#FFF" title="[afficher]/[masquer]" >
<div class="NavHead" style="text-align:center; height:1.6em; background-color:#EFEFEF; color:black">
<div class="NavContent" style="margin:0; background:white; ;text-align:left; display:block;">
<div class="NavEnd"> </div>
  1. If the command does not specify the USI code to display an empty string. Now there is a shift up the composition of the team
  Done It is a good point, it can be solved probably. Edit: I put "___" if no UCI code. Note that in the code without wikidata, there is the same "issue".
  1. In ru-wiki in the rest of the templates, after the rider, a small Wikidata icon is displayed, which allows you to quickly jump to his star page in WD. Can I do this here?
  Done It should be possible I think.
  1. Can add the list of main abbreviations directly to the template
It seems complicated to automatize that to be honest. In French for instance, we list the type of tricot and dates...and..and..and. I realized the template, I know it is complicated (see [Modèle:LP/Légende/Course à étapes2 here]. I would suggest you to make a similar template in ru.
  1. Strange bug.
Starts Art for Tour de Thuringe féminin 2018 (which is in the sample) Q57316098 (№104) - remains citizenship in the WD - the module displays in her flag of Kazakhstan. Irina Ivanova (Q57315808) (№103) - Russia. I removed her citizenship for verification - the module displayed the flag of Germany. Then he joined. Checked in ru-wiki and fr-wiki — GAN (talk) 19:11, 20 January 2019 (UTC)

I will have a look. Psemdel (talk) 21:38, 25 January 2019 (UTC)
  Done, 2 minutes work :) Psemdel (talk) 17:46, 26 January 2019 (UTC)


  1. Make the race displayed even if no category is specified for it. Now in some tournaments among these races there are those who do not have a category. This feature allows you to quickly find them in the list.
  Done I use the categories to sort the races (for instance in UCI calendar I only show UCI races). I can give it a try. I will maybe remember, why I absolutely wanted to introduce that.


  1. If a manual change is made to the calendar, then when you click on the WD icon, the transition to the WD does not occur, and the icon image opens
I tried with Тур Даун Андер 2019, it worked at my place (it opens wikidata). The link is " "... Do you have an example.
Any grand tour where manually at least indicate the days of rest or the country / flag, if the stage took place in another country.—GAN (talk) 22:20, 15 January 2019 (UTC)
  Done Ok.
  • If the place of start or finish of the stage is located in another country, unlike all the others. Through (P276) add a country to display its flag (size 15px) before the name of the city. — GAN (talk) 16:01, 10 February 2019 (UTC)
So compare the country of the city to the country of the race. If different-->display flag. Yes, it can be done. Psemdel (talk) 16:44, 10 February 2019 (UTC)
@Psemdel: Do you suggest comparing countries automatically? In the race element, as well as its stages, we indicate all the countries where the race is taking place. Example 2019 Tour de France (Q30091668) FRA and BEL countries are indicated. For stages 1 - 3 country BEL. Then the comparison should show that the countries are no different. If only for a race taking place in several countries at once, it is imperative to indicate the main host country first and compare it with it. — GAN (talk) 17:03, 10 February 2019 (UTC)
A good point.
  Done As for some races, both countries have the same value, I made it simple. If there is only one country during the race --> no flag, if there are several --> flag. Psemdel (talk) 19:22, 11 February 2019 (UTC)
Changed my mind as there are many GTs and race with one main country. So I come back to the idea from GAN. Psemdel (talk) 00:25, 13 February 2019 (UTC)

Cycling race/listofteamsEdit

  1. The command is placed in the correct class if in the VD it is listed first in parameter p31. But there often can be the first or only Q53534649. When you add a class, you have to delete it first, and then enter it again. Make it ignored by the module.
  Done I am looking at that, I think it can be easily improved.

Classification leadership tableEdit

  1. Almost the last element in the manual to redeem for the race. Leaders after the stage indicate. A list of light colors for jersey is available to highlight cells with intermediate results. The number of displayed nominations (columns) can be made as in the calendar, that is, if desired (stage number, stage winner, general, points, mountains, sprint, у-23, agressive, team time, team points). The only thing missing is the icon of the desired T-shirt for the title, you can try to take it from the list in P1346 and dark colors for the final row. Probably there will not be only a merger of cells if the racer was in the lead in several stages.
I thought about it several time. The merging of the cell makes it complicated. Moreover, copy/paste of the table takes 1 minute, so I haven't invest time in it yet. 2019 is still long, we can try.
Protocols in Latin, and we have Cyrillic.   Although, apart from the World Tour, we do not do other races in a single year. — GAN (talk) 22:20, 15 January 2019 (UTC)
A point for you. When I find some time...
This is not the most important thing, rather this one as a sentence. tables for 20 multi-day races per year in the World Tour, we will make handles.  GAN (talk) 19:29, 20 January 2019 (UTC)
When I think about it, it is almost a copy/paste of listofstages. It could be done in one week-end, I think ;). Psemdel (talk) 20:48, 22 January 2019 (UTC)
See below, alpha version done. Psemdel (talk) 21:08, 5 March 2019 (UTC)

Cycling race / infoboxEdit

  • Can I add the ability to display the navigation for the previous and next year in manual mode, replacing the automatic one? It is necessary for races (Grand Prix of Nations) which was also part of several races (not tournaments).
I understand, but I am not very familiar with the "manual" stuff. Someone else could do it maybe.
  • If we specify the compositions of all the teams, they can be made so that their number at the start is first displayed in (number of participants (P1132)). How will affect the resources of the module. Just as the number of stages and teams in a race is considered.

GAN (talk) 16:06, 10 February 2019 (UTC)

Yes, it would be rational. I suppose it is only a count "#", if it can be done then it should not be expensive. Psemdel (talk) 16:48, 10 February 2019 (UTC)
  Done, note that the NP at the first stage are not considered. It is more from an help to get the number than from a precise function.
  • Where does the one finisher in the 2019 Vuelta come from? ({{Cycling race/infobox|Q56284054}})--Pirker (talk) 08:36, 25 August 2019 (UTC)
    • @Pirker: If the number of start and finishers is not filled, then the module considers these indicators through the number of indicated riders, taking into account their final results (DNS, DNF) participant (P710). In this case, nothing (emptiness) should not be displayed. — GAN (talk) 15:14, 25 August 2019 (UTC)

Cycling race / listofwinnersEdit

  • Add the ability to output lines at the very bottom after the last entry. For example, "under row".
Is it not possible?
  • Cycling race / infobox and Cycling race / victories can display a link to the source next to the winners. Do the same here.

GAN (talk) 16:06, 10 February 2019 (UTC)

Yes, can be done. Psemdel (talk) 16:49, 10 February 2019 (UTC)
Do you have an example, where I can test. I think it is only 10 letters to add in the code. Psemdel (talk) 17:43, 10 February 2019 (UTC)

Cycling race / victoriesEdit

GAN (talk) 16:06, 10 February 2019 (UTC)

So no country name, only country flag for ru-wiki. Correct? Psemdel (talk) 16:52, 10 February 2019 (UTC)
Yes. Only the flag of the country before the name of the race. In ru-wiki, in all templates based on the module, the country in the lists is only flagged. Plus the template does not stretch much. — GAN (talk) 17:07, 10 February 2019 (UTC)

Cycling race / teamrosterEdit

GAN (talk) 16:06, 10 February 2019 (UTC)

  Done There was two spaces in the name in ru: solved here Psemdel (talk) 17:12, 10 February 2019 (UTC)
  • What is wrong with the Bora-Hansgrohe roster ({{Cycling race/teamroster|Q57066331}})? --Pirker (talk) 15:44, 20 August 2019 (UTC)
    • The string returned by the module as an error is very similar to the time it performed on the team. I reviewed all the riders - everything is fine. — GAN (talk) 17:36, 20 August 2019 (UTC)
      • But what is wrong? --Pirker (talk) 08:27, 25 August 2019 (UTC)


  1. In ru-wiki almost all riders (except for representatives of several countries) are displayed in all templates as Last Name, First Name. Comma separated. It can be done (if it is not difficult and resource-intensive) so that the part is first displayed before the comma, and then after it. But without a comma. As in all other wiki. — Last Name, First Name >>>>> First Name Last Name

"embarrassing smiley"

In teamroster, there is a fonction to invert the Last Name and the First Name in ru. Is it working? If yes, we can try to expand it to other functions.
In ru-wiki in all tables on the basis of the module cyclists are displayed as follows in order of priority:

- because the article is named about him. We have this last name, first name and patronymic
- as written in Russian in Wikidat
- writing in a foreign language in Latin
Therefore, to remove the middle name so as not to stretch the tables, at the moment it is only possible through p1448

List of all templates. You can see. Everywhere comma-separated viewing convenience

So you don't want "Вивиани, Элиа" but "Элиа Вивиани" all the time. Even though the label and article in wikipedia are both "Вивиани, Элиа". Is that correct? Psemdel (talk) 21:37, 16 January 2019 (UTC)
I inserted a test in ru. Psemdel (talk) 18:30, 20 January 2019 (UTC)
Checked, revealed the following. All cyclists
- for which no articles were created (red and black) and named on the VD using a comma, they began to be displayed without a comma >>> Name First Name.
- for which articles were not created and named without a comma, cause a module breakdown >>> it gives an error
- for which articles are created (blue) are still displayed as the article is named about him.

For example (talk) 19:19, 20 January 2019 (UTC)

official name (P1448)Edit In ru-wiki his name has ceased to be displayed in Russian as a module.

I haven't thought about it. It will be corrected. Can you give an example?

GAN (talk) 19:48, 15 January 2019 (UTC) 1986 The rest are not translated cyclists do not have at the moment Russian writing in WD. You can of course create an article. But then it will be difficult to verify this error. — GAN (talk) 22:20, 15 January 2019 (UTC)
So the issue is here, what I thought with official name and cyrillic. You prefer a "wrong" name in cyrillic, than a correct name in latin. It was probably poorly implemented. I will see, if we can do better.
Thank you for your feedback and the ideas! It is the right time of the year to correct such things. I hope that then we can have a nice season without too much debugging and programming, so we can concentrate on the essential. Psemdel (talk) 20:53, 15 January 2019 (UTC)

At first I thought it was because of the gender of Millar and the lack of an article about him in ru-wiki. It turns out it is not. If necessary, we can write a name for the ru-wiki using the p1448 parameter and in Latin. I want through this option to try to show cyclists of the former USSR without patronymic of Екимов, Вячеслав Владимирович >>> Вячеслав Екимов. So that the template does not stretch because of the middle names.— GAN (talk) 19:26, 20 January 2019 (UTC)

  • all lines from (official name (P1448)) are displayed on your FR-Wiki regardless of the specified language.
  • It is possible for the module to make it display only the name in the native language if it is indicated. If not then on any other in order of priority.
  • I found the item (short name (P1813)). You can add it in the same way (P1448) with language and time support. Output order - if specified (P1448), then (P1813) is not displayed. This is to reduce the display names of cyclists in ru-wiki.

GAN (talk) 16:11, 10 February 2019 (UTC)

I still agree with you, but it is still difficult for me to test on ru-wiki. Do you have a test module for that? The link you send for FR-wiki uses the infobox, which is completely independent from Cycling race. In cycling race, we use the official name in the name of the wiki (at least should be so). Psemdel (talk) 17:16, 10 February 2019 (UTC)
@Psemdel: Made on your page draft / sandbox. Will do? You can edit as needed. In the template winners, all drivers VD translated into Russian. And how did you find an extra space because of which module gave an error? — GAN (talk) 17:39, 10 February 2019 (UTC)
I also need a sandbox module, otherwise I have to modify the real Cycling race module to make test, which would make the whole module wrong during my test... For instance, I use that on fr-wiki. About the error, I am a wizard... no just joking. I tried first to find out which rider was problematic (I copied the P527 in another item to do test). Then, I tried to understand why the module thought that the rider had 3 parts of the name, when it had 2 (that I discovered reading the code at the error line). And then I read the name of the rider in "ru" with lot of attention --> solved :D. Psemdel (talk) 17:48, 10 February 2019 (UTC)


  • @ Psemdel: I checked the "test" in the ru-wiki - there are bugs. Found a bug in the start list. See each item for details (signature for convenience is worth it). — GAN (talk) 19:38, 20 January 2019 (UTC)
Ok then revert. I still don't find a way to test it on my computer directly... Maybe you could make some tests. I mean it is not very complicated, you can have a look at what I did. Psemdel (talk) 19:42, 20 January 2019 (UTC)
  • @ Psemdel: Can I still disturb?   I added a few more suggestions and questions there.— GAN (talk) 16:11, 10 February 2019 (UTC)
Ok, I will have a look. Psemdel (talk) 16:31, 10 February 2019 (UTC)
Many good ideas. Right now, I am quite busy preparing the season with maps and so on, but when I find 5 minutes I will implement the proposition. For official names, I can't promise anything right now as I can't test in ru (I understand nothing...). But I think we will find a solution... Psemdel (talk) 17:18, 10 February 2019 (UTC)
  • @ Psemdel: Sorry for the pings, but it is more convenient and faster  . If you correctly understood the syntax of modules in ru-wiki, then you need to create the page "Модуль:Песочница/Psemdel". You can also use the preview indicating there the name of the desired page. The ru-wiki flags used to be like this. — GAN (talk) 18:09, 10 February 2019 (UTC)
No issue with the Ping, I am online. Perfect, so I will be able to progress on the topic. For the flag, I see that it is different. I solve it. Psemdel (talk) 18:25, 10 February 2019 (UTC)

Error with calendars in eswikiEdit

Some months ago, I tried to update eswiki with latest code version but I found some errors at custom calendars, so I never did it. I was talking about it with @Dipsacus fullonum: but I could not dedicate time to check problems. So recently @Jérémy-Günther-Heinz Jähnick: updated eswiki to introduce startlist function and today I checked that the problem is still present: "Error de Lua en Módulo:Cycling_race en la línea 931: attempt to concatenate a nil value". You can see the problem at es:UCI America Tour 2019 or es:UCI America Tour 2018, but the problem is not present at es:UCI WorldTour 2018. I do not know how to have some whatsdog to catch the problem, could someone help us? @Psemdel:. Regards. Repf72 (talk) 18:30, 16 January 2019 (UTC)

@Repf72: Removed a space before and after Q on one link - everything became normal. Asks for the second captcha - did not rule. — GAN (talk) 18:40, 16 January 2019 (UTC)
@GAN: thank you. I did not have in mind this. Fixed.Repf72 (talk) 20:21, 16 January 2019 (UTC)


@Psemdel, Jérémy-Günther-Heinz Jähnick, Hejsa, Douglasfugazi, Papuass, Mr. Ibrahem: The situation is as follows. At first it was World Champions and USI Tours for some years. Now go racing. Two bot User:DeltaBot and User:MatSuBot massively traversing them making the following changes:

- adds element sports season of league or competition (P3450)
- then follows (P155) and followed by (P156) contribute to it as qualifiers
- removes follows (P155) and followed by (P156) as separate elements
- in some cases, removes the race name from instance of (P31)

As a result of this, in Cycling race / infobox, navigation for the next years is no longer displayed. I wrote to the bot owner - the answer of the type is so true. — GAN (talk) 15:57, 1 February 2019 (UTC)

Thank you for the info. A world championship is not a season. Or we will have to change definition in the lexicon. Now it makes no sense at all! I really don't appreciate those kind of bots that do massively things on items without any concertation or allowance. Psemdel (talk) 23:05, 1 February 2019 (UTC)
Same opinion as Psemdel. Jérémy-Günther-Heinz Jähnick (talk) 16:45, 2 February 2019 (UTC)


@Psemdel: The following code appears in function listofwinners_main:

    if countryflag==true then country=false end
    winner(partID, winners, timeOfRace, country, WDlink_on)

Should that be:

    winner(partID, winners, timeOfRace, not countryflag, WDlink_on)

I would have made that change but I don't understand exactly what's going on and it has different meaning from the original. The current code is not right because country is a global variable that has not been set. Therefore it is either nil (if nothing happens) or is false (if countryflag is true). Johnuniq (talk) 01:23, 16 February 2019 (UTC)

Thank you for the attention. I just noticed this week that I was using a variable "countryflagonly" everywhere but that it was exactly the same (with a "not") as "country" in all other functions. So I wanted to delete all "countryflagonly", but it is different from countryflag... I check the point you mention. Psemdel (talk) 09:16, 16 February 2019 (UTC)
Edit, you were perfectly right. Thank you. Psemdel (talk) 10:51, 17 February 2019 (UTC)

Need help cleaning TODOEdit

While looking through the module I added some TODO comments. I'm hoping someone with a better understanding of the details will work out what should be done. That is, please edit the module to fix the problem and remove the comment. The lines concerned follow, with the function in which they are defined.

  • local function commastage(stageID,racelabel)
    comma = v.article -- TODO should 'break' come after this?
  Done correct.
  • local function fn_rider(entityID,dateOfRace,displayteam,only_winner)
    local WDlink_on -- TODO should this be set?
  Done WP-ru and WP-mk likes to have the WDlink_on, I inserted that.
  • function nationalchampionships_main(s)
    local dateOfRace -- TODO this is always nil
  Done correct, I obviously completely forgot to insert that.
  • function p.teamroster(frame)
    if wiki ~= 'ja' then -- TODO is this right? (it was "if language ~= 'ja'" but language is not defined)
I am rewritting this part of the code. Right now, this code doesn't work at all.

Johnuniq (talk) 07:01, 17 February 2019 (UTC)

Thank you for your comments. There is a bit of work ongoing to make the module works better for cyrillic wikipedia. It created a bit of confusion in the code. I am trying to solve the problems...but sometimes create new ones. Psemdel (talk) 10:43, 17 February 2019 (UTC)
Thanks for those fixes. You are doing a lot of work and I hope you don't mind me fiddling. I noticed the following line which might be temporary while you are working but I thought I'd mention it.
if true then return tostring(count) end
Johnuniq (talk) 06:58, 18 February 2019 (UTC)
No problem, elegant coding is not easy, a bit of help is welcomed. Oh yes, it is a line I completely forgot...(edit: much better now!) Psemdel (talk) 20:44, 18 February 2019 (UTC)

One more duplication: we have function "number(gender, b, wiki)". It should be reused in "p.infobox" for edition number formatting. --Papuass (talk) 14:11, 19 February 2019 (UTC)

Idea is not bad, but I am not sure that the word "edition" is feminile in all languages. For a man or a woman, it is clear, here not. If I look now, I see that both displays are very different. Wait and see (the code in p.infobox is only 10 lines drama). Psemdel (talk) 03:29, 7 March 2019 (UTC)


After proposal of GAN, I create a function "Listofstagesclassification". It is clearly an alpha version. An overview:

Classement général
Meilleur grimpeur
Meilleur sprinteur
Meilleur jeune
Meilleure équipe
1re étape  Coryn Rivera  Coryn Rivera  Kathrin Hammes  Ellen van Dijk  Alba Teruel Ribes  Margarita Syrodoeva  Sunweb  Lisa Brennauer
2e étape  Elena Cecchininon attribué
3e étape  Coryn Rivera  Coryn Rivera  Tatjana Paller
4e étape  Lisa Brennauer  Liane Lippert
5e étape  Rozanne Slik  Lisa Brennauer  Trixi Worrack
6e étape  Alice Barnes  Liane Lippert  Jacqueline Dietrich
7e étape  Ellen van Dijknon attribué
Classements finals  Lisa Brennauer  Kathrin Hammes  Coryn Rivera  Liane Lippertnon attribué  Sunweb  Lisa Brennauer

So still several problems, that I can't solve:

  • In table "winners" the order of the columns is defined. In table columntable (line 5874) not anymore. I looked at help for sorting issue, made also some sortkey..but still don't work.
  •   Done Still some problem with the css: I don't want those white border, and I introduced a gray top border above the winner... it will be solved
  •   Done Here in the table, the "nationality" is not given for the final classifications.
  • Probably it is not as elegant as it should be.
  • The name can be discussed also.

So, don't hesitate to improve. When it has a correct quality, then only, we can put it on wikipedia. Psemdel (talk) 21:14, 5 March 2019 (UTC)

1. BAG. If the winner has a link to the source, then the module generates an error. Probably better to support the "links" than to suppress it. For example Tour Down Under 2019

Classement général
Classement par points
Meilleur grimpeur
Meilleur sprinteur
Meilleur jeune
Meilleure équipe
1re étape  Elia Viviani  Elia Vivianinon attribué  Jason Lea  Elia Viviani  Michael Storer  Patrick Bevin  UAE Team Emirates
2e étape  Patrick Bevin  Patrick Bevinnon attribué  Caleb Ewan  Matthieu Ladagnous
3e étape  Peter Sagannon attribué  Peter Sagan  Michael Storer  Manuele Boaro
4e étape  Daryl Impeynon attribué  Patrick Bevin  Chris Hamilton  Thomas De Gendt
5e étape  Jasper Philipsennon attribué  Ryan Gibbons
6e étape  Richie Porte  Daryl Impey  Patrick Bevin  Chris Hamilton  Danny van Poppel
Classements finals  Daryl Impey  Patrick Bevin  Jason Leanon attribué  Chris Hamiltonnon attribué  UAE Team Emirates

Is it possible to add a display of "links" for "Cycling race / listofinners"?


2. Make the T-shirt icons be with the new line as the USI code in the start list. If there is no T-shirt, then an empty space. That titles were visually in one line. Instead of "point" empty space

 Étape Vainqueur
Classement général
Classement sprints
Classement montagne
Classement jeune
Classement allemande
Classement équipe

3. Headings of classifications in the form of links with the ability to add clarification. And the possibility of a separate translation for headings classifications and the ability to add. Now they, if I am not mistaken, are taken from the list of headings for the final classifications, so that the displayed part can be reduced.

General or [[General classification (cycling)|General]]
If we add |title = G (or T = Tour de France, V = Vuelta a Espana) --> {{#invoke:Cycling race|listofstagesclassification|Q57082387|title = G}}
or through instance of (P31) --> Giro d'Italia (Q33861), Tour de France (Q33881), Vuelta a España (Q33937)
We get the following [[General classification (Giro d'Italia)|General]]
A visual example in the “picture” just above - general classification.

Further through the redirection, you can make the transition to the desired article. In some wikis now these headlines in Gran Tour races articles lead to the corresponding article about this nomination. Example

  Done With instance of (P31), ok. For the rest, I have nothing against it, but it is very complicated. With the old system, you can personalize what you want. Psemdel (talk) 18:36, 6 March 2019 (UTC)

GAN (talk) 11:26, 6 March 2019 (UTC)

So it is starting to be fine. Only the order of the column is still problematic in my opinion. Psemdel (talk) 03:21, 7 March 2019 (UTC)   Done Many thanks to Johnuniq who solves this problem on my request! Psemdel (talk) 20:15, 15 March 2019 (UTC)

At the same timeEdit

  • Cycling race/startlist

1. The coach does not display the latest team in the list. No matter how many of them are located in the last line - 1, 2 or 3. Although at the moment the coaches do not yet indicate in the templates. {{Cycling race/startlist|Q1129396}}

It worked, but I haven't tested for long. I will check.

2.The name of the discipline (RR or ITT) comes after the last T-shirt, and not the championship. {{Cycling race/startlist|Q55638555}} 1.NED Marianne Vos --> yellow shirt for RR

I would prefer it the other way, but then we would have to rewrite completely the function jersey (presently it list all jersey, and don't make difference if national or not). So I leave it as it is.
  • Cycling race/infobox

winner of the nationality classification (Q61976872) Add to template. To this winner not only in the list of leaders was present.

  Done I created the item Yesterday. So it is still not include. I do it. Psemdel (talk) 18:10, 6 March 2019 (UTC)

GAN (talk) 11:26, 6 March 2019 (UTC)


  • Listofstagesclassification. Can the lowest line-split (before the final results) also make a dark color? That on yellow-orange columns did not merge.
  • Bag. See how the winning teams of the stage are displayed:
OK --- fr:1re étape du Tour d'Espagne 2015
not OK --- fr:1re étape du Tour d'Espagne 2016, fr:1re étape du Tour d'Espagne 2017, fr:3e étape du Tour de France 2018
  Done Ok
@Psemdel: Name/Titles -   Done, Flag -   Not doneGAN (talk) 20:05, 7 March 2019 (UTC)
What is the problem with the flags?
@Psemdel: The flag does not match the country from which the team.GAN (talk) 20:32, 7 March 2019 (UTC)
You can just write it, I can't read in your thought.
  • Can you extend the functionality of these templates --> listofwinnerssecondpart and customclassification ?
  • listofwinnersChampsecondpart / listofwinnerssecondpart
{|class="sortable" cellpadding="4" style="border:1px solid rgb(200,200,200); color:black;margin:0 0 0.5em 0; padding:5px;  clear:left;font-size:95%; line-height:1.6em;background:#f8f9fa;cellspacing:0 2px;"
|- style=" text-align:center;"
! scope="col" style="background-color:#FFDF80;"|<span style="float:left">[[File:Wikidata-logo S.svg|12px|link=d:Q30332924#P527]]</span>Année
! scope="col" style="background-color:#FFDF80;"|12345
! scope="col" style="background-color:#FFDF80;"|Vainqueur
! scope="col" style="background-color:#FFDF80;"|Deuxième
! scope="col" style="background-color:#FFDF80;"|Troisième
|style="text-align:center;"|2015 || [[Jolien D'Hoore]] || [[Lotte Kopecky]] || [[Kelly Druyts]]
{{Cycling race/listofwinnersChampsecondpart|Q30332924|2016|XXXX
| above row 1: '''Destination Thy'''
| above row 3: '''Grand Prix Viborg'''}}

The ability to add not only before the template, but after it. By specifying the second year in the template |XXXX

|style="text-align:center;"|2020 || [[Jolien D'Hoore]] || [[Lotte Kopecky]] || [[Kelly Druyts]]
  • custompointsclassification / customtimeclassification
{{Cycling race/custompointsclassification|Q42158490|propriété=P4323|titre=Giro de Italia Femenino 2018

By analogy with the previous example, but only after the template. This will allow you to specify other places without displaying them in other wikis.

| 41 || [[Lotte Kopecky]] || [[Lotto–Soudal Ladies]] ||  + 30' 00'' 
I still don't know how to do that. And why don't you just write
|style="text-align:center;" colspan=3| '''Destination Thy'''
It would work the same.
If instead | align=center colspan="3" then in this case I took this code from some random pattern — GAN (talk) 20:32, 7 March 2019 (UTC)
  • Some templates may display a link next to the cyclist. Screenshot. A similar opportunity for listofwinners. Let all links go to the bottom of the article. Example below:
Année Vainqueur Deuxième Troisième
1948   Albéric Schotte[1]   Fermo Camellini   Gino Bartali
1949-1999 not conducted[2]
2000   Elia Viviani   Daryl Impey non attribué[3]
  Done It is the "reference" management. I can have a look.
Note that if you want to display the team in listofwinners, it is very easy to implement.
I managed to see the variant with the teams in your draft.   If only optional, via parameter. — GAN (talk) 20:05, 7 March 2019 (UTC)
I can do a function "listofwinnerswithteam" for those interrested. Psemdel (talk) 20:12, 7 March 2019 (UTC)

GAN (talk) 18:09, 7 March 2019 (UTC)


  1. That's so that you can display links to the winners.
  2. The reason is not known
  3. Or like this

Minor cleanEdit

I noticed some minor issues that may as well be cleaned up:

Line 5803
local WPcontent = {} --not used yet
Is the above going to be used? Perhaps delete the line?

Line 5971
local startTime, endTime = getStartEndTime(sTime, eTime)
Above line is not used. Should it be deleted?

Line 6018
local win, jerseytable= {}, {}
It might not be a problem, but the above replaces jerseytable that was created earlier.
ok, I correct.

Also, should this talk page be archived? If wanted, I could manually archive everything earlier than 2019. Johnuniq (talk) 07:15, 16 March 2019 (UTC)

@Psemdel: I archived this talk page. Do you have time to check/fix the above comments? Have you tried the module somewhere (frwiki?) Are the results good? Johnuniq (talk) 22:58, 17 March 2019 (UTC)
Thank you that you archived the talk page. I think most of the points archived are not anymore up to date. Still on going/open:
  • Finalization of listofstagesclassification, which is still new
  •   Done Listofstarter which can be hidden
  •   Done Not only "row above" WP content, but also "row below".
  • Clean up/structure/...

Yes, the module is implemented on several wikipedias and used on many pages. The French one is up to date, the others sometimes less, but in general It works pretty well (and if not we get quite fast a feedback :) ).Psemdel (talk) 19:20, 18 March 2019 (UTC)

That's good, thanks. I'll be elsewhere for a while but I plan to return and do some more cleaning. Johnuniq (talk) 00:02, 19 March 2019 (UTC)

Regular bugs and suggestionsEdit


@Psemdel: Answered below — GAN (talk) 22:41, 26 March 2019 (UTC)
@Psemdel: Answered below — GAN (talk) 00:37, 28 March 2019 (UTC)


show/hide --- SUPER.

1. I would suggest to increase the scale of the internal elements to 110%. Inside the collapsed block, the normal size decreases by about 10% and becomes smaller.
2. And what a yellow stripe over the first three teams when you deploy?
  Done Ok, I will have a look.
Or remove the frame on the sides and bottom during deployment. — GAN (talk) 22:41, 26 March 2019 (UTC)


1. If the official title is not indicated, then the title of the article on the WD is displayed with the year specified. Previously, in this case it was displayed without a year.
I made a modification, I hope it has no side effect.
2. If in the list participating team (P1923) the main page of the command is indicated, and not for a specific year, then writing on the class of commands does not work correctly. The first parameter entered on the WD is used.
2.1. with country of registration too
Example Milan-San Remo 2008. The Groupe sportif category was no longer existing this year. See ru-wiki and fr-wiki. {{#invoke:Cycling race|listofteams|Q930215}} or {{Cycling race/listofteams|Q930215}} and Milan-San Remo 2005 {{Cycling race/listofteams|Q2555793}} --> Naturino-Sapore di Mare from Switzerland in 2005.
I will check, it seems that you are right, but somehow I don't understand why it does appears in 2008 but not in 2018.
After check: in participating team (P1923) you should indicate the season of a team, not the team itself (so Miche 2008, not Miche)! Before the creation of the property "season", it was impossible to differentiate both, so we had to choose. To sum up: fill correctly the item then it will work!
I know that you need to specify the team for a particular year, and not the main article. But until 2008, the seasons are not created for all teams. And the farther back so that they become smaller.
I have done races (Milan – San Remo) since 1989 (the beginning of the UCI Road World Cup) and I am not physically able to create 10 teams for each year. :( — GAN (talk) 22:41, 26 March 2019 (UTC)
I understand that it be easier, but this module can't work without a database halfway filled. I spend also much time filling the database. As long as not all seasons are with P31 "season", it is difficult to differentiate with certainty if it is the team or a team season (and it makes many "if"). I note it but won't act now. Psemdel (talk) 22:24, 27 March 2019 (UTC)
The creation of all teams for all years will take time, I agree. But it is the only way to be clean. You are not alone, goal of this module is to mutualize the work from all countries. You can start the work. (and for your information, I am doing the same for the women with flèche wallonne, and I also have to create 10 teams for each year).Psemdel (talk) 22:38, 27 March 2019 (UTC)
Maybe a lamer question. If in the list of teams you specify the main article about the team (and not for a particular year), the module correctly displays the official name of the team for each year (the time frame for using this name is indicated). For the team category and the country of registration, the time frame is also specified - but the module does not process them. For a rider, the module of his country of nationality (flag), taking into account the specified time frame, is processed normally.
2013 Katusha (Q13411156) The team during the season of 2013 had two catagorias at once. She did not take part in the “Tour Down Under 2013” ​​race (when she was Procontinental). Perhaps this is the only case. --> fr:Utilisateur:GAN/BrouillonGAN (talk) 00:18, 28 March 2019 (UTC)
Right now it works as following:
  • We know that the item read is a season. If name --> display name, if no name then look in parent (so the team) for the name at the right time. Of course, we can look also in the season for the right time, but normally it is always the right time and it makes only the function more expensive in cpu time/memory (I can test it). Moreover, if we don't know if the item is a season or a team, then the whole logic with the parent doesn't work anymore (the team has no parent). I really fear that this tolerance leads to some chaos. Let's take a concrete example, Paris-Roubaix 1996. There is no item Mapei 1996, so you insert Deceuninck-Quick Step. Let's assume official name is not filled for 1996. As the module try to avoid an error, it display the label of the item and then we have Deceuninck-Quick Step that participates to Paris-Roubaix 1996!! Right now this risk almost doesn't exist. Let's stay rigourous. We invest today 1 hour more, but tomorrow we save much time because everything is in order. Psemdel (talk) 22:31, 28 March 2019 (UTC)

classification after stage or full raceEdit

If no points are indicated or time is possible, the template gives an error. There are cases when winners are known in some final classification, but their result is not known.
Do you have an example here it works [1].
So any classification by points (not time). Indicate the rider and his place, without specifying the points scored and the module will give an error. — GAN (talk) 22:41, 26 March 2019 (UTC)
  Done Ok. Actually, it is if you forget the rank that it fails/failed.


The racer was disqualified. To display this line in the list for convenience, and there was no question that someone forgot to specify it. It was only possible to do this. How correct is this? Or see fr-wiki {{#invoke:Cycling race|stageclassification|Q59975520}} or {{Cycling race/stageclassification|Q59975520}}GAN (talk) 21:47, 25 March 2019 (UTC)

Ok. Edit: I really thought that there was a possibility to disqualify a rider with the module, but obviously it is not implemented. I will add it soon. Psemdel (talk) 20:37, 26 March 2019 (UTC)
There are three options for disqualifications for visual display.

1. Place was left empty / vacant -> empty line with number
2. We moved everyone up one position -> empty line without a number.
3. Removed the winner -> empty line without a number in front of # 1.
Can these riders display a light gray color, along with their result? In order not to suffer with footnotes and notes. And instead of the place number to display the DSC — GAN (talk) 22:41, 26 March 2019 (UTC)

We normally use rider name for this purpose. How do you display a footnote/note right now. In women cycling, almost nobody is disqualified, I have to learn. Psemdel (talk) 22:27, 27 March 2019 (UTC)
fr:Tour_de_Catalogne_2011#2e_étape - Redistribution of places. Name is displayed. Classement général. Contador is deprived of the 9th place (there is a line), then go 9 and 10 places. Similarly, the following stages where he occupied the 1st place.
fr:Paris-Nice_2016#6e_étape - Without redistribution of places. The name is not displayed and you need to follow the footnote. 6th place on the stage and 8th place in the general.
Or look Tour de France from 1999 to 2005 when Armstrong was disqualified. — GAN (talk) 00:32, 28 March 2019 (UTC)
 Classement de l'étape
1erAlberto Contador   EspagneSaxo Bank-Sungard4 h 45 min 31 s
1erMichele Scarponi   ItalieLampre-ISD+ 23 s
2eLevi Leipheimer   États-UnisRadioShack+ 23 s
3eDaniel Martin   IrelandGarmin-Cervélo+ 35 s
4eChristopher Horner   États-UnisRadioShack+ 35 s
5eAlex Cano   Colombie+ 35 s
6eIvan Basso   ItalieLiquigas-Cannondale+ 38 s
7eRigoberto Urán   ColombieSky+ 38 s
8eXavier Tondo   EspagneMovistar+ 38 s
9eCadel Evans   AustralieBMC Racing Team+ 50 s
 Classement général
1erAlberto Contador   EspagneSaxo Bank-Sungard13 h 05 min 55 s
1erLevi Leipheimer    États-UnisRadioShack+ 23 s
2eMichele Scarponi   ItalieLampre-ISD+ 23 s
3eDaniel Martin   IrelandGarmin-Cervélo+ 35 s
4eChristopher Horner   États-UnisRadioShack+ 35 s
5eRigoberto Urán   ColombieSky+ 38 s
6eIvan Basso   ItalieLiquigas-Cannondale+ 38 s
7eXavier Tondo   EspagneMovistar+ 38 s
8eCadel Evans   AustralieBMC Racing Team+ 50 s
9eBauke Mollema   Pays-BasRabobank+ 1 min 12 s

 Classement de l'étape
1erIlnur Zakarin   RussieKatusha4 h 45 min 11 s
2eGeraint Thomas   Royaume-UniSky+ 0 s
3eAlberto Contador   EspagneTinkoff+ 1 s
4eRichie Porte   AustralieBMC Racing Team+ 7 s
5eSergio Henao   ColombieSky+ 10 s
6eSimon Yates   Royaume-UniOrica-GreenEDGE+ 10 s
7eRui Costa   PortugalLampre-Merida+ 31 s
8eRomain Bardet   FranceAG2R La Mondiale+ 31 s
9eIon Izagirre   EspagneMovistar+ 31 s
10eTony Gallopin   FranceLotto-Soudal+ 31 s
Source : ProCyclingStats
 Classement général
1erGeraint Thomas    Royaume-UniSky24 h 10 min 26 s
2eAlberto Contador   EspagneTinkoff+ 15 s
3eIlnur Zakarin   RussieKatusha+ 20 s
4eRichie Porte   AustralieBMC Racing Team+ 21 s
5eTom Dumoulin   Pays-BasGiant-Alpecin+ 32 s
6eIon Izagirre   EspagneMovistar+ 37 s
7eSergio Henao   ColombieSky+ 39 s
8eSimon Yates   Royaume-UniOrica-GreenEDGE+ 44 s
9eTony Gallopin   FranceLotto-Soudal+ 51 s
10eRomain Bardet   FranceAG2R La Mondiale+ 1 min 00 s
Source : ProCyclingStats

 Classement général
1erLance Armstrong   États-UnisUS Postal Service91 h 11 min 32 s
2eAlex Zülle   SuisseBanesto+ 7 min 37 s
3eFernando Escartín   EspagneKelme-Costa Blanca+ 10 min 26 s
4eLaurent Dufaux   SuisseSaeco-Cannondale+ 14 min 43 s
5eÁngel Casero   EspagneVitalicio Seguros-Grupo Generali+ 15 min 11 s
6eAbraham Olano   EspagneONCE-Deutsche Bank+ 16 min 47 s
7eDaniele Nardello   ItalieMapei-Quick Step+ 17 min 02 s
8eRichard Virenque   FrancePolti+ 17 min 28 s
9eWladimir Belli   ItalieFestina-Lotus+ 17 min 37 s
10eAndrea Peron   ItalieONCE-Deutsche Bank+ 23 min 10 s

@GAN:, is it ok? I used P1534, if there is a better idea, it can be easily changed. References can be given but the number is crossed :/. Psemdel (talk) 17:39, 15 April 2019 (UTC)

But there is one moment. At Giro 2009, the 2nd, 3rd and 9th places were immediately disqualified in the general classification. Now the drivers in the table are in places, not in time. That is, the 4th became the 2nd, and the 5th became the 3rd. How often such a situation can be difficult for me to say. It is necessary to ask more knowledgeable.

Can there be a similar opportunity to display disqualified and for all templates (list of winners, race card)? Instead of the current "missing."

As a user I can suggest the following for similar situations:

- arrange the places in order and not pay attention to inconsistencies
- get out for disqualified instead of DSQ
- make support series ordinal (P1545) through which it will be possible to indicate the desired location for display. The parameter ranking (P1352) is specified in order for proper sorting. in the table

And what is better / easier to implement, choose yourself as a programmer.

At the same time as an option for another addition to the result tables.

GAN (talk) 11:37, 17 April 2019 (UTC)

We can put the same for other functions, it is no issue. For the suggestion, I don't get it. We don't sort the places. They are displayed in the order you give them. Psemdel (talk) 11:56, 17 April 2019 (UTC)
@Psemdel: Places are sorted automatically. In the data for the general classification, the order of places is 1-2-3-2-3-4. In table 1-2-2-3-3-4. See screenshot (talk) 12:23, 17 April 2019 (UTC)
My mistake, sorry. You are right. Psemdel (talk) 17:11, 17 April 2019 (UTC)


The template displays the riders if in parameter winner (P1346) - stage winner (Q20882747) and overall leader at the end of the stage (Q20882763) are indicated. But sometimes in the last stage of the leader indicate overall winner general classification (Q20882667) as a result, this driver is not displayed. — GAN (talk) 19:53, 28 March 2019 (UTC)

Yes, because it is wrong. I can add a "or", but I would prefer that people fill correctly this f****** database. Psemdel (talk) 22:42, 28 March 2019 (UTC)

@Psemdel: About the disqualified unsubscribed a little higher.

Can you make this template listofstagesallflag so that it displays flags at all starting and finishing places? You have already added this feature to the module (used here). It is necessary for races that are officially held in several countries at once. First of all for fr:Eneco_Tour_2016.

That was the risk with the display of flag only if different, I mentioned it before. I based on GT. For Eneco, yes an option could be fine.

Proposal for start point (P1427) and destination point (P1444) to add the possibility of location (P276). so that you can add a clarification for the starting and finishing places. And in the template display as Paris (Champs Elysees) or Champs Elysees (Paris), Roubaix (Vélodrome André Petit) or Vélodrome André Petit (Roubaix).

What? If you don't know where is champ Elysees, you should click on the link. It is the principle of Wikipedia.
Where are the Champs Elysees, I know. There is more like an opportunity to indicate a general and specific place for the start and finish at the same time. How to do it even on the sites , or (talk) 12:42, 17 April 2019 (UTC)

Purely mathematical addition. We indicate the distance of the stages and the time of the winner. Based on these data, you can automatically display the total distance and the average race speed.

Could be added, but it is as the number of participants. It can be only a solution to determine the number and then add it in the database. Those functions are quite expensive, and should be replaced as fast as possible with the present function (read fields --> done). Psemdel (talk) 11:51, 17 April 2019 (UTC)
  Done I added the total distances and the speed. Psemdel (talk) 08:10, 28 April 2019 (UTC)

GAN (talk) 11:40, 17 April 2019 (UTC)

Later disqualificationEdit

What to do when a winner is disqualified long after the event? Leonardo Bertagnolli (Q538622) is the stated winner of 2006 Tour du Haut Var (Q2488267), but according to he much later became disqualified for 01.01.2003-18.05.2011 due to biological passport. Should that be marked in 2006 Tour du Haut Var (Q2488267), and how should it be presented in listofwinners? --Dipsacus fullonum (talk) 15:08, 9 May 2019 (UTC)

I suppose a name and a note (reference) would be the best. Psemdel (talk) 18:29, 12 May 2019 (UTC)

Cycling race/stagetitleEdit

Hi friend. I suggest to create some kind of "Cycling race/stagetitle" in order to use info from Wikidata to generate a "stagetitle" in wikipedia articles to give better information about stage and GC classifications (not just put stage classification and GC classification with no more info) like we implemented manually at ES-Wiki (example: HERE. Are you agree? It is easy for you create it? Regards. Repf72 (talk) 17:50, 19 April 2019 (UTC) @Repf72:, I recognize the English way to display the stages :). Yes, it is possible to implement it. It will be done. Psemdel (talk) 07:17, 20 April 2019 (UTC)

Thank you friend. If you prefer format: "<From> - <To> <StageProfileLogo> <(xxx Km)>" maybe it could be better than format I currently use, due it is the order shown at "listofstages", so I do not have problem replacing with the new format. Regards. Repf72 (talk) 19:21, 21 April 2019 (UTC)
@Repf72:. It should works. Psemdel (talk) 19:44, 12 May 2019 (UTC)

Number of riders in classificationsEdit


On Topic:V0p4gqejrlhllbto, we were talking about the number of cyclists that had to be mentioned in the rankings. Where was a decision made on a maximum of 10 riders in the rankings? Can I restore my changes to Q57991628?

Thanks, Aabbccddeeffabcdef (talk), the 16:43, 30 May 2019 (UTC). (If possible answer in French).

  • Tables with a large number of rows stretch the article. Not all wikis use separate articles for each stage on Grand Tours. For the final general standings display the first 20 may still be relevant. But the best option would be to do so (ask the user Psemdel  ) for the module to collapse the lines starting with the 11th if it does not appear on its resources. — GAN (talk) 07:54, 31 May 2019 (UTC)
@Aabbccddeeffabcdef:, yes it should be technically possible to display only the 10 first with an option. However, I don't know, why do we want to insert the top 100? We are not procyclingstats, but an encyclopedia, we should not care about details. I can unstertand for world championships and GT but otherwise 10 should be enough. Psemdel (talk) 20:12, 2 June 2019 (UTC)
I agree with Psemdel, there are many questions about this issue: Why to put more data in Wikidata due main purpose is feed wikipedia's articles? More than top-10 or top-20 is not relevant considering we always left sources for more details and Wikipedia is a general enciclopedia, not a cycling portal, not a sports portal (why cycling should include all positions and not tennis, atletism...?). Who decide how many positions can be data filled for every race? Who are going to rebuild thousands races to add more information for have data consistency? Because there is no case having top 100 for only one stand alone edition or for only for one stand alone stage (like stage 18 of Giro 2019) (and who are going to do it?), and the rest editions or stages with only top-10. Who are going to develop changes in code to having compatibility for all Wikipedias? Because we can not just ignore relation between Wikipedias and Wikidata (by "Cycling race module") and just add more information. Who are going to edit hundreds races in all wikipedias if the changes implies adding new parameters (for example to limit races to top-10)? Repf72 (talk) 13:23, 4 June 2019 (UTC)

Property suggestion based on UCI IDEdit

I belive that there has been a suggestion to add UCI ID as a WD property before, but I don't think that anything happened. One problem is that there is no page on the UCI website that we can send it to, so it really has very little use in that way. But I had a little look at how it's made up, and maybe we could rather make a property that is directly derived from the UCI ID, which the UCI website will receive.

Just as an example I use Edvald Boasson Hagen (Q333351). His UCI ID is 10019821326. So to break it up a bit, I believe that the first digit (1) is only there for the sole reason to avoid all the leading zeroes to be cropped by different spreadsheet software like Excel, etc., so this is not really needed for us. Then, the last two digits (26), I have absolutely no clue what they do, but I have come to the conclusion that they must be some kind of control digits. At least, for our purpose they can be discarded. This means that the actual serial number part, the true ID, is 00198213, or if we cut the leading zeroes: 198213. And now we have an ID that we absolutely can use on the UCI website.

This shows the full registered name of the rider, the birthdate and the UCI teams the rider has had a contract with. This also goes for all other team members like sporting directors, etc.. It shows contract dates, and when we use the parameter "&showFunction=True", we can also see what function they have in the team. This is useful to see when riders have changed to sporting directors in the same team the following year. Even if this is supposed to show riders that are part of UCI teams, it can actually be used on absolutely everybody who have a UCI ID. On other people we only get the name and the birthdate, but that's also quite useful on lesser known riders.

You may have seen on the above link that we only see data since 2017. That is unfortunately because of some kind of flaw in the system, or rather more like a flaw in how data are stored. Even if Edvald didn't change his name, the way his name was stored was changed from the old registration to the new one for the UCI ID. Earlier, he was registered as having a double family name (Boasson Hagen), but now he is registered as having a single family name (Hagen) and a middle name (Boasson). His old ID with team history all the way back to 2006 can be found here:

Anyhow, these are issues we can get past. Either we only use the ID that is after introduction of UCI ID in 2017, or we make some kind of system with preffered/deprecated values when there are more than one ID per person. It also seems that these IDs are based on an older system than the UCI ID, so all people that weren't "renamed" with the UCI ID, still have their old ID as part of the UCI ID. We can use this for people who are too old to have a UCI ID too, we just find their ID in the team member lists for older seasons. Another kind of issue is that the URL is based on what discipline you are viewing, and there seems to be no neutral one. Anyhow, I guess that 90% of all uses of this will be fore road cycling anyway, so no need to worry about it. The content is the same anyway, only the menu, title and colours are slightly different.

So, should we make a property proposal with$1&showFunction=True as the URL for these IDs? And what should it be named, if we don't name it UCI ID? I could try to make a property request, but I don't know if I'm any good at it. Bergenga (talk) 20:54, 4 June 2019 (UTC)

Suggestion for secondary classificationsEdit

Hi friend @Psemdel: I am trying to apply "listofpointswinners", "listofmountainwinners", "listofyoungwinners" and "listofwinnerswithteam" but due they generate separate tables, they are not useful to large races (like Tour, Giro, Vuelta...) because articles could be very very long puting and could be not easy to read. I suggest some function like "customsecondarywinners" in order be able in a similar way that "customcalendar" to chose and join classifications to build one unified table and make it easy to deploy. Repf72 (talk) 13:43, 5 June 2019 (UTC)

@Repf72:, sorry I have not been on this page for a long time. What you ask already exists, at least partly. See custompointsclassification (and the same with time). Can you specify more precisely what you mean? Do you have an example for "because articles could be very very long puting and could be not easy to read"... Psemdel (talk) 21:19, 6 August 2019 (UTC)
@Psemdel: Perhaps this table is meant, but with the ability to select the displayed classifications (talk) 21:33, 6 August 2019 (UTC)
Ok, I was thinking of something else. It can be done. Psemdel (talk) 21:38, 6 August 2019 (UTC)
  Done, see [Modèle:Cycling race/listofwinnerscustom/Documentation listofwinnerscustom] or "Tour d'Italie féminin", the function is listofwinnerscustom. The other functions, like listofpointswinner are not needed anymore (it is just a special case covered from custom). I changed the French model, if you don't use them on other wiki, I could delete them. Psemdel (talk) 16:03, 10 August 2019 (UTC)
@Psemdel: Thanks a lot :D. Repf72 (talk) 17:12, 10 August 2019 (UTC)
The original remark was very just. It was not really usable. Psemdel (talk) 20:10, 10 August 2019 (UTC)

Bug: Nationality winner crashes the stage infoboxEdit

It seems that the stage infobox can no longer cope with leader of the nationality classification (Q61976871)/winner of the nationality classification (Q61976872) and any other winner type that is not pre-defined in the code.

Instead of showing the infobox, it only returns the following error message: "Lua error in Module:Cycling_race at line 3679: attempt to index field '?' (a nil value).". I tried looking in the code, but there doesn't seem to be anything relevant on line 3679 as far as I can see. Could it be trying to call an array index that doesn't exist, or something like that?

If it finds a winner in the list that it doesn't know how to display, it should rather only display a local error message or nothing at all at that position, not "explode" with only an error message like this, as there could probably be some other local winner items that may not be interresting to display in all cases, but users would want to add anyway.

Here is an example code from Ladies Tour of Norway 2017, where Susanne Andersen was best Norwegian rider:

{{#invoke:Cycling race|stageinfobox|Q29862934}}

Bergenga (talk) 12:00, 8 June 2019 (UTC)

I've realised that nobody's going to fix this bug in several months, so I've had to remove the nationality leaders/winners on stages where the stage infobox is used, to avoid showing articles with error messages any longer. It's just to revert my removals before debugging. Bergenga (talk) 20:42, 4 July 2019 (UTC)
@Bergenga: I have fixed the crash at nowiki, but the function p.stageinfobox really needs a more thorough update. There are other places where it can crash if indata isn't as expected, and it is slow and generally could be coded better. --Dipsacus fullonum (talk) 18:24, 6 July 2019 (UTC)
Thanks for fixing this, @Dipsacus fullonum:! Now I can add or re-add these to other articles where it would crash. I guess someone should rewrite the code some time, but now it can wait until nights are darker, as there isn't anything crashing at the moment.
If rewritten, it would be nice if functionality was added so that it will take the values (race time and points) from the other classifications too, not only the stage and general classifications. (I know that this was initially not implemented because the other classifications were stuck in property proposal limbo for quite some time, but it seems it was never added later.) Bergenga (talk) 18:49, 6 July 2019 (UTC)
As written above, I haven't read this page for a long time. Sorry to hear about your issue Bergenga... For "stageinfobox", I confirm that it is a mess. When I introduced the "Dipsacus fullonum" changes in it, I also thought about rewritting it. But I don't even really understand, how it does work now.. For example the "t_s[t_P642[qual][1]][t_P642[qual][2]][1]" and the "t_s[value_order][value][4]" are not obvious to me. So I agree for a change. I would also prefer to realize big changes during the winter, as now we are all buzzy filling the results for the season. Psemdel (talk) 21:26, 6 August 2019 (UTC)

Countries that are no countriesEdit

I noticed increasing problem with "sport nationality" that are no country. For instance: Hong Kong, Scotland, Porto Rico... Up to now, I inserted simply "Hong Kong" in country (P17). There are however bots like KrBot, Trilotat,... that "correct" these false countries. I can of course write to all those bots, but I have the clear impression that it will come back every 2 weeks again. I was thinking to use country for sport (P1532) to handle the problem. So one more if loop in the code, it was too easy... Has someone a better idea? Psemdel (talk) 21:34, 6 August 2019 (UTC)

I support. Since in addition to the "Countries that are not countries" the rider may have several citizenships at once. But he stands for one of them. Example Pavel Sivakov (Q26206919) I periodically fill this parameter using the plug-in in the ru-wiki, though without specifying a time frame — GAN (talk) 21:49, 6 August 2019 (UTC)
A good point, an idea to handle that? Psemdel (talk) 21:02, 7 August 2019 (UTC)
Better as now with ordinary citizenship. Through the addition of start time (P580) and end time (P582). As an example for the test, I can offer Marc de Maar (Q1892905) - he has the usual citizenship Kingdom of the Netherlands (Q29999). And sports were 3 or 4 (source or Olga Zabelinskaya (Q266686) as a lover of women's cycling - she has already set the date of change of sports citizen — GAN (talk) 08:57, 8 August 2019 (UTC)
Olga Zabelinskaya works pretty well I think. For all races before 08/2018 she is Russian and afterwards Ouzbek, or you noticed an issue? Psemdel (talk) 19:32, 9 August 2019 (UTC)
I mean, on these races it will be possible to test the withdrawal of the country by the module through country for sport (P1532)GAN (talk) 19:40, 9 August 2019 (UTC)

UCI Pro/World TourEdit

@Bergenga, Dbastro, Douglasfugazi, Hejsa, Mr. Ibrahem:. @Papuass, Parabarchan, Pcm, Repf72, YoaR:. I pinged those I noticed in using the module. Except the French. There are many of them, I wrote to them separately.

I contributed approximately 80-85% to Wikidata for all the multi-day races (not Grand Tours) that have been part of these tournaments UCI ProTour (Q1329578) / UCI World Calendar (Q12270097) / UCI World Tour (Q635366) since 2005. Including those released for the 2008 season.


  • All participating teams, each in the form of an annual element.
- on Tour Poland 2008-2010, he used Bank BGŻ (Q65457000) (analogous to UniSA-Australia (Q2610824)) as a team with a sponsor name
  • The calendar

He took as a basis a calendar on it wiki. It was easiest to handle in Excel (start and finish cities are separated by ">"). Made the following changes.

- A more accurate start and / or finish location
- If the stage was shortened, it indicated the relevant data after the change.
- If the winner or leader was disqualified and the places passed to the next, then he indicated the new owners
- If the winner or leader was disqualified, and the place was empty, then he indicated those disqualified. I did not want to leave empty lines. Perhaps it will be possible to cross out them with a module.
  • Stage results
- Based on data in en-wiki or fr-wiki
- for each stage, the first 10 riders, including disqualified ones, are indicated
- all disqualified ones appear crossed out with the current version of the module
- places indicated taking into account disqualifications
- all time intervals are relative to the first position. Regardless of whether the winner of the stage / leader of the general was disqualified or not
- at some stages the rider may have a strange time, then the answer should be in the en-wiki or fr-wiki article as far as I remember
- The general standings for the entire race are now in the last stage
- jersey indicated:
- for all leaders of the general classification
- minor jerseys only in those where I could be sure of its color with a large percentage (%), it was in the results in the article and there were no discrepancies in the name of the classification. The problems could be as follows:
- plain or striped jersey in the Vuelta of Catalonia.
- different Wikis have the same color for the same classification
- in different Wikis, the same classification differed in its name. This applies mainly to Spectacled / Sprint / Intermediate finish / Fight. This is very relevant for the new listofwinnerscustom template.

NO (need / can do)

- minor classifications
- for some races indicate follows (P155) and followed by (P156)
- indicate in separate lines the winners according to the results of the race in each standings with an indication of jersey. If the rider won two classifications, then he must have two separate entries. Then it will be possible to do "Cycling race / listofstagesclassification |" for each race and at the same time "Cycling race / listofwinnerscustom"
- lineups for the race. From 2005 to 2010, the teams for which the rider played were indicated in about 50% of the crews present. Since 2011, approximately 85%

EXCEL Tables with which I prepared data for quickstatements with all the "Q" races, stages, teams. The tables are given a small explanation in English (located on a bright yellow background). In the list of riders, the priority language is Spanish, as Repf72 gave them to me.

GAN (talk) 11:44, 15 August 2019 (UTC)

Suggestions and commentsEdit

@Psemdel:  GAN (talk) 12:05, 15 August 2019 (UTC)

Classifications of stage and general after stageEdit

- Add time gap (P2911) support for first place in general classification of race participants (P2321). It used to be.

If the winner is disqualified in order not to forward all the lag intervals that are given regarding him. At the moment, in such cases, a void is displayed. See an example.

 Classement général
1erAlberto Contador   EspagneSaxo Bank-Sungard13 h 05 min 55 s
1erLevi Leipheimer    États-UnisRadioShack+ 23 s
2eMichele Scarponi   ItalieLampre-ISD+ 23 s
3eDaniel Martin   IrelandGarmin-Cervélo+ 35 s
4eChristopher Horner   États-UnisRadioShack+ 35 s
5eRigoberto Urán   ColombieSky+ 38 s
6eIvan Basso   ItalieLiquigas-Cannondale+ 38 s
7eXavier Tondo   EspagneMovistar+ 38 s
8eCadel Evans   AustralieBMC Racing Team+ 50 s
9eBauke Mollema   Pays-BasRabobank+ 1 min 12 s


Further ideas / wishes

for classification templates based on the results of a stage / raceEdit

make it possible to dismiss the teams instead of the clubs for which the riders in this race played. So that, for example, at World Championships or other races where only or mainly national teams compete (2018 Tour de l'Avenir (Q51285462)) not to register for each rider member of sports team (P54) For example, through the parameter "team = 1".

And links for national teams can be made to the respective cycling federation or country. The result should be a universal template for cycling at the national team level.

In French, most of the national teams are already linked. I am also working now on national teams. We could actually do an option. Psemdel (talk) 21:17, 15 August 2019 (UTC)


There are some ideas for roasters for the race.

- Here is a variant of the template for TTT racingéquipes_de_l'Open_de_Suède_Vårgårda_2012

to use on a one-day TTT. The conclusion can be made through "roster = 1, flag = 1"

the “flag” parameter is needed so as not to display the flag in front of the rider if the teams participated in the race. For example World Championship. The font size for riders can be made smaller.

From my point of view, there are 2 TTTs every year (and with the World championship cancelled...) so I am not planning to invest much time on it. We can do something manually one or twice a year.


-And how to remove the display of teams from the riders? Very much because of this, the pattern increases in width (less compact).
Small mistake, was not voluntary.
-Now an empty line may mean that there is no winner or he is not known. If you simply add for example declared deserted (Q45123627) if this nomination has not been played, then the same value will be displayed in the Cycling race / infobox which is not good
And what should we write, "not attributed"? "-"? On a website like CQ, it is left blank, I don't really see the problem.
- Add the "points" parameter to the manual


-Can I make a separate translation element for the "general classification" column? He is the only one in whose name is the word "classification" and ru-wiki it turns out very long.
Just go line 2576 of the code, and replace "general classification" through whatever you want. I will affect only listofstagesclassification normally.
-similarly "listofwinnerscustom" make it possible to display the desired columns.
Here, I didn't wanted to write everything again so I used "infobox_translate". The short versions are already present in "listofstagesclassification_translate". I should probably create "listofwinners_translate". Will be done... once. Psemdel (talk) 21:38, 15 August 2019 (UTC)


An overlock based on two. Appearance from TIMROSTER, but

- add column No. to the beginning
- add the column "result" to the end
- command to display the current
- if, instead of the date of birth, the age of January 1 of the year of conduct is generally good
- jersey

A good table for a single article with the ability to sort by any criterion.

I never saw a startlist like that. I also fear that the display of the birthday will make explode the expense of the function. It is a variation of startlist, it can be done, but I am not very motivated to do that. Psemdel (talk) 21:41, 15 August 2019 (UTC)
It seems to be a need for such a function for very old races where the numbers for the riders of one team are not successive. Maybe in winter... Psemdel (talk) 15:36, 21 September 2019 (UTC)


What are these championship listings for?

I am presently determining if a jersey is a national jersey through the label in French from the jersey... which is awful, consume some resourses, and lead to failure if someone change the label. With the listing of all national champs, it is quite easily solved and consume no more resourse. I just need a bit of time to complete this list, but normally the countries don't change so often, once done it is done. ~



  • I entered on Wikidata all the winners of the World Championships of categories A (Q506424) and B (Q2466565) (not completely only women U-19 RR and ITT) without TTT. Template listofwinners the year turns into a link if an article about the race for this year is created. It can be done so that if there is no article on the race there is a link to an article on the World Championships for a given year. How is it done in the template calendar?


It would only concern the race that are a world championship, then we should get the link of part of (P361). Only issue here is that there is no clear class for the world championship. We use CDM (Q23015458) but it is also for the world cup... Psemdel (talk) 19:40, 6 October 2019 (UTC)
QQQ-racing World Championships

== A ==
=== M - RR ===
{{Cycling race/listofwinners|Q13603535}}
=== M - ITT ===
{{Cycling race/listofwinners|Q2557477}}
=== M Am - RR ===
{{Cycling race/listofwinners|Q1750741}}

=== M U-23 - RR ===
{{Cycling race/listofwinners|Q2610391}}
=== M U-23 - ITT ===
{{Cycling race/listofwinners|Q2404958}}
=== M U-19 - RR ===
{{Cycling race/listofwinners|Q3652330}}
=== M U-19 - ITT ===
{{Cycling race/listofwinners|Q40769365}}

=== W - RR ===
{{Cycling race/listofwinners|Q934877}}
=== W - ITT ===
{{Cycling race/listofwinners|Q2630733}}
=== W U-19 - RR ===
{{Cycling race/listofwinners|Q3652329}}
=== W U-19 - ITT ===
{{Cycling race/listofwinners|Q17147490}}

== B ==
=== M - RR ===
{{Cycling race/listofwinners|Q69639167}}
=== M - ITT ===
{{Cycling race/listofwinners|Q69639169}}
=== W - RR ===
{{Cycling race/listofwinners|Q69639191}}
=== W - ITT ===
{{Cycling race/listofwinners|Q69639194}}

GAN (talk) 13:17, 4 October 2019 (UTC)

New relevant propertyEdit

cumulative elevation gain (P7297) was created recently. It seems that we can use it for races and stages. --Papuass (talk) 19:47, 16 September 2019 (UTC)

Top! It was clearly missing. Psemdel (talk) 15:34, 21 September 2019 (UTC)

Red links on nowikiEdit

Jonas Koch (Q20872345), Quinn Simmons (Q66417354), Carlos Barbero (Q12156396) and Jannik Steimle (Q22806856) are all turned into a red link in nowiki when used in this module, while the other riders without an article are not linked (black). What's the cause of this difference?--Pirker (talk) 16:21, 29 September 2019 (UTC)

Black is for homonymy. Psemdel (talk) 19:35, 6 October 2019 (UTC)
It seems I have found the answer to this very odd behavior. In the classification templates, all names are black (no redlinks) if the person has no article in nowiki. But for these exact persons they were showing redlinks, for no apparent reason. I have seen on some wikis that the redlinks have been present because there is a WD label in the wiki's language, but this has never been the case with nowiki. But just now I realised that this was because somebody had added labels in the language "no" (norsk), while others don't have. The language used on nowiki is "nb" (norsk bokmål), not "no".
This really means that the absense of redlinks is a bug, but I honestly prefer it that way. Perhaps it would be right with redlinks on top three, but I just can't see why all top ten riders on UCI 1.2 races or similar should be automatically notable for articles in all languages. Redlinks are after all there to suggest notability and to encourage people to add articles, but redlinks should not be there when notability isn't obvious. (This is obviously just my personal opinion.) Bergenga (talk) 18:43, 19 October 2019 (UTC)
Yes, I also observed today, that the display of name and link is still not perfect... Some more testing to do. In WP:fr we have the opposite problem actually, there is almost always a label and we can't really detect what happens when there is none. Psemdel (talk) 18:34, 26 October 2019 (UTC)
After looking at the code, I confirm that if there is a label in the language then we return "[[ lable ]]" and if there is no label in the language, only label (as we don't know how it should be called). I don't see how we can call it a bug. The test if it is a top 3 would make the code unnecessarily complex I think. Psemdel (talk) 12:22, 4 November 2019 (UTC)

Rider rankingEdit

I use wikidata to display the UCI ranking of the riders for each team in the team articles. However, the UCI ranking in the rider articles is still displayed manually. To insert the ranking in wikidata, I propose using participant of (P1344), like here: Lorena Wiebes (Q40853827). Any better idea? Psemdel (talk) 19:27, 4 November 2019 (UTC)

@Psemdel: Use ranking (P1352) directly as a property, as it is in tennis players. Look Q10132#P1352. Amadalvarez (talk) 05:32, 29 November 2019 (UTC)
Too late, I implemented it for all women. In every case, it is not possible to present it the same way as in tennis: 1st there are several ranking in cycling, so it should be rank/25/from/uci/in 2018... would be not so elegant. Psemdel (talk) 21:45, 29 November 2019 (UTC)

install combativeclassificationEdit

Hi, in cawiki we already work with this module, but now it faults combativeclassification. As I'm not used with installation of this module, I'm not sure how to proceed. Do I refresh completely the module:cycling race ?, do I copy just the function combativeclassification ?, any other action?. Sorry I was not the person in charge to install and do not want to break anything. Thanks, Amadalvarez (talk) 05:39, 29 November 2019 (UTC)

The process is to have the same code on every wiki, so copy everything. When you do though, it is a good idea to open several articles to see, if there is no surprise. That's why the copy is not automatized, as I wouldn't check every wiki individually all the time. Psemdel (talk) 21:48, 29 November 2019 (UTC)

Converted tableA to use MW HTML libraryEdit

Hello, I converted tableA function to use HTML_library. I think it made the function more readable. I think it does not take too much resources. Learning it took not that much time and you can mix this API with plain HTML. I propose to use this more in this module. --Papuass (talk) 16:09, 11 December 2019 (UTC)

This will not have a huge impact of how the module works, but it will make easier to work with code and ensure that all tables look the same (right now they do not). I think this was one of reasons why enwiki decided to stop using it. --Papuass (talk) 11:34, 12 December 2019 (UTC)
Hello, it is true that the output of the module right now looks like <td><th>blabla</td></th>, which is less readable than | ||blabla. However with some HTML, it will look like the first, I suppose. I will read it and maybe make a try, but I am not convinced it will solve the readability problem. Psemdel (talk) 10:05, 27 December 2019 (UTC)
here an example of such coding. Psemdel (talk) 10:12, 27 December 2019 (UTC)
I know it is not a complete solution, but at least it makes it easier to not forget to close some HTML tags. --Papuass (talk) 10:35, 27 December 2019 (UTC)
I cannot read sorry, I thought you wanted it to be done. It was a good idea, it is quite clear now. Psemdel (talk) 12:43, 31 December 2019 (UTC)
  Done I will try on new_classification. Psemdel (talk) 16:44, 31 December 2019 (UTC)

  Done I did it for all functions. I also tried to make the code better. I suppose, we can still improve by looking for code written twice. There can still be some typo here and there. Psemdel (talk) 17:56, 6 January 2020 (UTC)

Great job, that made code a bit smaller and now it is easier to improve. --Papuass (talk) 08:42, 7 January 2020 (UTC)

UCI ProTeamEdit

In connection with the change in the status of teams, he created another Pro Team (Q78464255). When the name of the World Teams changed, we indicated both the old and the new. Until the season has begun and the team seasons for 2020 have been created:

  • Q20638319 UCI ProTeam (2005-2014) — current UCI WorldTeam (2015–.....) (Q6154783)
  • Q78464255 UCI ProTeam (2019-.....) — former, ex-UCI ProContinental Team (2005-2019) (Q382927)

And add to the module if we use. Only a big request with separate (new) values from the translation (transcription) local function headoftableIII(x), and not use the ones already there. For ru-wiki, I made them all hyperlinks so that they lead to the necessary article about the status of the team. — GAN (talk) 13:51, 14 December 2019 (UTC)

I created UCI Women’s WorldTeam (Q80425135), I hope it was not already there. Psemdel (talk) 11:08, 31 December 2019 (UTC)
Psemdel, je suis paumé là pour le coup. Par exemple, je voudrais afficher dans l'infobox pour Saison 2005 de l'équipe cycliste MrBookmaker-Sports Tech la notion d'équipe continentale professionnelle et non UCI ProTeam. Car actuellement c'est anachronique. Maintenant on a 3 éléments wikidata qui s'appelle UCI ProTeam, c'est très complexe à comprendre. Bordurie (talk) 19:33, 3 January 2020 (UTC)
@Bordurie:, j'avoue que là l'UCI s'est surpassé! L'idée de GAN, c'est que ce n'est pas la catégorie qui a changé de nom, mais une nouvelle catégorie. Autrement dit, il faut changer tous les items des équipes conti. Psemdel (talk) 15:09, 4 January 2020 (UTC)
@Psemdel: So can you update the code in order to when the team have Q78464255 (if no articles created here) use the link for Q382927? Due here at Q382927 all wikis have article to UCI Pro Continental and UCI ProTeam. Repf72 (talk) 01:56, 9 January 2020 (UTC)
Yes, it can be done. Psemdel (talk) 20:27, 9 January 2020 (UTC)

Reuse of code at Danish WikipediaEdit

For your information: I have copied some code from the module to other modules at dawiki. The iterator statements and the functions getStatementForTime and flag is used in da:Modul:Flag. The table flags is used in da:Modul:Flag/data.

I used these modules in another little module da:Modul:Wikidata løbshistorie which creates a child infobox with history data for races: First edition, Editions, First winner, Most wins, Most recent. You may want to look at it for inspiration or your own use. If you have any questions I will try to help. --Dipsacus fullonum (talk) 22:58, 19 January 2020 (UTC)

On WP:fr we have also something similar: fr:Module:Infobox/Descriptif course cycliste2 (probably not so well coded as you do). Psemdel (talk) 13:12, 9 February 2020 (UTC)

Propolsal: Move tables of constants to separate data module(s)Edit

I propose that all large tables with only constant strings, numbers and boolean values are moved into one or two data modules. This will be all the l10nDef and other translation tables, the flags table, the jersey and jersey color tables, the classes tables, the formats table, the blacklist tables, the UCI tables for the calendar and maybe other tables.

The data modules can then be loaded into Module:Cycling race with the mw.loadData function which will mean that the tables will only be loaded and parsed once for each page instead for as now in every use of {{#invoke:}}.

You could put all data into one data module, but I think two might be better: Module:Cycling race/data for data which are used by all users, and Module:Cycling race/l10n for localization data. You could then save more memory by removing the localization data for all other languages than your own and only make localization updates at your local wiki. That have obvious advantages, but may also make maintenance harder when new functionality is added or changed. I think both solutions will give significant faster loading of pages which have many tables made by different parts of the module. I would to hear your opinions about this. --Dipsacus fullonum (talk) 00:56, 21 January 2020 (UTC)

I would support that but I am interested in suggestions how to ensure that all modules are copied to other wikis. This would also allow to keep only relevant translations on every wiki (one of problems enwiki users indicated when they decided to remove this module). --Papuass (talk) 19:22, 21 January 2020 (UTC)
I have considered the translations more. I think it is necessary to keep all translations to all languages here at Wikidata. Otherwise it would be too much trouble when new texts to be translated are made. But that doesn't mean that every wiki needs to have all the translations. You could remove the unneeded translations when you copy the module from Wikidata to your local wiki. To test the possibilities I made a small module in a sandbox in da:Modul:Sandkasse/Dipsacus fullonum/Modul:Sandkasse (permanent link to current verson). It is rather crude and may not work correctly, but shows the idea. It is used at da:User:Dipsacus fullonum/sandkasse/skabelon. --Dipsacus fullonum (talk) 13:16, 22 January 2020 (UTC)
You already make this offer a few time ago. At that point, I was quite sceptic, because we lose the "everything is updated at once" that mentioned Papuass. However, I am ready to change my mind as:
  • A big critic that we get all the time about this code, is that it is too long (for sure). Most of the lines are however those "data".
  • You explain, it would save memory. There, I trust your good computer science knowledge.
  • 2 years ago, the code changed all the time, requiring an easy update step. Now, I think the code has reached a mature state. I don't have idea for new functions. We improved the structure this winter, to make it more clear. I expect (hope) the number of updates to decrease quite significantly in this year. Psemdel (talk) 13:40, 9 February 2020 (UTC)
The amount of data will be the same, so it not save memory as such. It will make pages load faster if they have many templates which use Module:Cycling race because it takes considerable time to create and initialise tables in lua, and that will only be done once if the data is in a separate data module. --Dipsacus fullonum (talk) 18:20, 9 February 2020 (UTC)
I started some experiment, but it needs some work. Psemdel (talk) 16:44, 29 March 2020 (UTC)
In details, I made a Module like that [[2]], I call it in [[3]] with
local l10n = mw.loadData("Module:Psemdel2")

but it sends me an error " data for mw.loadData contains unsupported data type 'function'." Any idea? Psemdel (talk) 20:05, 29 March 2020 (UTC)

@Psemdel: The error message in very clear. As described in the manual data loaded with the mw.loadData function may not contain functions but only constants (strings, numbers, booleans and tables). So only the tables and data can be moved to a data module, while the functions using the data cannot. I suggest making a generic translate function which takes a table of translations as one of its arguments. The data module may look like this
  startlist = {"Liste des participants", "Num", "Coureur","Pos","Directeur sportif :", "AB", "HD", "NP", "DQ", "route", "chrono", "et", "sans équipe", "afficher", "masquer" }

  startlisttable = {"Liste des participants", "Num", "Coureur", "Équipe", "Pos" }

  race_reference = {"Source : ", "Sources : " }
It can then be used like this:
local l10n = mw.loadData("Module:Psemdel2")
local function translate(translations, index)
	return translations[index]

local translated_text = translate(l10n.startlist, 5) .. translate(l10n.startlisttable, 3)
  .. translate(l10n.race_reference, 1) .. 'etc.'
--Dipsacus fullonum (talk) 20:59, 29 March 2020 (UTC)
PS. The translate function can even be obmitted:
local l10n = mw.loadData("Module:Psemdel2")
local function translate(translations, index)
	return translations[index]

local translated_text = l10n.startlist[5] .. l10n.startlisttable[3]
  .. l10n.race_reference[1] .. 'etc.'
But then error handling may be harder. --Dipsacus fullonum (talk) 21:05, 29 March 2020 (UTC)

Adaptation for french wikinewsEdit


Could someone adapt that module for french wikinews. There are two changes to make :

  • Color of tables for french wikinews should be #BCE1FF instead of #FFDF80
  • Links to others articles should not use [[ ... | ... ]] but {{w| ... | ... }}

Thanks --Mattho69 (talk) 20:02, 8 March 2020 (UTC)

@Mattho69: We don't do wikinews here. And why the second point? Psemdel (talk) 11:08, 22 March 2020 (UTC)

We need a new item "postponed" when a cycling race is postponedEdit

Hi Guys. I'm checking Kit to translate but I didn't find an item when a cycling race is POSTPONED (not cancelled at all) to another date. This item is important because Giro de Italia 2020 was postponed (not cancelled) and I need show that caption within /listofwinners to Giro de Italia list of winners by year, but I need add an item within the property winner when the race was postponed. Does anyone agreeing with me? Let me know. Thanks! --Douglasfugazi (talk) 01:18, 14 March 2020 (UTC)

Ok Psemdel (talk) 11:07, 22 March 2020 (UTC)

New bib (like jersey)Edit


I have create a bib for team's classification Q87718074, but the background color of listofstagesclassification don't change from white to the same yellow of yellow jersey (general classification). Can you do it ?

Thanks, AirSThib (talk), the 16:05, 14 March 2020 (UTC).

1. This jersey is already there. Wikidata:WikiProject Cycling/Kit to translate/Jerseys. All of them without the phrase "leader after the stage."
2. The holder of a jersey with a color number is not highlighted by the module.

GAN (talk) 16:25, 14 March 2020 (UTC)

@GAN: Thanks for your answer ; I haven't see this item. So I have highlighted the column and it's a success ! Thanks, AirSThib (talk), the 16:43, 14 March 2020 (UTC).

30th NovemberEdit

Just for info, I found out why there is/was the 30th November bug. For recalling, in wikidata there is let's say 2013 and the date is displayed 30 November 2012 :/. In fact, it happens if the month is "00" (instead of "01") and the day also "00". Psemdel (talk) 11:12, 22 March 2020 (UTC)

@Psemdel: I that case the real bug is that the precision field of the date value isn't tested. If the precision is "year", the values for month and day may be 0 or any other value and should never have been used. --Dipsacus fullonum (talk) 22:39, 26 March 2020 (UTC)


To handle previous issue and improve the reliability of the module, especially concerning names, I introduced some UnitTests: Module:Cycling race/Test, results are in the discussion page. So we can test the small functions separately. More tests should be implemented. Of course for the big functions, it won't work, but still it is an improvement. Psemdel (talk) 12:02, 26 March 2020 (UTC)

Return to "Cycling race" page.