Module talk:Sports rbr table/Archive 1

Ordering
Maybe it would be possible to that functionality from sports table module, that let's user reorder the teams? Basically this part:


 * team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE


 * pos_FDT= 1/.....
 * pos_BBB= 2/.....
 * pos_CCC= 3/.....
 * pos_DDD= 4/.....
 * pos_EEE= 5/.....

-- Edgars2007  (talk/contribs) 16:00, 15 August 2018 (UTC)
 * name_FDT=NHL All-Star Team
 * name_BBB=Team 2
 * name_CCC=Team 3
 * name_EEE=
 * , sure, that could be useful when the season is still in progress. I will work on that shortly. Frietjes (talk) 16:01, 15 August 2018 (UTC)
 * , see the second example in the documentation. Frietjes (talk) 17:57, 15 August 2018 (UTC)

Font-size
Is there an option for font-size? If possible can you show me? Here is the example that the legend names EG, DG etc. are so big.--Teacher0691 (talk) 20:41, 15 August 2018 (UTC)
 * Teacher0691, I have reduced the legend font-size and made the code easier to import into other languages. you (should) only need to change the table of labels at the top when importing into other language WPs. Frietjes (talk) 15:26, 16 August 2018 (UTC)
 * Thanks Frietjes but I mean the legends inside the table not footer. The footer is okey now. Can this table be as long as that table? So I mean reducing the length of columns--Teacher0691 (talk) 23:17, 16 August 2018 (UTC)
 * Teacher0691, it looks like it was a problem with the cell padding. I have switched over to using templatestyles and set the cellpadding to 1px in there.  I still need to do more more on the templatestyles to reduce the number of classes, but it should generally work right now. Frietjes (talk) 16:26, 17 August 2018 (UTC)
 * Yeah Frietjes, I am watching. Better now. Thx.--Teacher0691 (talk) 16:31, 17 August 2018 (UTC)
 * Frietjes teams align left please always. Looks very bad.--Teacher0691 (talk) 16:44, 17 August 2018 (UTC)
 * Teacher0691, example please? try refreshing the page. Frietjes (talk) 16:45, 17 August 2018 (UTC)
 * It is ok now. Thx.--Teacher0691 (talk) 16:48, 17 August 2018 (UTC)

Some custom table
How can we convert 2009 Chinese Super League and 2012 Chinese Super League to module? Hhkohh (talk) 14:14, 20 August 2018 (UTC)
 * Hhkohh, see the "color" section in the documentation and/or how I converted 2009 Chinese Super League.
 * How about adding yes? I saw some K league need this Hhkohh (talk) 12:58, 23 August 2018 (UTC)
 * Hhkohh, okay, that should work now. Frietjes (talk) 13:19, 23 August 2018 (UTC)

Module bug?
Some pages which uses this module have error messages like 2018 J1 League, see also Category:Pages with script errors, thanks 19:14, 24 August 2018 (UTC)

rndN
can you track pages which uses rndN, thanks. I want to update these pages to use firstround Hhkohh (talk) 13:35, 8 September 2018 (UTC)
 * Hhkohh, keep in mind that many of these cannot be replaced with firstround. I could probably write a more complicated check to see if they could be replaced with firstround, but for now, I will just track any rndN that isn't rnd0. Frietjes (talk) 14:01, 8 September 2018 (UTC)
 * okay, I will, thank you Hhkohh (talk) 14:02, 8 September 2018 (UTC)
 * I will ignore season page while updating Hhkohh (talk) 14:11, 8 September 2018 (UTC)

Essential problem with this module
First of all, this is not a "new" problem, it already existed with the "old" "fb rbr" templates.

I refer to a discussion I had some months ago: User_talk:CRwikiCA

Basically, the problem is, both in the old templates and in this new module, a single scheme is assumed. Meaning the assignment of spots in the European Tournaments is based on a fixed relation to the ranking.

This fixed relation does not exist. The killjoy is/are Cup Winner(s).

Take the 2012–13 Premier League. Up to round 27 the 7 spots in the European Tournaments can be assigned to the 7 highest ranked teams according to the same scheme (rank 1-3 CL GS, rank 4 CL PO, rank 5 EL GS, rank 6 EL PO and rank 7 EL 3Q).

