Template talk:Navbox

From Wikipedia, the free encyclopedia
Jump to: navigation, search


Please add the "metadata" class to the whole navbox. Otherwise the multimedia viewer galleries are filled by unrelated icons contained in navboxes. See mw:Help:Extension:Media_Viewer#How_can_I_disable_Media_Viewer_for_unrelated_images.3F for more info. --Nemo 12:15, 12 November 2014 (UTC)

Don't use editprotected for feature request... This requires some new code, and even I don't know where to begin. Ping Mr. Stradivarius. -- [[User:Edokter]] {{talk}} 12:27, 12 November 2014 (UTC)
Note that doing so will make it totally unusable from mobile view. Jackmcbarn (talk) 21:41, 12 November 2014 (UTC)
Might be worth considering for {{Portal}} though. -- WOSlinker (talk) 21:56, 12 November 2014 (UTC)

@Nemo:, are there any particular navboxes that have icons visible in media viewer? Might be possible to modify some other templates, such as {{Icon}} instead. -- WOSlinker (talk) 13:09, 14 November 2014 (UTC)

@WOSlinker:, uh, you wanted to reply to User:Nemo_bis, not User:Nemo :) --.../Nemo (talkContributions) 03:38, 25 February 2015 (UTC)

Chack the "name"[edit]

Maybe it would be worth to add check, if the |name= is suitable? I mean, some people won't know, that you need to fill "name" parameter with the PAGENAME value, otherwise the link will be red. --Edgars2007 (talk/contribs) 16:24, 26 January 2015 (UTC)

  • Typically, |name= parameters aren't used unless the name to be displayed is somehow different than the {{PAGENAME}}. This template is coded in Lua, so that will need to be fixed by someone who knows how to set the default name to the pagename in Lua. — {{U|Technical 13}} (etc) 16:38, 26 January 2015 (UTC)
