🇮🇷 Iran Proxy | https://www.wikipedia.org/wiki/Template_talk:Medals_table/sandbox
Jump to content

Template talk:Medals table

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

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)[reply]

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)[reply]

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.[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)[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]