Template talk:Medals table
| 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 permanently 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 an administrator or 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: | ||||||||||||||||||||||
| ||||||||||||||||||||||
nation label option
[edit]i'm using this for 2021 National Games of China#Medal table, but as you can see, the provinces are marked as nations.obviously, provinces aren't considered nations, so this is a problem. is there a option to rename nations to province on both the table header and the host? Plastixfy (talk) 02:08, 11 June 2025 (UTC)
- The somewhat-confusing parameter
|team=sets the header name; I have fixed the article you listed, but feel free to adjust elsewhere as necessary. Primefac (talk) 10:16, 15 June 2025 (UTC)
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.[1] 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)
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)