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

Content deleted Content added
syntax update (showteam is automatic)
m Archiving 2 discussion(s) from Module talk:Sports table) (bot
Line 2,712:
:::About the possibility of compiling the "played" and "points" columns, <del>it's a more complex thing and I still have to trace back that example, so for the moment let's put it apart</del> I've found again the examples, you can find them in the sandbox just below the first ones.
:::Thanks again! --[[User:Sannita|Sannita]] - <small>''[[User talk:Sannita|not just another it.wiki sysop]]''</small> 11:06, 21 July 2019 (UTC)
 
== Baseball/Softball ==
 
Hi, I wanted to use the module for baseball/softball pages, there is a small problem here, it seems our options are sets/games/goals/points/frames/matches, but in those sports it's about '''runs'''. is this possible to add that to the options ? [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 22:17, 13 August 2019 (UTC)
: any answer ? [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 10:01, 18 August 2019 (UTC)
::It looks like it should be simple enough in the WDL module, by adding the below condition:
::{{syntaxhighlight|lang=lua|code= if for_against_style==}}
::{{syntaxhighlight|lang=lua|code= elseif for_against_style=='r' or for_against_style=='run' or for_against_style=='runs' then
fa_letter = 'R'
fa_word_sing = 'Run'
fa_word_plur = 'Runs'}}
::I can't do this myself as I'm not a template editor, but it is possible to add an edit request for this. Is it the WDL version that you want to use? [[User:Spike &#39;em|Spike &#39;em]] ([[User talk:Spike &#39;em|talk]]) 10:40, 19 August 2019 (UTC)
::: Yes exactly. as simple as that. I thought that already existed for ''sets''' but I was wrong, in some sports (like beach handball) it's about winning sets. I know it's possible to use the "volleyball format" but having that option for sets is even better. [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 10:45, 19 August 2019 (UTC)
::::I've added this code to {{ml|Sports table/WDL/sandbox}}, so can you try this (by doing <code>{{#invoke:Sports table|main|style=WDL/sandbox|for_against_style=R/run/runs|...</code> and if that works then I'll make an edit request. As an example
{{#invoke:Sports table|main|style=WDL/sandbox
|showteam={{{showteam|no}}} |only_pld_pts={{{only_pld_pts|no}}} |show_matches={{{show_matches|no}}}|for_against_style=R
|team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE
|win_FDT=5 |loss_FDT=0 |gf_FDT=10 |ga_FDT=0
|win_BBB=3 |draw_BBB=1 |loss_BBB=1 |gf_BBB= 3 |ga_BBB=2
|win_CCC=3 |loss_CCC=2 |gf_CCC= 3 |ga_CCC=3
|win_DDD=1 |draw_DDD=1 |loss_DDD=3 |gf_DDD= 1 |ga_DDD=4
|win_EEE=0 |loss_EEE=5 |gf_EEE= 0 |ga_EEE=6
|name_FDT=[[FIFA World Cup Dream Team]]
|name_BBB=Team 2
|name_CCC=Team 3
|name_DDD=DDD
|name_EEE={{fb|GIB}}
}}
::::[[User:Spike &#39;em|Spike &#39;em]] ([[User talk:Spike &#39;em|talk]]) 11:45, 19 August 2019 (UTC)
::::: Thanks, that worked well. even though I had to try it with <code>{{#invoke:Sports table|main|style=WL/sandbox</code> because there is no "draw" in those sports. the outcome was the same though. I really appreciate your answer. and while you are doing this, is that possible fix some codes for "sets" this is probably just a mistake
::{{syntaxhighlight|lang=lua|code= elseif for_against_style=='m' or for_against_style=='set' or for_against_style=='matches' then
fa_letter = 'M'
fa_word_sing = 'Match'
fa_word_plur = 'Matches'}}
::::: I assume someone wanted to create different codes for sets and matches but mixed them together by mistake. I think there should be separate codes for sets like this:
::{{syntaxhighlight|lang=lua|code= elseif for_against_style=='s' or for_against_style=='set' or for_against_style=='sets' then
fa_letter = 'S'
fa_word_sing = 'Set'
fa_word_plur = 'Sets'}} [[User:Mohsen1248|Mohsen1248]] ([[User talk:Mohsen1248|talk]]) 12:13, 19 August 2019 (UTC)
::::::I had noticed that and was in the process of changing that in the sandbox version (so please try again)! The WL module just calls the WDL one with one of the necessary parameters set, so any change to the live version will do the same. I'll go ahead and make the edit request and see if anyone answers that. [[User:Spike &#39;em|Spike &#39;em]] ([[User talk:Spike &#39;em|talk]]) 12:22, 19 August 2019 (UTC)
 
== Template-protected edit request on 19 August 2019 ==
 
{{edit template-protected|Module:Sports table/WDL|answered=yes}}
As per discussion above, and as tested in WDL/sandbox, in the code block starting:
{{syntaxhighlight|lang=lua|code=for_against_style = string.lower(for_against_style)
if for_against_style=='g' or for_against_style=='goal' or for_against_style=='goals' then}}
 
change the following (which originated [https://en.wikipedia.org/w/index.php?title=Module:Sports_table/WL&diff=next&oldid=835250345 here]) from
{{syntaxhighlight|lang=lua|code=elseif for_against_style=='m' or for_against_style=='set' or for_against_style=='matches' then}}
to
{{syntaxhighlight|lang=lua|code=elseif for_against_style=='m' or for_against_style=='match' or for_against_style=='matches' then}}
and add 2 new options for sets and runs:
{{syntaxhighlight|lang=lua|code=elseif for_against_style=='s' or for_against_style=='set' or for_against_style=='sets' then
fa_letter = 'S'
fa_word_sing = 'Set'
fa_word_plur = 'Sets'
elseif for_against_style=='r' or for_against_style=='run' or for_against_style=='runs' then
fa_letter = 'R'
fa_word_sing = 'Run'
fa_word_plur = 'Runs'
}}
before
{{syntaxhighlight|lang=lua|code= elseif for_against_style=='none' then}} [[User:Spike &#39;em|Spike &#39;em]] ([[User talk:Spike &#39;em|talk]]) 12:38, 19 August 2019 (UTC)
: probably done. [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 13:16, 19 August 2019 (UTC)
::Thank you, looks good in the test I setup. [[User:Spike &#39;em|Spike &#39;em]] ([[User talk:Spike &#39;em|talk]]) 13:33, 19 August 2019 (UTC)