Template talk:Navbox

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

Navbox|border=subgroup vs. navbox|subgroup[edit]

In the documentation, it states that It is recommended that one use {{Navbox|subgroup}}, but the same result can be reached by using {{Navbox}} with border = child or the first unnamed parameter set to child.. can someone explain why it's recommended to use {{navbox|subgroup}} instead of {{navbox|subgroup}}? I would think the recommendation would be the reverse since (1) using {{navbox|subgroup}} is less efficient due to the additional wrapper later, and (2) {{navbox|subgroup}} cannot support more than 20 groups/lists. I am guessing that this recommendation (which was added by CapitalR in this edit) was true in the past, but is no longer true? Frietjes (talk) 21:18, 14 July 2017 (UTC)

While working on Module:Navbox last March I wondered about {{Navbox}} but ended up ignoring it as what I was doing was already complex. A very quick look at the wikitext in {{Navbox|subgroup}} suggests that it tries to pass all parameters to {{Navbox}} except that grouppadding defaults to 0em 0.75em;. Is {{Navbox}} useful? I have not followed the work done on the module recently regarding using css, but presumably any default padding should be set there. Johnuniq (talk) 23:24, 14 July 2017 (UTC)
I agree that we should be setting any padding for subgroups in MediaWiki:Common.css, and to avoid confusion we should have the same group padding for both {{navbox|subgroup}} and {{navbox|subgroup}}. checking the current MediaWiki:Common.css I see padding: 0.25em 1em which is close to the 0em 0.75em value. if we really want to have less padding for groups in subgroups, I believe we can handle that in MediaWiki:Common.css as well. It would be great if {{navbox|subgroup}} were a very thin frontend that was functionally equivalent to {{navbox|subgroup}}. Frietjes (talk) 23:40, 14 July 2017 (UTC)
for a comparison try
{{navbox| group1 = group1| list1 = {{navbox|subgroup | group1 = group1a | list1 = list1a}}}}
{{navbox| group1 = group1| list1 = {{navbox|subgroup | group1 = group1a | list1 = list1a}}}}
Frietjes (talk) 23:42, 14 July 2017 (UTC)
I put an example in my sandbox (permalink). I can hardly see a difference. Does anyone know of cases where {{navbox}} should not be replaced with {{navbox}}? Johnuniq (talk) 00:37, 15 July 2017 (UTC)
I don't know of any. If I recall, we used to have Template:Navbox generic and subgroup, so the slight difference may be something left over from the merge. Thanks! Plastikspork ―Œ(talk) 12:42, 15 July 2017 (UTC)

There are thousands of templates that link to subgroup. Previewing what happens if the subgroup template is not used shows a very minor difference in spacing—if that difference is desirable, it should be in the main template. Any thoughts on how to proceed? The cautious approach would be to edit a couple of navboxes from the "what links here" list to replace
{{navbox|subgroup|...}} with
then see what happens. A faster strategy would be to replace {{navbox}} with a redirect to {{navbox}}. Johnuniq (talk) 04:34, 20 July 2017 (UTC)

