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 936:
:That text is in [[Module:Sports results]]. It can also display "Colours: ". [[User:PrimeHunter|PrimeHunter]] ([[User talk:PrimeHunter|talk]]) 15:47, 6 July 2020 (UTC)
::Oops let me post that there... [[User:Howard the Duck|Howard the Duck]] ([[User talk:Howard the Duck|talk]]) 15:50, 6 July 2020 (UTC)
 
== extra space in transclusion ==
 
I am transcluding [[2022 FIFA World Cup qualification – AFC Second Round]] in [[2020–21 in Indian football]]. But I am getting extra linebreaks above and below the table. I verified in the original page, but I don't see such linebreaks there. Not sure what's causing it. Can anyone help? [[User:Coderzombie|Coderzombie]] ([[User talk:Coderzombie|talk]]) 16:48, 2 July 2020 (UTC)
:This was unrelated to the module. [[User:Smartyllama|Smartyllama]] placed a bunch of newlines inside {{tag|onlyinclude}} in the article.[//en.wikipedia.org/w/index.php?title=2022_FIFA_World_Cup_qualification_%E2%80%93_AFC_Second_Round&diff=964480805&oldid=964365427] I have removed them.[//en.wikipedia.org/w/index.php?title=2022_FIFA_World_Cup_qualification_%E2%80%93_AFC_Second_Round&diff=965666574&oldid=965653759] It also caused unwanted whitespace in other articles. [[User:PrimeHunter|PrimeHunter]] ([[User talk:PrimeHunter|talk]]) 18:04, 2 July 2020 (UTC)
:: Huh, not really sure how I did that. I certainly wasn't trying to. My apologies. I was trying to delete the word "originally" as unnecessary but somehow did a whole lot more. [[User:Smartyllama|Smartyllama]] ([[User talk:Smartyllama|talk]]) 18:27, 2 July 2020 (UTC)
:::{{ping|Smartyllama}} I can reproduce it with VisualEditor. It often makes unwanted changes with no editor action. [[User:PrimeHunter|PrimeHunter]] ([[User talk:PrimeHunter|talk]]) 18:45, 2 July 2020 (UTC)
::::{{ping|Smartyllama}} {{ping|PrimeHunter}} Thank you! I removed extra spaces in Group E, but didn't know extra spaces in other sections would also affect it. [[User:Coderzombie|Coderzombie]] ([[User talk:Coderzombie|talk]]) 02:53, 3 July 2020 (UTC)
:::::It's a confusing scenario. The code <code><nowiki>{{:2022 FIFA World Cup qualification – AFC Second Round|transcludesection=Group E|show_matches=y|showteam=IND}}</nowiki></code> transcludes everything inside {{tag|onlyinclude}} in [[2022 FIFA World Cup qualification – AFC Second Round]]. <code>transcludesection=Group E</code> is not a MediaWiki feature and does not refer to the article section [[2022 FIFA World Cup qualification – AFC Second Round#Group E]]. <code>transcludesection=Group E</code> is just a parameter value like in templates, and the transcluded page decides what to do with the parameter. In this case, each onlyinclude block is of form <code><nowiki>{{#invoke:Sports table|main|style=WDL|section=Group E}}</nowiki></code> or another group name. When [[Module:Sports table]] is used on an article which is itself transcluded somewhere else, it is coded to only output anything when the transclusion has a matching <code>transcludesection=Group E</code>. So each of the other onlyinclude blocks output nothing from the module itself at [[2020–21 in Indian football#2022 FIFA World Cup qualification]]. But after [//en.wikipedia.org/w/index.php?title=2022_FIFA_World_Cup_qualification_%E2%80%93_AFC_Second_Round&diff=964480805&oldid=964365427] they each output the newline VisualEditor added after the module call but inside {{tag|onlyinclude}}. [[User:PrimeHunter|PrimeHunter]] ([[User talk:PrimeHunter|talk]]) 12:24, 3 July 2020 (UTC)
::::::{{ping|PrimeHunter}} That's a wonderful explanation. But as these templates get more and more complex, these issues will get tougher to handle to naive users. [[User:Coderzombie|Coderzombie]] ([[User talk:Coderzombie|talk]]) 14:13, 6 July 2020 (UTC)
::::::: you can also wrap the content in {{tl|trim}}, but removing the newlines is the better approach. [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 17:20, 14 July 2020 (UTC)