Topic on User talk:Matěj Suchánek

Template:Infobox football league season

21
Xaris333 (talkcontribs)

Hello. I need your help to make w:el:Πρότυπο:Κουτί πληροφοριών ποδοσφαιρικής περιόδου πρωταθλήματοςWikidata working with wikidata.

Example article: w:el:Α΄ κατηγορία ποδοσφαίρου ανδρών Κύπρου 2016-17. 2016–17 Cypriot First Division (Q23756432)

  • competition: It shows short name (P1813) in Greek Language. I want, if P1813 is not exist in items page, to show the Greek Label of the item.
  • league: It shows sports season of (P3450). I want to show short name (P1813) of the value of sports season of (P3450) in Greek language. I want, if P1813 is not exist in items page, to show the Greek Label of the item.
  • season: It must shows "2016-2017". The only property that has a relation to that is time period (P2348). The value is 2016-2017 one-year-period (Q30201458). We can use a value of P1813 of 2016-2017 one-year-period (Q30201458) but there is no way to choose one. Something else I have thought is to use the "year of start date - year of end date". start time (P580) - end time (P582). Is that possible? To use only the year, not full date.
  • edition: Is working using series ordinal (P1545) of sports season of (P3450). But the number is cardinal number (Q1329258) not a ordinal number (linguistics) (Q923933). Not serious problem.
  • number_championships: the number of the championships the winning team have after winning that trophy. No idea how to do that.
  • continentalcup1: Is about the international competitions the teams qualified through the league. But is complicate for me to do that because are more than one international competitions. qualifies for event (P3085) is the property.
  • league topscorer: is working, showing the number of goal and the team of the player. But is shows them as (24; Ομόνοια Λευκωσίας). The symbol ; is not appropriate in my language for the case. And I prefer to have the NAME OF PLAYER (number of goals)
    Team Name. This is template problem, not wikidata, I know. How to do it? By adding a parameter team. But how;
  • prevseason, nextseason. Is working. But the names are too big. I want to show the short name (P1813) of those items in Greek Language. And, if P1813 is not exist in items page, to show the Greek Label of the items.
  • advanced_level, lower_level: I have tried to add them as prevseason, nextseason but unsuccessfully.
  • average goals: by completing the parameters of matches and total goals the template count by itself average goals. This is not happening when using the numbers for wikidata.
