Template talk:Medals table
Add topic| This is the talk page for discussing Medals table and anything related to its purposes and tasks. |
|
| Archives: 1Auto-archiving period: 3 months |
| Template:Medals table is indefinitely protected from editing as it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify a template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
| This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||
| ||||||||||||||||||||||
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)
- 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}}.
- Miria~01 (talk) 23:04, 26 June 2025 (UTC)
<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}}
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)
- 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)
- 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:
{{Medals table/sandbox
| flag_template = vb
| gold_USA = 1 | silver_USA = 2 | bronze_USA = 3
}} |
| ||||||||||||||||||
{{Medals table/sandbox
| flag_template = vbu2
| event = 19
| gold_USA = 1 | silver_USA = 2 | bronze_USA = 3
}} |
{{Medals table/sandbox | flag_template = vbu2 | event = 19 | gold_USA = 1 | silver_USA = 2 | bronze_USA = 3 }} |
{{Medals table/sandbox
| flag_template = vbu
| age = 19
| gold_USA = 1 | silver_USA = 2 | bronze_USA = 3
}} |
| ||||||||||||||||||
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)
- 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)
- 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)
Sync with sandbox
[edit]This edit request to Module:Medals table has been answered. Set the |answered= parameter to no to reactivate your request. |
Semantic HTML and accessibility improvements there (totals no longer use <th> for data cells). sapphaline (talk) 12:09, 6 December 2025 (UTC)
Done, looks good, thanks :) --Nux (talk) 16:45, 6 December 2025 (UTC)
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)
- 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)
- 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'scolor: inherit;causes an inconsistency. Lili1228 (talk) 18:11, 5 April 2026 (UTC)- 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)
- In Module:Medals_table, remove the css line from:
- 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)
- As I said, this affects custom CSS (that themes
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)
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)
- Lili1228 (talk) 20:43, 5 April 2026 (UTC)