ifexist checks are relatively expensive. if feasible, I would think this would be useful for {{navbar}} as well. at one point, we had a database dump of all inappropriate uses, and then went through and cleaned them up. we may consider doing that on a regular basis? Frietjes (talk) 16:50, 26 January 2015 (UTC)
@Technical 13: The |name= parameter is necessary to make the v-t-e links appear at upper left. These links are present more often than absent, so "aren't used unless the name to be displayed is somehow different than the {{PAGENAME}}" simply isn't true.
@Edgars2007: Any navboxes with the |name= set incorrectly are picked up by monthly report Wikipedia:Database reports/Invalid Navbar links (see Wikipedia:Bot requests/Archive 62#Navbox templates with wrong names), which I normally act on within 24 hours, so any redlinks persist for no more than 32 days. --Redrose64 (talk) 17:05, 26 January 2015 (UTC)
Which should still be able to be done with default values just like is done on all infoboxes. — {{U|Technical 13}} (etc) 17:31, 26 January 2015 (UTC)
Which "default values" would those be? --Redrose64 (talk) 18:21, 26 January 2015 (UTC)
I wouldn't spend too much time on this, since at some point in the future, the name parameter will become unnecessary. Jackmcbarn (talk) 19:49, 26 January 2015 (UTC)

Avoiding nowrap for groups[edit]

Here's a tip to avoid wide group cells, which happen due to CSS nowrap: use parameter "groupstyle = white-space: normal;". As far as I can see there is no unfortunately simpler way to do that. Perhaps this trick should be documented. --Chealer (talk) 00:01, 30 January 2015 (UTC)

V • T • E[edit]

Is there a way to suppress just the "V • T • E" without the "[show]/[hide]" button?--- ARTEST4ECHO(Talk) 22:59, 4 February 2015 (UTC)

Yes, you can control the VTE links with the |navbar= parameter, and the show/hide link with the |state= parameter. They are documented on the template page. -- [[User:Edokter]] {{talk}} 23:09, 4 February 2015 (UTC)
Thanks. For some reason I never saw the |navbar= parameter. I found the |state= parameter, but the off and plain hide both. Thanks--- ARTEST4ECHO(Talk) 20:52, 6 February 2015 (UTC)
They do hide both, bit plain reserves space so the title remains centered. See Template:Navbox/testcases. -- [[User:Edokter]] {{talk}} 21:01, 6 February 2015 (UTC)

Not visible in App[edit]

This template is not visible in the Android App, while the Dutch version is visible. In English I only came across Template:Jesuit, that works fine, but always in collapsed state. Is there a reason for this difference? Wiki-uk (talk) 21:41, 17 February 2015 (UTC)

Automatic striping with numeric gaps[edit]

I created a proof-of-concept in Template:Navbox with striping, but this would be more elegant if there were another option for |evenodd= to enable this feature, rather than the hack that I am using. any comments? Frietjes (talk) 18:32, 21 February 2015 (UTC)

note, this would be used in Template:Country topics and Template:Navbox Ukraine district‎, for example. Frietjes (talk) 18:38, 21 February 2015 (UTC)


Is there any reason {{Navbox}} hasn't been switched to use mw-collapsible yet? I don't see any discussion anywhere in the archives. ディノ千?!? · ☎ Dinoguy1000 19:34, 21 March 2015 (UTC)

I've switched the sandbox over to it, and other than the apparent lack of autocollapse functionality (which I substituted default-to-collapsed for in place of a better solution), it seems to work fine. ディノ千?!? · ☎ Dinoguy1000 20:07, 21 March 2015 (UTC)
I think there was some question of centering the title + the padding for Navbar. --Izno (talk) 00:11, 22 March 2015 (UTC)
I can't think of any issues; I've matched the padding for mw-collapsible years ago. -- [[User:Edokter]] {{talk}} 08:14, 22 March 2015 (UTC)
Since it's been over a week without further comments, I went ahead and changed the live module; if I still shouldn't have, please revert and trout me as appropriate. =) ディノ千?!? · ☎ Dinoguy1000 08:37, 30 March 2015 (UTC)
This should have been done years ago, but no one knows why we didn't. Possible because of the animation... We'll see. -- [[User:Edokter]] {{talk}} 09:24, 30 March 2015 (UTC)
BTW, I changed the default messages from [expand]/[collapse] to [show]/[hide]. -- [[User:Edokter]] {{talk}} 09:29, 30 March 2015 (UTC)
I'm still a bit worried about the lack of autocollapse functionality in mw-collapsible; is there a bug for that? Or is that perhaps the default behavior, and I didn't glean that fact from reading the code, and my change therefore overrides that default for all navboxes now? ディノ千?!? · ☎ Dinoguy1000 10:27, 30 March 2015 (UTC)
Show/Hide doesn't work very well on Navboxes with blue backgrounds, so I've reverted it for now. -- WOSlinker (talk) 12:14, 30 March 2015 (UTC)
Can we agree NOT to revert in full when any tiny weeny bug is encountered? Please reinstate. -- [[User:Edokter]] {{talk}} 15:31, 30 March 2015 (UTC)
Is there a rush to get this implemented? Wouldn't it be better to get it right first? There are some other useability issues that I've noticed as well.
If the navbox has a state parameter set to {{{state|autocollapse}}} then it will always be expanded.
Also, the navboxes on most template pages are now collapsed rather than expanded which causes extra work when working a few navbox templates at once. -- WOSlinker (talk) 15:58, 30 March 2015 (UTC)
Looking at the source for jquery.makeCollapsible, it looks like we should be able to build our own "show"/"hide" link (see for example lines 324–331, and see buildDefaultToggleLink() for how the link itself is built; reading the comment on lines 225–228 suggests we'd need a mw-customcollapsible-XXX ID on the navbox, and a mw-customtoggle-XXX class on the toggle we built (where "XXX" in both cases is some custom string, presumably to help prevent collisions)), which would allow us to apply any custom text color in the header to the link. Unfortunately, my Lua skills aren't up to the challenge in this case - I have no doubt I could come up with something that "works" by faffing about for a couple of hours, but couldn't guarantee it would work well or fit with the style of the rest of the code.
The autocollapse issue is one I mentioned twice before, both in my opening comment(s) and in my comment following my edit to the live module. jquery.makeCollapsible has no handling for an autocollapse mode; see lines 174–179 for the default case for example. ディノ千?!? · ☎ Dinoguy1000 18:47, 30 March 2015 (UTC)
You'd be reinventing the wheel. A better way is to improve the mw-collapsible code. -- [[User:Edokter]] {{talk}} 20:55, 30 March 2015 (UTC)
Is there any reason not to add .navbox-title .mw-collapsible-toggle a {color: inherit;} to the relevant stylesheet? As for the autocollapse issue, is it really that hard to replicate locally? For example, if ( $( '.navbox' ).length > 3 ) { $( '.navbox mw-collapsible-toggle' ).click(); } Mdowdell (talk) — Preceding undated comment added 22:58, 30 March 2015 (UTC)
That would make the link black by default, which is not what we want. -- [[User:Edokter]] {{talk}} 07:29, 31 March 2015 (UTC)
I think we can recycle some code from Common.js that now handles autocollapse. Once that is working, we can dispense with most of the legacy collapsible code, including navframe. Templates that rely on the old collapsible code (and navframe) can be switched to mw-collapsible by swapping classes as an interim solution. -- [[User:Edokter]] {{talk}} 16:44, 6 April 2015 (UTC)
Krinkle's comment on phab:T32352 suggests autocollapse (and innercollapse/outercollapse) support may not happen in jquery.makeCollapsible (which would be a crying shame IMO). That would be the bug report to submit any such patches to, but in the meantime we should look at your suggestion, Edokter. ディノ千?!? · ☎ Dinoguy1000 23:38, 13 April 2015 (UTC)
I read it as more of a "let's ship the product we've got now and if someone comes along to add the functionality they need not to regress their local functionality while making use only of mw-collapsible, then cool". --Izno (talk) 00:28, 14 April 2015 (UTC)
Hence why I said "suggests" and pinged Krinkle: his comment is written very vaguely and I would appreciate it (and probably wouldn't be the only one) if he could clarify what he meant. =) ディノ千?!? · ☎ Dinoguy1000 00:47, 14 April 2015 (UTC)
My response on phabricator:T32352 4 years ago was vague because the request appeared to look at mw-collapsible as an updated version of the script that some wikis have developed locally. From that perspective it would indeed "miss" certain features. However it was instead as a fresh start. Primarily intended for new content that doesn't use the old system and didn't need additional features. As well as an attempt to provide mechanisms that are actively supported and maintained, and work across all wikis. The version of the gadget I looked at didn't have a "autocollapse", "innercollapse", or "outercollapse" option. And when I later saw them elsewhere I didn't see a major use case for them that would justify delaying the initial version. Feel free to create tasks for specific features, with examples of how/where they would be useful. Note that mw-collapsible does support making an element collapsed by default. Simply give it mw-collapsed in addition to mw-collapsible. --Krinkle (talk) 01:13, 14 April 2015 (UTC)

Navbox/Navbar on mediawiki.org[edit]

Can someone share some insight wether it is possible to make the navbar links "translatable"? I have a user that keeps reverting mw:Template:Navbox to the old template code because he doesn't know how to localize the links in mw:Module:Navbar. I don't know either... but I do know the old template does not provide any translations. -- [[User:Edokter]] {{talk}} 16:48, 6 April 2015 (UTC)

Max number of groups/lists[edit]

What is the maximum number of groups or lists in a navbox? Is it finite (limited), or unlimited? GeoffreyT2000 (talk) 01:12, 16 May 2015 (UTC)

In theory, there is no upper limit. In practice, there is; at some point you will hit one of the template limits such as "Pages where template include size is exceeded" but the exact moment when that happens will vary with both the complexity of the navbox and the complexity of the transcluding page. It's possible that the navbox will display just fine on its template page but will fail on any article that you transclude it to. --Redrose64 (talk) 05:07, 16 May 2015 (UTC)