Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a22f6ffeea43d685

Jump to content

Template talk:Medals table

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Module talk:Medals table)
Latest comment: 8 days ago by Maiō T. in topic flag_template with age parameter

Adding a switch parameter for Template:Sticky table start

[edit]

Template:Medals table has implented {{sticky header}} in their code (...local sticky = frame:extensionTag{ name = "templatestyles", args = {src = "template:sticky header/styles.css) and it works perfectly and is a great addition. However, there are also very long tables, and it would be good if they were scrollable in a container like {{sticky table start}}. In All-time Olympic Games medal table, we even have three long tables one after the other, and that's not good. Sticky header is probably the preferred choice, as no container is placed around the table. However, a parameter for the template would be desirable for very long tables. with these changes in {{Template:Medals table}}, this switch would work, tested with Module:Sandbox/Miria~01/2 on User:Miria~01/sandbox2 with {{#invoke:Sandbox/Miria~01/2|createTable|style=alt for the first table and for the second table with {{#invoke:Sandbox/Miria~01/2|createTable. These would be the changes in {{Module:Medals table}}

local stylesheet = args['style']
local sticky = frame:extensionTag{ name = "templatestyles", args = {src = "template:sticky header/styles.css" } }
local sticky
if stylesheet == 'alt' then
        sticky = frame:extensionTag{ name = "templatestyles", args = {src = "template:sticky table start/styles.css"} }
else
sticky = frame:extensionTag{ name = "templatestyles", args = {src = "template:sticky header/styles.css"} }
end
...
...
if stylesheet == 'alt' then
root:addClass('sticky-table-head')
else
	   root:addClass('sticky-header-multi')
end
		root:css('text-align', 'center)

...
...

if stylesheet == 'alt' then
  local container = mw.html.create('div')
  :addClass('sticky-table-scroll')
  :wikitext(tostring(root))

  local outerContainer = mw.html.create('div')
  :addClass('sticky-table-collapsible')
  :node(container)
 return header .. sticky .. tostring(outerContainer) .. footer
else
return header .. sticky .. tostring(root) .. footer
end
end

This would not change anything for all other medal tables, and you would only need to insert {{Medals table|style=alt when calling the template, if desired. Miria~01 (talk) 18:55, 18 June 2025 (UTC)Reply

Removed the request "edit be made to the template-protected", because the matter has been resolved (see here). {{sticky table start}} works now with the integrated {{sticky header}} in {{#invoke:Medals table}}.
<div style="font-size:90%">
{{sticky table start}} 
{{Medals table
 | caption        =
 | host           =
 | remaining_text =
 | show_limit =
 | team           = {{Tooltip|NOC|National Olympic Committee}}
 | flag_template  = flagIOC
 | event          = Summer
 | gold_USA = 1105| silver_USA = 879 | bronze_USA = 781
 ...
|}
{{sticky table end}}
Miria~01 (talk) 23:04, 26 June 2025 (UTC)Reply

flag_template with age parameter

[edit]

{{fbu}} and {{fbwu}} have an unnamed age parameter before the other unnamed parameters. Can {{Medals table}} be adapted to allow passing on such a parameter with something like |flag_template=fbwu |age=17? I made a wrapper template {{fbwu17}} which doesn't itself have an age parameter and that works. But a bunch of wrapper templates for gender-age combinations doesn't seem like a good solution. This started at Wikipedia:Help desk#Template for women's football under-20 and under-17. PrimeHunter (talk) 14:39, 11 July 2025 (UTC)Reply

Oh yes PrimeHunter, this template is terrible. No one can make such a small Lua fix. The {{Winners}} template had a similar problem with youth categories, but I recently fixed it; you can look at it if you want. However, Lua is completely unknown to me; I cannot modify the Module:Medals table myself... Maiō T. (talk) 11:11, 8 March 2026 (UTC)Reply
Hello PrimeHunter, are you still here? I'm testing the sandbox for this issue and I think I've managed to solve it. See the following examples:

Of course, this is just a "rough" version, it still needs to be verified by a Lua expert. Maiō T. (talk) 17:27, 18 July 2026 (UTC)Reply

Hello Frietjes, I think you will also be interested in this topic, as I saw this your edit. 😉 Maiō T. (talk) 13:42, 19 July 2026 (UTC)Reply
Okay people, I've been testing this for the past few days and haven't found any snags. So I'm gonna copy sandbox to live. I am confident that this new feature will be used in many youth competitions in the future. Have a nice time, this topic is now closed. Maiō T. (talk) 14:07, 21 July 2026 (UTC)Reply

Sync with sandbox

[edit]

Semantic HTML and accessibility improvements there (totals no longer use <th> for data cells). sapphaline (talk) 12:09, 6 December 2025 (UTC)Reply

Unnecessary inherit

[edit]

Hi, I'm currently theming my wikis and noticed an unnecessary attribute for the Rank field. If you go to any article (I chose 2025_World_Figure_Skating_Championships because it was on main page) and change color attribute of .wikitable, you can see that all headers remain black except for rank. Removing inherit from Rank makes it black again, like the rest of headers. The only exception is Timeless theme, where all headers with default background get that color). Lili1228 (talk) 09:24, 3 April 2026 (UTC)Reply

I don't see any problems with the display of this template, including the Rank column header, at 2025 World Figure Skating Championships#Medals by country in the Vector 2022 default mode or the Vector 2022 dark mode. There are also no dark-mode-related Linter errors on that page. What is the problem that you are reporting? Screen shots might help. – Jonesey95 (talk) 16:53, 5 April 2026 (UTC)Reply
As I said, this affects custom CSS (that themes .wikitable), I don't have any issue on any of the stock themes. If you apply something like .wikitable { color: red; }, you'll see that all the text in the first row becomes red but Rank's color: inherit; causes an inconsistency. Lili1228 (talk) 18:11, 5 April 2026 (UTC)Reply
Thank you for clarifying. Feel free to propose a change in the sandbox that fixes your personal issue while continuing to support the standard skins and viewing modes. – Jonesey95 (talk) 20:39, 5 April 2026 (UTC)Reply
In Module:Medals_table, remove the css line from:
	if not args['hide_rank'] then
		row:tag('th')
			:attr('scope', 'col')
			:css('color', 'inherit')
			:wikitext('Rank')
	end
Lili1228 (talk) 20:43, 5 April 2026 (UTC)Reply
 Done. I do not see any problems in the views that I described, so this looks like a harmless change. – Jonesey95 (talk) 00:35, 6 April 2026 (UTC)Reply