Template talk:Navbox

Jump to navigation Jump to search

colspan causes unnecessary wrapping in groupless navboxes with 'width:auto'

In navboxes with no groupN, no image, and with width:auto applied, the default colspan="2" that gets added to each of the rows causes the navbox to adopt the width of the content in the final row/cell, even when this causes content in earlier rows to wrap. See for example Template:Set navigation on Yugipedia. Simply removing the unnecessary colspans is enough to fix this (interestingly, at least in Chrome, it seems that just removing the colspan in the header is enough to fix it). I would take a crack at this myself, but I have no idea how to check for the existence of any groupN without just looping through all the possible names. ディノ千?!☎ Dinoguy1000 21:21, 14 July 2019 (UTC)

I guess the way to check for any groupN parameters would be something like the getArgNums() function in Module:Infobox, actually. ディノ千?!☎ Dinoguy1000 21:30, 14 July 2019 (UTC)
*poke* ディノ千?!☎ Dinoguy1000 18:28, 1 December 2019 (UTC)

Template-protected edit request on 14 August 2019

To improve the performance of the collapsible code, I request to make [1]. This will cause the parser to preload the collapsible code, avoiding an additional resourceloader lazyloading call to be made, which makes pages containing navboxes a little more efficient. —TheDJ (talkcontribs) 12:33, 14 August 2019 (UTC)

@TheDJ: Have you done any testing to indicate that this should have no visible impact? --Izno (talk) 03:10, 15 August 2019 (UTC)
Izno, {{Navbox/testcases}}. It basically just skips the JS transform inside MediaWiki:Common.js that would otherwise happen to collapsible, but by using mw-collapsible, the JS will be predelivered by the MW parser, which makes it faster. —TheDJ (talkcontribs) 07:00, 15 August 2019 (UTC)
@TheDJ: One of the reasons I ask is that the translation in Common.js also handles the states that mw-collapsible did not for a portion of time (autocollapse I think was one?). Does mw-collapsible also handle those now? --Izno (talk) 11:35, 15 August 2019 (UTC)
Izno, yes it does. The mwCollapsibleSetup hook in our Common.js does that for all mw-collapsibles and all collapsibles are already converted to mw-collapsible on the fly right now (this just makes it faster) —TheDJ (talkcontribs) 15:41, 15 August 2019 (UTC)
 Done Izno (talk) 17:49, 18 August 2019 (UTC)

Spacing for ungrouped item after subgroups

Template:Ainur Group1 (Valar) comprises 2 subgroups and then an ungrouped item, Morgoth. There is no space before the entry "Morgoth".

In contrast, Group 2 (Maiar) starts with some ungrouped items, then two subgroups. The ungrouped entries (Eonwe…) have an appropriate space before the first one.

Is this a weakness in the coding for {{Navbox}}, or can Template:Ainur be formatted better, to align the spacing of all ungrouped items? – Fayenatic London 14:59, 24 January 2020 (UTC)

Morgoth (Melkor) is an entry in a valid list with <ul>...</ul> tags, albeit a list with just one item. The list is enclosed in a <div>...</div> with no styling. Eönwë, Sauron and Melian are also list items, but they do not have enclosing <ul>...</ul> tags - instead they have an enclosing <div style="padding:0em 0.25em">...</div> - that 0.25em padding on right and left is what causes the gap. I think that the problem is with {{navbox}}, and may be a WP:VPT matter. --Redrose64 🌹 (talk) 23:39, 24 January 2020 (UTC)
Fixed, I believe. – Jonesey95 (talk) 23:50, 24 January 2020 (UTC)

Template-protected edit request on 11 March 2020

line 68: content:match('^<span class="nowrap">') then change as content:match('^') then. This change will affect on Special:LintErrors for Misnested tag with different rendering in HTML5 and HTML4 and it will reduce many errors. Warm Regards, ZI Jony (Talk) 07:42, 11 March 2020 (UTC)

 Not done for now: please establish a consensus for this alteration before using the {{edit template-protected}} template. Izno (talk) 12:06, 11 March 2020 (UTC)
As with the proposed change to Module:Infobox, I do not think that this change would fix any templates. Please link to a specific page that would be fixed by this change. – Jonesey95 (talk) 12:59, 11 March 2020 (UTC)
The article is a derivative under the Creative Commons Attribution-ShareAlike License. A link to the original article can be found here and attribution parties here. By using this site, you agree to the Terms of Use. Gpedia Ⓡ is a registered trademark of the Cyberajah Pty Ltd.