Johnuniq, it would be great if we could make this work. Frietjes (talk) 19:55, 17 August 2017 (UTC)
That should be easy. I think the requirement is that the module should get the navbox parameters from the template, but use the border=... parameter if it is given in the module invoke. I'll ponder that later. Ping me if I go AWOL. Johnuniq (talk) 23:10, 17 August 2017 (UTC)
@Frietjes: I got distracted with some idiocy. I don't use Module:Arguments and so am not really aware of what's going on, but a quick look makes me think your {{#invoke:Navbox|navbox|border=...}} at subgroup/sandbox (permalink) would have worked. That template is not listed as a "wrapper" so I would have thought the border parameter in the invoke would be accepted. Can you recall what made you decide it did not work? Johnuniq (talk) 11:36, 18 August 2017 (UTC)
Johnuniq, as far as I can tell, it still doesn't work, and Module:Navbox uses Module:Arguments. before this change and this change, it wasn't reading any of the parent args (as expected). after adding "navbox|subgroup" to the list of wrappers, it now ignores the border parameter (see User:Frietjes/n). Frietjes (talk) 14:16, 18 August 2017 (UTC)
@Frietjes: I don't understand what's going on. Previewing lots of debugging tests showed that the border parameter never made it into the module but I could not work out why. I decided to remove the wrappers stuff, and now it's working. I will return to ponder what's going on another time.
Does subgroup/sandbox appear to be working as far as you can see? Johnuniq (talk) 05:45, 19 August 2017 (UTC)
Johnuniq, as far as I can tell, that works. I don't know if there is any possibility of introducing new problems by not checking the invoking parent's name. I suppose we can always make the change and see if anything bad happens. Frietjes (talk) 13:47, 19 August 2017 (UTC)
Yes, I think you could put the sandbox code in the main module but when I get some time (soon!?) I plan to work out why the current code misses the parent border in the subgroups template. It shouldn't! What I'd really like to do is work out if Module:Arguments is doing anything needed by Module:Navbox because the arguments layer is obscuring what's going on. I probably won't do anything about that. Johnuniq (talk) 01:24, 20 August 2017 (UTC)

Technical implementation of hiding on mobile site[edit]

How is the hiding of navbox templates on mobile implemented? I thought it was done through mediawiki:mobile.css, but it looks like that rule was removed in May 2016. --Ahecht (TALK
) 20:17, 31 July 2017 (UTC)

@Ahecht: skins.minerva.content.styles/hacks.less. phab:T124168 is the design task related to displaying them. --Izno (talk) 20:31, 31 July 2017 (UTC)
@Ahecht: Reping. --Izno (talk) 20:31, 31 July 2017 (UTC)

Bug report - Link to current page in a navbox not disabled when it is via a redirect.[edit]

Link to current page in a navbox not disabled when it is via a redirect. Example: Wickham Terrace, Brisbane is a redirect to Wickham Terrace. When a navbox link to Wickham Terrace, Brisbane is viewed in Wickham Terrace it is not disabled. Downsize43 (talk) 01:09, 22 August 2017 (UTC)

Downsize43, have you tried opening Template:Road infrastructure in Brisbane and fixing the link? as far as I can tell, that template is not protected. Frietjes (talk) 20:35, 22 August 2017 (UTC)
Frietjes, thanks for your reply. I have fixed the link, but that does not address the bug when a redirect is inadvertently used; in the example given the redirect page is the correct format for the article, while the article title is one of those special cases often found for a subject which is the first of, or the only one of, in the known universe, that has an article in WP (rather strange for a fairly insignificant street, I know) Cheers, Downsize43 (talk) 22:05, 22 August 2017 (UTC)
This is not a bug which can be fixed save by fixing the link in the navbox, or removing the link in the navbox (if the target of the redirect is no longer appropriate for the navbox). --Izno (talk) 02:08, 23 August 2017 (UTC)

In theory, couldn't this be fixed by checking the redirectTarget of each linked page with the mw.title library? But it might not be desirable because it could use up too much of the expensive parser function quota on a page with a lot of navboxes. Toohool (talk) 02:42, 23 August 2017 (UTC)

Probably could be, but the social practice of fixing the links is better anyway (and is suggested by WP:NAVBOX). --Izno (talk) 03:52, 23 August 2017 (UTC)

Import to lb.wikipedia.org[edit]

Hello I always get an error when using templates that rely on Module:Navbox. I get always this error: Lua-Feeler in Modul:Navbox, Zeile 241: attempt to index local 'listText' (a nil value). How can this bug be fixed? --Soued031 (talk) 11:50, 6 September 2017 (UTC)

Please link to a page (possibly a sandbox) which shows the error. Johnuniq (talk) 01:16, 7 September 2017 (UTC)
I did notice that Module:Arguments and lb:Modul:Arguments are different. -- WOSlinker (talk) 05:29, 7 September 2017 (UTC)
Thanks WOSlinker you were right the error happened because Module:Arguments and lb:Modul:Arguments are different. Thanks for the very fast answer. --Soued031 (talk) 08:52, 7 September 2017 (UTC)

Throw template calling this module into maintenance category under certain conditions[edit]

Is it possible to do the following? If a page directly invokes Module:Navbox, if the value at name= does not equal {{BASEPAGENAME}}, can the invoking template (but not the pages that transclude the template) be placed in a maintenance category? Steel1943 (talk) 22:33, 18 September 2017 (UTC)

That might be possible but I would have to do some serious thinking which won't happen for a while as I'm doing stuff at Commons. If no one else has ideas, consider pinging me in a week or two. You might mention an example of where the category would be useful, and briefly why. Any ideas on a category name (generic is best to allow re-use for something else)? Johnuniq (talk) 23:18, 18 September 2017 (UTC)
@Johnuniq: Here's an example. I just happened per chance to find this. I assume you know this, but since the two did not match, when I clicked the "E" in the "V - T - E" on the template transclusion, I was directed to edit the redirect instead of the template. If such mismatched were thrown into a maintenance category, they would be easier to detect, for the category name, possibly Category:Navbox templates with title and name parameter mismatch? Steel1943 (talk) 23:50, 18 September 2017 (UTC)
OK, I'll think about it later. Johnuniq (talk) 01:36, 19 September 2017 (UTC)
If possible, it might be preferable to implement in Module:Navbar so that Module:Sidebar can benefit also. --Izno (talk) 02:18, 19 September 2017 (UTC)
@Izno, Johnuniq, and Steel1943: Although it's not instantaneous, we do have Wikipedia:Database reports/Invalid Navbar links, which is updated once per month. Thanks! Plastikspork ―Œ(talk) 04:40, 19 September 2017 (UTC)
@Plastikspork: Interesting; I could be asking the wrong question ... and on the wrong talk page. Now, I wonder if there is a way to trigger all templates referenced on Wikipedia:Database reports/Invalid Navbar links to go into a maintenance category rather than use that database report page. Steel1943 (talk) 15:08, 19 September 2017 (UTC)
The database report does a monthly scan of the wikitext and generates warnings about problems it finds. It cannot and should not edit pages. My quick look of the report failed to find the page you mentioned—I don't have time to investigate. Adding tests to templates/modules causes the overhead to mount up and that expense is paid many, many times as affected pages are rendered in the future. There are over three thousand tracking categories so there are plenty of issues that need addressing. Johnuniq (talk) 22:34, 19 September 2017 (UTC)

Utterly disable category handling[edit]

I would like to have absolutely 100% control over all of the categories on my platform, but I cannot for the life of me prevent Navboxes from being automatically categorized. I have utilized |nocat=true, and while this has worked elsewhere, isn't doing a single thing to help on my created Navbox template. I would greatly appreciate any information on how to suppress these categories(or category handler altogether, if possible.) 2602:304:CF7D:A010:AC12:8F5E:4AC2:39B6 (talk) 02:16, 26 September 2017 (UTC)

your edit history shows only this page, so it's hard to tell what exactly you are talking about. Frietjes (talk) 19:19, 26 September 2017 (UTC)