However, as of round 28 the same scheme doesn't apply any more. Wigan Athletic won the FL Cup. So the EL 3Q spot no longer goes to the team ranked 7. We get a new scheme like rank 1-3 CL GS, rank 4 CL PO, rank 5 EL GS, rank 6 EL PO (fixed) and EL 3Q to the rank taken by Wigan Athletic which can differ each round (variable).

As of round 37 it becomes even more complex. Swansea City won the FA Cup. So the EL GS spot no longer goes to the team ranked 5. We get another new scheme like rank 1-3 CL GS, rank 4 CL PO, rank 5 EL PO (fixed), EL GS to the rank taken by Swansea City and EL 3Q to the rank taken by Wigan Athletic which both individually can differ each round (variable).

If, in the season as mentioned above, both Cups had been won by teams ending on rank 1-4, a single scheme would have done.

All in all, in this specific season, not all spots in the European Tournaments are ranked based. 2 spots in the European Tournaments are team based, the 2 Cup winners.

Something like this happening is not uncommon.

Now this probably can be solved by using the parameter "posX_rndY_color" (if it's a color not used yet, it would also require a parameter "posX_rndY_text").

But have a look at this table: Dutch Eerste divisie 2017/18

I don't even want to think about using an endless amount of "posX_rndY_color" parameters to create a correct table.

However I think the problem can be solved by using something like this:

Let's assume something like a league with only 5 teams. Rank 1 plays CL GS, Cup winner CL PO, rank 2 EL GS. If rank 1 wins Cup as well then rank 2 plays CL PO and rank 3 EL GS. Only 4 teams in the league. Cup is decided after round 4.

It's kinda a mix of the "pos" and "res" notation. "1CLGS" is split into "1" (the "pos" part) and "CLGS" (the "res" part). The "res" part is only used for the color of the cell, the "pos" part only for the string to display, the position. --Sb008 (talk) 04:14, 26 September 2018 (UTC)
 * Agree but I think we only use new style in some articles not all articles. Hhkohh (talk) 09:33, 26 September 2018 (UTC)
 * Sb008, I see. something like this is definitely possible, just need to figure out if this is the best syntax from a programming and usage point of view.  from a programming point of view, it would be more robust if there were a delimiter between the "1" and the "CLGS".  but, as long as we can assume that the "1" is always numeric and the "CLGS" is always in the [A-Za-z] set, and there are no other cases where one would want to use a combination of a number followed by letters for a symbol, we can use the notation you have presented.  at the moment, I can't think of any cases, so your suggested syntax should work.  Frietjes (talk) 12:35, 26 September 2018 (UTC)
 * The syntax in general would be [ ][ ] where is numeric and is a string starting with a character. So not [A-Za-z]* but [A-Za-z].* Both can be empty. If both empty it's a future round. if [ ] is empty it's the current "posN" or "pos_XX" and if [ ] is empty it's the current "resN". (@Hhkohh) It's not meant to replace the current 2 notations (pos/res), but as an extension. As far as I see it, there's no need for a delimiter as long as the order is [ ][ ] and not [ ][ ]. But if introducing a delimiter simplifies matters, so be it.
 * "elseif tostring(k):match( '^%s*colou?_?(.-)%s*$' ) then" (line 135). I assume an "r" is missing.
 * --Sb008 (talk) 16:26, 26 September 2018 (UTC)
 * Sb008, okay, should work now. we could probably get rid of the other posX_rndY_color syntax, assuming the cases using it would work with this syntax.  but, would have to check those to be sure. Frietjes (talk) 17:25, 26 September 2018 (UTC)
 * Sb008, okay, should work now. we could probably get rid of the other posX_rndY_color syntax, assuming the cases using it would work with this syntax.  but, would have to check those to be sure. Frietjes (talk) 17:25, 26 September 2018 (UTC)

Looking at the code, I don't think it will work the way I meant it to be. "posrc = posrc:match('^%s*[%d]+([A-Za-z]+)')" is as you mentioned the [A-Za-z] set, where I like it to be a single [A-Za-z] character optionally followed by 1 or more characters (which could be restricted to [A-Za-z0-9]). Something like e.g. 4CL3Q (rank 4, Champions League 3rd qualification round) should be possible. The 1st non digit is basically not only part of "posrc" but the delimiter as well. All in all maybe something like:
 * "| pos4 = 4/3/6/1/3": list of rankings, if you wish cells to be colored based on rank use e.g. "| color_3-4 = blue2". The values displayed in the cells are the rankings/positions. So both color (optionally) and display value are based on the listed rankings/positions. (as before)
 * "| res2= W/ L/ L/ W/ W/ D": list of indicators. if you wish cells to be colored based on indicator use e.g. "| color_D = yellow2". The values displayed in the cells are the indicators. So both color (optionally) and display value are based on the listed indicators. (as before)
 * "| res1= 2CLGS/ 6CL3Q/ 7/ 15/ 19REL": list of ranking and indicator combinations. if you wish cells to be colored it's indicator based only, e.g. "| color_REL = red2". The values displayed in the cells are the rankings. So the colors (optionally) are indicator based and the display values are rank/spot based.

You could also say, we only have result lists. Each result list is a "/" delimited list of rank/indicator combinations. Both rank and indicator can be empty. If
 * both empty "/ /": a result in the future
 * indicator empty, only a rank "/ 6 /": rank is displayed, optionally colors can be set using rank based parameters e.g. color_7-
 * rank empty, only an indicator "/ W /": indicator is displayed, optionally colors can be set using indicator based parameters color_W
 * both not empty "6CL3Q", the 1st none digit ("C") is the delimiter and splits the string into a rank part ("6") and an indicator part ("CL3Q"). The rank is displayed, optionally colors can be set using the indicator part.

Do not use pos at all, but only pos_ (define results for team ) and name_ = (define wikilink for team ) and team = (define list sequence number for team ). Or even better not pos_ but res_. Get rid of pos.... completely.

If "name_ " is not used, no Wikilink is shown but just. It can also be used instead of "label ". E.g. "| res_WLD = W/L/L/W/W/D | name_WLD = Result | color_W = green2 | color_D = yellow2 | color_L = red2", or "| res_GRD = H/A/A/H/A | name_GRD = Ground". Seems to me "label " is unneeded.

If team = is not used, teams are listed in the order as they occur in the Wiki code. --Sb008 (talk) 19:32, 26 September 2018 (UTC)
 * Sb008, go ahead and edit the sandbox, but your example works. Frietjes (talk) 19:37, 26 September 2018 (UTC)

Seems to be okay.
 * Eredivisie last season


 * Eerste divisie last season

Now an extra nice addition would be to have team notes as in the module "sports table".

Specifically for the Eerste Divisie as above:

--Sb008 (talk) 21:18, 26 September 2018 (UTC)
 * Sb008, could be done, or you could just use directly? Frietjes (talk) 22:02, 26 September 2018 (UTC)
 * Sb008, it turns out it wasn't that hard to do, so now done. Frietjes (talk) 22:30, 26 September 2018 (UTC)


 * Of course I could have used . But this is better. We want all sports modules to be similar. Then something else, it doesn't bother me personally since I didn't use it (yet), the splitN parameter. Define it in some table and next push the sort buttons, see what happens. --Sb008 (talk) 22:57, 26 September 2018 (UTC)
 * the splitN parameter appears to function the same as Module:Sports table, which is good since we want all sports modules to be similar. Frietjes (talk) 13:17, 27 September 2018 (UTC)
 * It functions indeed the same in both modules. However I can't imagine the behavior which occurs when pushing a sort button is as intended. Maybe it went unnoticed cause the sort functionality probably is never or rarely activated when using "sports table". --Sb008 (talk) 21:38, 27 September 2018 (UTC)
 * Sb008 to change the sort behaviour, you need to assign a sort key to the divider rows. some options include (1) sort top, (2) sort bottom, (3) some other key.  clearly, the dividers are based on the unsorted presentation, so having them stay fixed while the other rows are sorted is probably not correct. Frietjes (talk) 13:58, 28 September 2018 (UTC)

I agree the dividers are based on the unsorted presentation. And indeed it wouldn't be that easy to make them behave correct in a sorted situation. You can even discuss about what the behavior should be. Should the dividers stay in a fixed position or should they move with the cells they're attached to in the sort column. But as is, it's not correct. Maybe easiest to accept it as as, and add a note to the parameter in the documentation. --Sb008 (talk) 15:11, 28 September 2018 (UTC)
 * the dividers have no meaning after you start sorting the table, so they should either move to the top or bottom or disappear. Frietjes (talk) 15:19, 28 September 2018 (UTC)
 * In the "sports rbr table" the dividers still have a meaning after sorting, that is as long as the sort column is a column representing a round. Let's assume we have a fully filled table (end of season) of 38 rounds (20 teams). In general the table will initially be sorted on the last (round 38) column. Also assume we defined "split4" and "split8". So a divider will be shown between rank 4 and 5 as well as between rank 8 and 9 (based on the ranks in the last column). Now if I push the sort button for e.g. round 12, the dividers should still show between rank 4/5 and rank 8/9, however between those ranks for round 12. Effectively it means the dividers remain in a fixed position. Because looking at the column used for sorting, rank 4 will always be on line 4, rank 5 always on line 5, rank 8 always on line 8 and rank 9 always on line 9. If I use a reverse sort then rank 4 will be on line 21-4=17, rank 5 on line 21-5=16, rank 8 on line 21-8=13 and rank 9 on line 21-9=12.
 * So as long as we sort on a round there are 2 possible fixed positions for the dividers, depending on whether it's a normal or a reserved sort.
 * It becomes a different story if we use the team name as sort column. In that case the dividers have no meaning any more and should disappear. Right now they are moved to the top or bottom, no matter which sort button is used, because the dividers are basically lines with empty cells which, when sorting, either end up first (normal) or last (reversed).
 * In the "sports table", except when sorting based on the position column, the dividers always lose their meaning. In some cases sorting based on the points column could result in correct dividers but we can't assume to be that lucky. In even more rare cases sorting based on matches won (or lost) or goals for (or goals against) could even result in correct dividers.
 * The only thing we are sure of is, sorting based on the position column in the "sports table" will result in correct dividers or sorting based on any of the round (which are position based) columns in the "sports rbr table". In all other cases we have to assume the dividers have no meaning and should disappear.
 * Seems to me hard if not even impossible the implement since we don't program the sort button functionality. Therefore the only option might be to add a note in the documentation about the limitations of sortN whenever sort buttons are pushed. --Sb008 (talk) 17:40, 28 September 2018 (UTC)

future
See 2019 Chinese Super League. When I typed future, the module output First match(es) will be played on ?. not First match(es) will be played on unknown. Can you fix it? Hhkohh (talk) 14:00, 5 October 2018 (UTC)
 * fixed. Frietjes (talk) 16:52, 7 October 2018 (UTC)

Another issue
the table now only show 2 line, not 16 lines Hhkohh (talk) 16:02, 5 October 2018 (UTC)
 * you need to add more teams for the rows to be displayed, or use a place holder like - or TBA or Frietjes (talk) 16:52, 7 October 2018 (UTC)
 * So how about setting dealt to the module like Module:Sports table? Hhkohh (talk) 17:07, 7 October 2018 (UTC)
 * this module uses Module:Arguments, which removes blank input, and intelligently merges parent args with frame args. I would rather not make this module worse by implementing the poor design choice used by Module:Sports table.  Frietjes (talk) 17:12, 7 October 2018 (UTC)

Overtime win
Is there any way to add in overtime wins, as I'm looking to use this Module for ice-hockey results on my sandbox? Joefoxon (talk) 12:09, 8 October 2018 (UTC)
 * Joefoxon, you can use any letters, numbers, or other symbols. you just have to decide on what to use to denote an overtime win, e.g. OW or whatever. Frietjes (talk) 13:48, 8 October 2018 (UTC)
 * User:Joefoxon/sandbox This is what happens when I try to do that, the OL doesn't appear in the legend. Joefoxon (talk) 13:53, 8 October 2018 (UTC)
 * Joefoxon, I see, you want the symbols inside the boxes in the legend. that should work now. Frietjes (talk) 17:07, 8 October 2018 (UTC)

Consistent data
In out footy, after each match ended, we need to update data in league article and at least two club season article. Can we update the module to support we only update once instead of several times? Like Module:Sports table.
 * For example, we update data in a template, then put or  in league articles and put  in club season articles separately Hhkohh (talk) 09:01, 19 January 2019 (UTC)
 * Hhkohh, I think you are asking for the ability to have the Module:Sports table and Module:Sports rbr table information in the same module call, similar how we can call Module:Sports results from Module:Sports table? could be possible, but I would need to do some testing/coding. can you provide a link to examples in articles so I can be certain about what you are requesting. Frietjes (talk) 14:55, 19 January 2019 (UTC)
 * Probably you misunderstand, but I give you an example:
 * If coding in a template

You can see if you type :

You can see if you type ::

You can see if you type

Hhkohh (talk) 15:10, 19 January 2019 (UTC)
 * Pinging Hhkohh (talk) 15:17, 19 January 2019 (UTC)
 * Some para can be adjusted if necessary Hhkohh (talk) 15:18, 19 January 2019 (UTC)
 * Hhkohh, okay, this is clear, but slightly complicated to implement all the cases. I will work on it tomorrow. Frietjes (talk) 16:55, 19 January 2019 (UTC)
 * Hhkohh, getting close to a working prototype, see 'User:Frietjes/rbr'. still have to fix the legend, and table headings, but otherwise it seems to be generally working. Frietjes (talk) 18:00, 21 January 2019 (UTC)
 * Will check later Hhkohh (talk) 23:53, 21 January 2019 (UTC)
 * , the source para need to be split because do not need Competitive matches. And in template, better to put in alphabetical order while previewing in template and in rbr version but we put in position order in pos version (2 order systems needed!) Hope you can do it successfully! Hhkohh (talk) 11:59, 22 January 2019 (UTC)
 * Another testcase which I have created:Template:2019 Myanmar National League table 2 Hhkohh (talk) 12:42, 22 January 2019 (UTC)
 * , Why is blank in another testcase: Template:2019 Liga 1 table 2? Hhkohh (talk) 14:52, 22 January 2019 (UTC)
 * Hhkohh, may be because I was working on it, or may be because you used the wrong syntax? Frietjes (talk) 15:06, 22 January 2019 (UTC)
 * Hhkohh (talk) 15:10, 22 January 2019 (UTC)
 * Not found. Maybe my eyes are too tired? Hhkohh (talk) 15:24, 22 January 2019 (UTC)

'Match-up results' feature proposal
Hi in some athletic conference articles like 2019 PBA Philippine Cup and UAAP Season 82 basketball tournaments you will see "Schedule" table (sometimes called "match-up results table") showing the order of opponents of each team with the background colors indicating that team's win/loss results against their opponents.

I'd like to propose such feature to be implemented to this module.

I have already created the implementation in my sandbox: Module:Sandbox/McVahl/sometest including the test cases. The schedule appearance will apply if argument.

If you agree with the merge, or if there is an existing feature that is affected by the change, please let me know. I would welcome everybody for comments and suggestions. :) – McVahl (talk) 09:38, 13 March 2020 (UTC)
 * Hi McVahl, thank you for working on this. I definitely think we can make this possible.  first, if possible, I would like to enable multiple rows per team to support tables like this one (there are many of these).  so, in this case, the colouring for the opponents row is home/away and not W/D/L.  that one also has the two tables merged into one table.  right now, the module doesn't support multiple rows per team.  I had been working on multirow support in the sandbox but stopped working on it for some reason.  that said, looking at [//en.wikipedia.org/wiki/Special:ComparePages?page1=Module%3ASports+rbr+table&rev1=&page2=Module%3ASandbox%2FMcVahl%2Fsometest&rev2=&action=&diffonly=&unhide= the diff] between your version an the current version, I don't see any serious problems with your changes. Frietjes (talk) 14:33, 15 March 2020 (UTC)


 * Hi, added   arg (works similar to Module:Sports table) so that the impact is minimal if "multiple rows" will be implemented soon. The style (or submodule) sandbox is in Module:Sandbox/McVahl/sometest/testtable. The new submodule (if pushed through) will be named as Module:Sports rbr table/sched. Kindly review if this is okay with you. Thanks. – McVahl (talk) 16:45, 21 March 2020 (UTC)
 * McVahl, you seem to be careful and competent so I have no objection to you pushing your changes (assuming it doesn't break anything :)) Frietjes (talk) 17:32, 22 March 2020 (UTC)