Module talk:Sports table/Archive 2: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Module talk:Sports table) (bot
m Archiving 1 discussion(s) from Module talk:Sports table) (bot
Line 614:
Necessary for [[:Template:2019–20 Ligue 1 table]] as per final declared table of Ligue 1: [https://www.ligue1.com/Articles/NEWS/2020/04/30/psg-champions-season-ended-ligue-1]. [[User:Chanheigeorge|Chanheigeorge]] ([[User talk:Chanheigeorge|talk]]) 16:27, 30 April 2020 (UTC)
:In the WDL style, use {{para|ranking_style|ppg}} for points per game [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 17:00, 30 April 2020 (UTC)
 
== Wrestling ==
 
Hi, I tried to use this for the sport of wrestling, I tried to use current options but I need some help here
 
{|
|-
|
{| class="wikitable" style="text-align: center; font-size:90% "
!width=230|Athlete
!width=25|Pld
!width=25|W
!width=25|L
!width=25|CP
!width=25|TP
|-bgcolor="ccffcc"
|align=left|{{flagIOCathlete|[[Reineris Salas]]|CUB|2020 Summer}}
|3||3||0||'''11'''||27
|-bgcolor="ccffcc"
|align=left|{{flagIOCathlete|[[Jordan Steen]]|CAN|2020 Summer}}
|3||2||1||'''8'''||23
|-
|align=left|{{flagIOCathlete|[[José Daniel Díaz]]|VEN|2020 Summer}}
|3||1||2||'''5'''||11
|-
|align=left|{{flagIOCathlete|[[Miguel Sánchez (wrestler)|Miguel Sánchez]]|MEX|2020 Summer}}
|3||0||3||'''0'''||0
|}
|
{| class="wikitable" style="text-align: center; font-size:90% "
|-
!width="160"|CP / TP!!width="50"|CAN!!width="50"|CUB!!width="50"|MEX!!width="50"|VEN
|-
|align="left"|{{flagIOC|CAN|2020 Summer}}
!
| '''0–5'''
| '''11–0'''
| '''12–1'''
|-
|align="left"|{{flagIOC|CUB|2020 Summer}}
| 3–0 '''PO'''
!
| '''10–0'''
| '''12–1'''
|-
|align="left"|{{flagIOC|MEX|2020 Summer}}
| 0–4 '''SU'''
| 0–4 '''SU'''
!
| '''0–9'''
|-
|align="left"|{{flagIOC|VEN|2020 Summer}}
| 1–4 '''SU1'''
| 1–4 '''SU1'''
| 3–0 '''PO'''
!
|}
|}
 
{{#invoke:Sports table|main|style=WL
|update=complete
|source=
|winpoints=0
|losspoints=0
|teamwidth=250
|team_header=Athlete
|team1=CUB |team2=CAN |team3=VEN |team4=MEX
|ranking_style=
|use_goal_diff=no
|win_CUB=3 |loss_CUB=0
|win_CAN=2 |loss_CAN=1
|win_VEN=1 |loss_VEN=2
|win_MEX=0 |loss_MEX=3
 
|name_CUB={{flagIOCathlete|[[Reineris Salas]]|CUB|2020 Summer}}
|name_CAN={{flagIOCathlete|[[Jordan Steen]]|CAN|2020 Summer}}
|name_VEN={{flagIOCathlete|[[José Daniel Díaz]]|VEN|2020 Summer}}
|name_MEX={{flagIOCathlete|[[Miguel Sánchez (wrestler)|Miguel Sánchez]]|MEX|2020 Summer}}
 
|result1=A|result2=A
|col_A=#ccffcc
|adjust_points_CUB=11
|adjust_points_CAN=8
|adjust_points_VEN=5
|adjust_points_MEX=0
|match_col_width=60px
|show_matches=y
|short_CAN=CAN
|short_VEN=VEN
|short_CUB=CUB
|short_MEX=MEX
 
|match_CAN_CUB=0-3 '''PO'''
|match_CUB_CAN='''5–0'''
 
|match_VEN_CUB=1-4 '''SU1'''
|match_CUB_VEN='''12–1'''
 
|match_MEX_CUB=0-4 '''SU'''
|match_CUB_MEX='''10–0'''
 
|match_VEN_CAN=1-4 '''SU1'''
|match_CAN_VEN='''12–1'''
 
|match_MEX_CAN=0-4 '''SU'''
|match_CAN_MEX='''11–0'''
 
|match_MEX_VEN=0-3 '''PO'''
|match_VEN_MEX='''9–0'''
}}
 
Is it possible to hide GF/GA columns as well ? I couldn't find that option. in this sport they never count the number of points against, "points for" is called "Technical points" (TP) but since that's not a tie breaker not necessary to be in the table. also I would like it more if it was possible to see {{Tooltip|CP|Classification points}} instead of {{Tooltip|Pts|Points}} but if this is not easy to make that change, I can live with that '''Pts''' column, but another request, in some events the first factor is the number of win (actually in most competitions) and CP comes second, but also in some older events CP was the first deciding factor. we have an option to use '''<nowiki>|ranking_style=w</nowiki>''' but in that case it will hide the Pts/CP column, is it possible to have both columns (W and Pts) but make it optional which one is bold ? thanks in advance. [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 23:11, 27 April 2020 (UTC)
:For the first question, there is an easy solution: {{para|for_against_style|none}}. For the rest, it would require either changes to the existing WL style or creating a new style. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 03:12, 29 April 2020 (UTC)
:Wait. You can bold wins and still show points, because of the way you are setting points with {{para|adjust_points_TTT}}. If you use {{para|ranking_style|w}} then wins is bolded and points are not shown, as you noted. But, then you can use {{para|show_bonus_points|yes}} combined with {{para|bonus_header}}. In that case you get:
{{#invoke:Sports table|main|style=WL
|update=complete
|source=
|winpoints=0
|losspoints=0
|teamwidth=250
|team_header=Athlete
|team1=CUB |team2=CAN |team3=VEN |team4=MEX
|ranking_style=w
|for_against_style=none
|show_bonus_points=yes
|bonus_header={{Tooltip|CP|Classification points}}
 
|win_CUB=3 |loss_CUB=0
|win_CAN=2 |loss_CAN=1
|win_VEN=1 |loss_VEN=2
|win_MEX=0 |loss_MEX=3
 
|name_CUB={{flagIOCathlete|[[Reineris Salas]]|CUB|2020 Summer}}
|name_CAN={{flagIOCathlete|[[Jordan Steen]]|CAN|2020 Summer}}
|name_VEN={{flagIOCathlete|[[José Daniel Díaz]]|VEN|2020 Summer}}
|name_MEX={{flagIOCathlete|[[Miguel Sánchez (wrestler)|Miguel Sánchez]]|MEX|2020 Summer}}
 
|result1=A|result2=A
|col_A=#ccffcc
|adjust_points_CUB=11
|adjust_points_CAN=8
|adjust_points_VEN=5
|adjust_points_MEX=0
|match_col_width=60px
|show_matches=y
|short_CAN=CAN
|short_VEN=VEN
|short_CUB=CUB
|short_MEX=MEX
 
|match_CAN_CUB=0-3 '''PO'''
|match_CUB_CAN='''5–0'''
 
|match_VEN_CUB=1-4 '''SU1'''
|match_CUB_VEN='''12–1'''
 
|match_MEX_CUB=0-4 '''SU'''
|match_CUB_MEX='''10–0'''
 
|match_VEN_CAN=1-4 '''SU1'''
|match_CAN_VEN='''12–1'''
 
|match_MEX_CAN=0-4 '''SU'''
|match_CAN_MEX='''11–0'''
 
|match_MEX_VEN=0-3 '''PO'''
|match_VEN_MEX='''9–0'''
}}
[[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 03:27, 29 April 2020 (UTC)
:Thanks '''a lot''' for your answer, it already answers most of my requests, one last request, as I said in some competitions CP is the first decider (and not the number of wins) is it possible to keep the table exactly as your example but have that CP column in bold ? [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 04:55, 29 April 2020 (UTC)
::Not as far as I can see. In this case, you could decide not to use {{para|ranking_style|w}}, and just use the Pts column which would be in bold. But you can't change the header of Pts. That's the only way I see to do it. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 13:27, 29 April 2020 (UTC)
::: That's OK, I can use Pts (and not CP) for all the tables, thanks for your help. [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 14:16, 29 April 2020 (UTC)
{{Re|Mohsen1248}} I just created a new style called Custom. This style allows you to set the number of columns that the table has, and give each one a custom header. That is, it has more customization than the WL or WDL styles, but doesn't calculate as much. This only calculates matches played, points, and points per game. But I think that is more than you need. See below:
{{#invoke:Sports table|main|style=Custom
|update=complete
|source=
|teamwidth=250
|team_header=Athlete
|default_style=WLbasic
|num_cols=5
|colstyle4=cp
|col_header4={{Tooltip|CP|Classification points}}
|colstyle5=tp
|col_header5={{Tooltip|TP|Technical points}}
|default_value5=0
|bold_col2=yes
|bold_col4=yes
 
|team1=CUB |team2=CAN |team3=VEN |team4=MEX
|win_CUB=3 |loss_CUB=0 |cp_CUB=11 |tp_CUB=27
|win_CAN=2 |loss_CAN=1 |cp_CAN=8 |tp_CAN=23
|win_VEN=1 |loss_VEN=2 |cp_VEN=5 |tp_VEN=11
|win_MEX=0 |loss_MEX=3 |cp_MEX=0
 
|name_CUB={{flagIOCathlete|[[Reineris Salas]]|CUB|2020 Summer}}
|name_CAN={{flagIOCathlete|[[Jordan Steen]]|CAN|2020 Summer}}
|name_VEN={{flagIOCathlete|[[José Daniel Díaz]]|VEN|2020 Summer}}
|name_MEX={{flagIOCathlete|[[Miguel Sánchez (wrestler)|Miguel Sánchez]]|MEX|2020 Summer}}
 
|result1=A|result2=A
|col_A=#ccffcc
|match_col_width=60px
|show_matches=y
|short_CAN=CAN
|short_VEN=VEN
|short_CUB=CUB
|short_MEX=MEX
 
|match_CAN_CUB=0-3 '''PO'''
|match_CUB_CAN='''5–0'''
 
|match_VEN_CUB=1-4 '''SU1'''
|match_CUB_VEN='''12–1'''
 
|match_MEX_CUB=0-4 '''SU'''
|match_CUB_MEX='''10–0'''
 
|match_VEN_CAN=1-4 '''SU1'''
|match_CAN_VEN='''12–1'''
 
|match_MEX_CAN=0-4 '''SU'''
|match_CAN_MEX='''11–0'''
 
|match_MEX_VEN=0-3 '''PO'''
|match_VEN_MEX='''9–0'''
}}
If you want to set only one of the columns as bold, just remove the {{para|bold_col2|yes}} or {{para|bold_col4|yes}} as appropriate. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 21:30, 1 May 2020 (UTC)
I haven't written any documentation for this new style yet though, so you'll have to stumble along blindly for a bit if you want to use it right away. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 21:40, 1 May 2020 (UTC)
: {{ping|NHammen}}, thanks a lot, this is great and covers everything, I also can probably use it for other individual sports, I already know good enough to use it myself but having documentation will help others. I'm not really familiar with how things work here, so this is ready for use and I can start using it with the name ''Custom'' ? nobody will rename it or something like that later ? [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 21:44, 1 May 2020 (UTC)
::{{ping|Mohsen1248}} I don't see any reason why the name of the style would be changed. But I only started editing Sports table modules a couple of weeks ago, so there are people around who might care a bit more than I do. Which means I can't say for certain that this will not be renamed later. But based on the fact that when the Football style was renamed to WDL, they ensured backwards compatibility with the old name, it stands to reason that even if the name is changed, all tables that use {{para|style|Custom}} will still work properly. I have a lot of free time due to Coronavirus, so I will probably be adding documentation relatively soon. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 22:06, 1 May 2020 (UTC)
::: {{ping|NHammen}} Great, thanks again, I really appreciate your work. [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 22:30, 1 May 2020 (UTC)
:::: {{ping|Mohsen1248}} So I have written some documentation. There are a few more things I need to add to it, but it's mostly complete. However, I should mention that I have added a new parameter {{para|ranking_col}} which in addition to selecting which column to bold, also sets the column to show any hth notes in. I did this because I saw that no column was showing hth notes. Since you probably didn't define any hth notes in your uses, that still is okay. The parameter {{para|bold_colN|yes}} still works, but it is preferable to use {{para|ranking_col|N}} going forward, so that there will always be a column to show hth notes, if there are any, and to avoid any shenanigans caused by the default value of this new parameter. I did go and edit a few of the pages you had used the module in, just to test it out. [[User:NHammen|NHammen]] ([[User talk:NHammen|talk]]) 20:01, 2 May 2020 (UTC)
::::: Thanks, that's even better for the reason you explained. [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 20:20, 2 May 2020 (UTC)
:::::{{ping|NHammen}} I made necessary adjustments in all articles using this module, so if you want to make any change or even remove that previous option, that won't make any harm. anyway I highly doubt there will be a table with more than column in bold. [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 20:37, 2 May 2020 (UTC)