Matěj Suchánek (talkcontribs)
  • competition: {{#if: P1813 | P1813 | {{#invoke:Wikidata|getLabel|lang=el}} }} (replace P1813 with whatever you had shown there)
  • league: add label=short
  • season: try {{Wikidata|P580|of=P2348|precision=9}}–{{Wikidata|P582|of=P2348|precision=9|rank=best}}
  • edition: this may be useful to have, I will see
  • number_championships: seems to be difficult
  • continentalcup1: another approach it may be useful to have...
  • league topscorer: I can't see the team in your example, so don't you just need to remove P1351?
  • prevseason, nextseason: add label=short
  • advanced_level, lower_level: try splitting both groups to different data## fields
  • average goals:
| data29 = {{#if: {{{total goals|{{{συνολικά_γκολ|{{Wikidata|P1351|rank=best|addcat=true|showsource=true}}}}}}}} | {{{total goals|{{{συνολικά_γκολ|{{Wikidata|P1351|rank=best|addcat=true|showsource=true}}}}}}}} {{#if: {{{matches|{{{αγώνες|{{#invoke:Wikidata|getRawValue|property=P1350}}}}}}}} | {{small|1=({{#expr: {{{total goals|{{{συνολικά_γκολ|{{#invoke:Wikidata|getRawValue|property=P1351}}}}}}}} / {{{matches|{{{αγώνες|{{#invoke:Wikidata|getRawValue|property=P1350}}}}}}}} round 2}} ανά αγώνα)}}}} }}

HTH

Xaris333 (talkcontribs)

Thanks. I apply them. Lets solve all the problems.

  • league topscorer. I have added a new parameter. So, in the first line I want to show the players name and the goal in brackets. That is working. Below that I added the parameter league topscorer team. I want the template to show only the qualifier P54 (not in bracket) and not the players name.

Or Maybe is easier just to change the symbol ;. Can you change that? I mean when we have 2 or more qualifiers in brackets, to be separated by , and not by ; ?

Xaris333 (talkcontribs)

Hello again. I understand that I am annoying. So I will stop ask about your help after that. But, I almost finish that template and I really want to finish it. The only problems is about league topscorer and continentalcup. They have the same problem. If the topscorer are two or the conitental cup are more than one, then the template only show the qualifiers of the first item, not for all. Check w:el:Α΄ κατηγορία ποδοσφαίρου ανδρών Κύπρου 2016-17. For league top scorer the templates shows the number of goals for both players but only the team for the first one. For continentalcup it shows both cups but only the teams for the first one.

Matěj Suchánek (talkcontribs)

Believe me, it really isn't about annoyance. I just couldn't concentrate on doing the best for you. Anyway, now where you call getQualifier and want all of them, add all=true. I'll leave it to you since you know better what needs to be done. If something breaks, come back.

Xaris333 (talkcontribs)

Not working. https://el.wikipedia.org/w/index.php?title=%CE%A0%CF%81%CF%8C%CF%84%CF%85%CF%80%CE%BF:%CE%9A%CE%BF%CF%85%CF%84%CE%AF_%CF%80%CE%BB%CE%B7%CF%81%CE%BF%CF%86%CE%BF%CF%81%CE%B9%CF%8E%CE%BD_%CF%80%CE%BF%CE%B4%CE%BF%CF%83%CF%86%CE%B1%CE%B9%CF%81%CE%B9%CE%BA%CE%AE%CF%82_%CF%80%CE%B5%CF%81%CE%B9%CF%8C%CE%B4%CE%BF%CF%85_%CF%80%CF%81%CF%89%CF%84%CE%B1%CE%B8%CE%BB%CE%AE%CE%BC%CE%B1%CF%84%CE%BF%CF%82Wikidata&type=revision&diff=7054408&oldid=7053887&diffmode=source

It must be like https://el.wikipedia.org/w/index.php?title=%CE%91%CE%84_%CE%BA%CE%B1%CF%84%CE%B7%CE%B3%CE%BF%CF%81%CE%AF%CE%B1_%CF%80%CE%BF%CE%B4%CE%BF%CF%83%CF%86%CE%B1%CE%AF%CF%81%CE%BF%CF%85_%CE%B1%CE%BD%CE%B4%CF%81%CF%8E%CE%BD_%CE%9A%CF%8D%CF%80%CF%81%CE%BF%CF%85_2016-17&oldid=7054410

Matěj Suchánek (talkcontribs)

I think I can see the problems now. Although I discovered and fixed a bug (thanks for that), I don't know how to resolve them.

  1. I understand you want to have competitions in the left column and qualified teams in the right one. I fixed that bug, so this should be possible now. But the columns won't be "harmonized".
  2. I understand you want to have a player, number of goals and their team below. This is beyond what you can do with the module. :(
Xaris333 (talkcontribs)

So you can only do that only if the property has only one value? Because the problem occurs when there are more that one value for the property.

Matěj Suchánek (talkcontribs)

Yes, this is the issue.

Xaris333 (talkcontribs)

Ok. Thanks. If you find a solution sometime in the future, please tell me. I may ask to Wikidata Project Chat. Maybe someone have a solution.

Xaris333 (talkcontribs)
Xaris333 (talkcontribs)

withqualifier=P1545

I want the value that have the qualifier P1545 with the value 1.

Matěj Suchánek (talkcontribs)

Does withqualifiervalue=1 work?

Xaris333 (talkcontribs)

Yes. Sorry about that.

My template have only one problem. That with league topscorer. See :w:el:Α΄ κατηγορία ποδοσφαίρου ανδρών Κύπρου 2016-17.

1) I want between the values of the two qualifiers to have , and not ;

(24; Ομόνοια Λευκωσίας) No

(24, Ομόνοια Λευκωσίας) Yes

Than applied to all situation in Greek Wikipedia. Thy symbol ; is our ? .

2) Because we can have the name of the player and his team in separated lines, the template is expanded (horizontally). Is there a way to change that by changing something in the template?

Matěj Suchánek (talkcontribs)
Xaris333 (talkcontribs)

Problem again. It shows the two values of P3085 but it shows only the winners of the second one. Can you understand why? I will give up, its my last try... Useless property for Wikipedia...

Matěj Suchánek (talkcontribs)

So I finally got it. In the template, you cannot have header## with the same number as the following label## and data##. It must be the next number.

Xaris333 (talkcontribs)

Many thanks. Another (difficult) template is working thanks to you!!

Just to ask, without |withqualifier=P1545|withqualifiervalue=1 etc that wouldn't work, right?

Matěj Suchánek (talkcontribs)

Right, the module first looks for the property and then compares the value (if necessary). The second parameter alone has no influence.

Xaris333 (talkcontribs)

Good. Because I have proposal a new qualifier for that, in case series ordinal (P1545) is not appropriate one. Is not a good proposal, I know that, I just want the community to find a final solution to the problem, to know what qualifier to use in the template.

Wikidata:Property proposal/ranking order

Many thanks! I will never ask you anything about templates, wikidata etc as I promised. You have done more than... more. Thanks again!!!!

Matěj Suchánek (talkcontribs)

No, never say never. Whenever you feel you need help, just come back, so that I can take a look ;)