Template talk:Dynamic navigation box

Purpose

edit

This template provides a method of dynamically hiding or revealing large navigation boxes.

Usage

edit

{{Dynamic navigation box|TITLE=title|CONTENT=content}}

title
heading of the navigation box
content
contents of the navigation box. It is not possible to include a pipe ("|") in the contents as this symbol is used to separate parameters; type '|' instead.


Example

edit

From {{Portals}}:

{{Dynamic navigation box|TITLE=[[Portal:Browse|'''Browse by themes''']]
|CONTENT=
[[Portal:Africa|Africa]] - 
[[Portal:Agronomy|Agronomy]] - 
[[Portal:Algeria|Algeria]] - 
[[Portal:Ancient Egypt|Ancient Egypt]] - 
[[Portal:Archaeology|Archaeology]] - 
[[Portal:Art|Art]]
.
.
.
}}

History

edit

Added documentation Phil | Talk 09:10, 26 September 2005 (UTC)Reply

Discussion

edit

Support for skins other than Monobook

edit

The CSS code to make this work seems to have been included into the Mediawiki:monobook.css, but not in others. Would someone be so kind and enable it for the others ? (Mediawiki:Cologneblue.css, Mediawiki:Standard.css, etc. Maybe it can be included in Mediawiki:Common.css ? -- User:Docu


I oppose this template completely. You're using a template to perform a function which really should be requested/added as a software feature. Templates should be used to replicate text among articles, not change the fundamental navigation structure outside of the article body. -- Netoholic @ 19:33, 2 January 2006 (UTC)Reply

Hiding and showing content is something that should be requested as a built-in to the software, where the Javascript code (currently in MediaWiki:monobook.js can be put through proper development practices, like CVS. -- Netoholic @ 20:04, 2 January 2006 (UTC)Reply
I'm not sure I understand. Is this template not the right way to accomplish a hideable box? How would a software change make this process any easier? And has someone started taking this 'feature request' through the 'proper' channels? -- Ec5618 18:09, 30 January 2006 (UTC)Reply

Option to hide or show as default

edit

There should be an option to hide or show the content by default. This template is worthless if it's showing everything by default. —Cantus 16:01, 25 February 2006 (UTC)Reply

I don't know how to make it an option within the template, but hidden being the default makes a lot more sense to me so I have tweaked MediaWiki:Monobook.js to make it so. If anyone objects let me know and I'll change it back. Worldtraveller 16:00, 14 March 2006 (UTC)Reply
A great many people object, including me! See your talk page, the Monobook.js talk page and The Village Pump. I( now) understand that you meant well, but this has greatly reduced the usefulness of many templates. I don’t know much about these things, but perhaps another class of template could be created to be hidden by default? -- WikidSmaht (talk) 05:13, 16 March 2006 (UTC)Reply
I like hidden by default, but this should certainly be an option that can be set on a per-template basis. Does anyone know how? — Reinyday, 17:12, 18 July 2006 (UTC)
I also would like to set this box to hidden as default. I can't figure out how this works - does this call the .js application? If so, how? If so, can a different .js be called that is modified to be set to hidden as default? I saw another dynamic navigation box that starts out hidden, but i have no .js experience so i have no idea how this works. Is there a page that explains this? Sorry for the ramble. See Template:WPMILHIST_Announcements for the default hidden navigation boxes. Thanks --Exodio 02:34, 27 August 2006 (UTC)Reply
Not sure, but I think it starts hidden when there's more than one hide/show navbox on the page. Shinobu 00:52, 31 October 2006 (UTC)Reply
If there is more than one, then the first should be open and the remainder closed. What's the point of a series of navigation boxes all closed so that there's no navigation links to click on? Conversely, what's the point of putting a "hide" link on a bunch of boxes which clutter the page—to let the user design the page the way it should have been in the first place, every time he loads it? There is a kernel of excellent usability here, but it has not germinated.
AND WHERE THE HELL ARE THE MAIN DOCS FOR ALL THIS STUFF? I've only been trying to find them for a half hour. Michael Z. 2006-10-31 03:51 Z

Would someone update the above to make it work in that skin as well? I'm not sure if that js-page is included though. I made the necessary additions to MediaWiki:Cologneblue.css for this template. -- User:Docu

Hiding a wikitable

edit

Hi, has anyone figured out, how to add a hide option to large wikitables that the user can expand open if they want to --Cloveious 03:32, 12 August 2006 (UTC)Reply

WIDTH parameter working?

edit

I can't seem to change the width of the box. I'd like to use 94% (same as {{NavigationBox}} but the WIDTH parameter seems to be ignored. Andrwsc 03:00, 29 September 2006 (UTC)Reply

Never mind, I fixed the bug. Andrwsc 03:13, 29 September 2006 (UTC)Reply

{{navigation}}

edit

This template looks like it's basically superseded by the template above, which provides v-d-e-links. Shinobu 15:25, 30 October 2006 (UTC)Reply

What broke it?

edit

The first village on Template:Engadin_villages is now on a separate line. Is it the change from <div> to a wikitable version that broke it? If yes, how can it be fixed? Change it back to div? -- User:Docu

I'm not sure what broke it exactly, but I fixed it by eliminating the returns on each line. —Seqsea (talk) 22:50, 27 November 2006 (UTC)Reply
That was what I had to do to a lot of templates too, but I'm not sure why that should matter. Andrwsc 00:07, 28 November 2006 (UTC)Reply
This leads to a lot of spaghetti. Can we switch it back to the <div> version? (Andrwsc just changed it without explaining what problem this resolved). Currently it's out of sync with the version with the image. -- User:Docu
Sorry for not explaining here. The old version has two significant problems that affect over 3000 articles on the Olympics (namely, articles of the form "Nation at the year Olympics", such as United States at the 1998 Winter Olympics, to provide an example instance). All of these pages include a navigation box that was constructed using this template. The first problem is that some of these navigation boxes are quite large (e.g. recent Games have ~ 200 nation articles) and so the importance of having a functional STATE parameter (defaulting to "collapsed") is high. Second, and certainly a bigger problem, is that the old version produced incorrectly rendered navigation boxes. They were drawn immediately after the previous line of article text. On stub articles like the one above, that would occur in the middle of the vertical span of the infobox on the right, so the box would start with perhaps 65% of the page width available. Also, strangely, the box would end after the end of the infobox span, so that there was a lot of whitespace within the box. It would also result in an irregular polygon shape instead of a simple rectangle. It is hard to explain, but trust me - it was butt-ugly. Andrwsc 05:01, 28 November 2006 (UTC)Reply
Last winter, when I added a few infobox to Olympic skiers, I think I was one of the first to use the template for the infoboxes and they looked fine to me. Odd that they don't work any more. The current solution is not very satisfactory, e.g. St. Moritz has three different formats for the nav boxes. -- User:Docu

Problem with Template:NZR Lines

edit

Some of the table formating appears in the resulting table eg "class="navbox collapsible autocollapse" style="margin: auto; "", and also a spurious "|}". Can someone take a look as I cannot spot the problem. eg Template:NZR Lines

ThanX NevilleDNZ 10:42, 20 December 2006 (UTC)Reply

I changed the inclusion of NZR Lines above to a link. I hope you don't mind. That template sure needs a clean up. It appears that boxes in boxes is the goal here. But I am not an expert on this subject. NevilleDNZ, can you tell me the desired output for these recursive boxes? --ChoChoPK (球球PK) (talk | contrib) 20:35, 20 December 2006 (UTC)Reply

re: Desired output....

Basically the template is working except for the 'class="navbox collapsible autocollapse" style="margin: auto; "', and also a spurious "|}". If I could help remove these and the problem is fixed. NevilleDNZ 20:49, 20 December 2006 (UTC)Reply

I'm asking what the expected hierarchy is. From what I can see from the code, I'm guessing
New Zealand Railway Lines
Main lines
North Island
South Island
Secondary lines
North Island
South Island
Branch lines
Upper North Island
Lower North Island
Upper South Island
Lower South Island
Private lines
Is that correct? --ChoChoPK (球球PK) (talk | contrib) 22:47, 20 December 2006 (UTC)Reply

The nesting seems unnecessary to me; people shouldn't have to click 2 [show]s to get to a line. I propose 4 top-level show/hides in total, with everything in each of the 4 displayed completely. For the first one,

Main lines (everything under here is shown when [show] is clicked)
North Island: East Coast Main Trunk • North Island Main Trunk
South Island: Main North Line and Main South Line, known together as the South Island Main Trunk

Pomte 16:58, 24 December 2006 (UTC)Reply

I have fixed the problem, it seems to be a bug in the following line: {{#if:{{{COLOR|{{{color|}}}}}}|style="background-color: {{{COLOR|{{{color}}}}}}"}}. I suspect that the #if: does not nest properly. So I picked up a pre-#if version, and using this I create the template:Dynamic_navigation_box_nested. Now Template:NZR_Lines works fine.

Removing the nesting as Pomte suggests would also solve the problem, but I believe the bug manifests itself in some 3000 Olympic sport events pages, so it would be better to attack the root cause in "#if:" failing to nest.

NevilleDNZ 21:05, 24 December 2006 (UTC)Reply

The problem with that #if: may be that there's no ending semi-colon. Thank you for creating Template:Dynamic navigation box nested; I was looking for something like that to use for another template. I want to add a parameter for the default state the nested box (like "state" in Template:Navbox generic). Also, personally I don't care but it seems the convention is for parameters to be lowercase. Pomte 21:31, 24 December 2006 (UTC)Reply

Please don't create template in an ad-hoc fashion. Historical Template:Dynamic navigation box is actually a copy of an existing Template:Navigation. So I just changed Template:NZR Lines to use Template:Navigation. The reason why Template:Dynamic navigation box can't do nested is not because of the #if. It is because of 2 things
  1. When you specify a parameter to a template, any heading space and tailing space will be removed
  2. To make a nested table, you need to start {| in a new line. But because of point 1, you can't
Template:Navigation is capable becuase it doesn't use table. It uses <div> instead. How to make Template:Dynamic navigation box capable of being nested is beyond me. Ask User:R. Koot if you really want. --ChoChoPK (球球PK) (talk | contrib) 22:29, 24 December 2006 (UTC)Reply
I will raise WP:TFD on Template:Dynamic navigation box v0 and Template:Dynamic navigation box nested. --ChoChoPK (球球PK) (talk | contrib) 22:34, 24 December 2006 (UTC)Reply

ThanX for fixing the problem. I have raised a speedy delete on v0/nested version of this page. BTW: You could have used the <table> ~ </table> construct instead of the \n{| ~\n|} to solve the problem? Cheers NevilleDNZ 19:55, 25 December 2006 (UTC)Reply

Good idea. I will try. --ChoChoPK (球球PK) (talk | contrib) 00:39, 26 December 2006 (UTC)Reply

v · d · e

edit

I specifically chose this template because it didn't have the stupid "v · d · e" links. Now that they have been forced onto this template, what options do I have? Are there alternates to {{Dynamic navigation box}}, or can we add an option to make them optional (pardon the pun) for specific instances?

In case you are wondering why I want to get rid of them:

  1. The labels are extremely non-intuitive. A single letter is next to useless except for experienced Wikipedians who have already figured them out. And using "d" for "Talk"?
  2. "v" doesn't help much that you can't already see by looking at the template. "d" isn't important enough to be shown on the template instance. If anything, I think that whole set of three links ought to be replaced by a single "[edit]" button (spelled out in full). However, I know there is huge momentum behind the existing scheme, so I can't see my voice making any difference...
  3. In my specific case, I am managing a set of navigation boxes that are somewhat "closed". That is, they include a set of links that doesn't need frequent editing. For example, {{CanPM}} (which doesn't use any of the navigation box meta-templates but is still a good example) would only need a single update anytime a new Prime Minister assumes power, which is usually once every few years. These types of navigation boxes do not need an edit button up front on the template's title bar. Of course, they are still editable the "normal way", but the clutter is unnecessary on the template itself.

I want to use a standard navigation box meta-template instead of hard-coding it myself (like the aforementioned CanPM), but I don't want the non-intuitive clutter of "v · d · e". Any suggestions? Andrwsc 18:04, 4 January 2007 (UTC)Reply

I first found vfe unintuitive too. But it didn't take me long to figure out d is for discussion. And v can show you things like documentation of anything in the <noinclude> tag. --ChoChoPK (球球PK) (talk | contrib) 18:42, 4 January 2007 (UTC)Reply
On the other extreme, a template can be updated frequently or highly parameterized. In that case, vde is helpful. In your case, perhaps an "edit" will do fine. Perhaps an option to choose between the two? --ChoChoPK (球球PK) (talk | contrib) 18:44, 4 January 2007 (UTC)Reply
Yeah, I agree with both points: 1. You have to "figure out" what vde means, as it is not instantly obvious. 2. Not all navigation boxes have similar issues, so it would be nice to parameterize the differences. Andrwsc 18:49, 4 January 2007 (UTC)Reply
Have you considered Template:NavigationBox? It doesn't have vde and some presidents lists are using it. Pomte 20:24, 4 January 2007 (UTC)Reply
I really want the show/hide functionality. When I selected this template, my perception was that it was otherwise identical to NavigationBox, but just added the show/hide feature. Now, there is more divergence than that. Andrwsc 20:27, 4 January 2007 (UTC)Reply
If I understand correctly, before this latest change, this template showed v·d·e only if the name parameter was given. The doc implies that the only reason the name parameter exists is for the v·d·e links, so it is not necessary for this parameter to be mandatory. So IMO this change should be reverted, as not all templates lacking this parameter are "hopeless". Pomte 21:54, 4 January 2007 (UTC)Reply

The following is in response to the point brought up by Andrwsc.

  1. I partially agree with you on the letters, I'd rather have the View - Talk - Edit version of {{Tnavbar}}. However, v-d-e each has a title or Tooltip giving the same description as the tap on the top of the page. Also, v-d-e comes from View - Discussion - Edit.
  2. Should template just have a [edit] or just a view link? This has been discussed repeatedly. See discussions: Template talk:Navigation#v-d-e and Template talk:Tnavbar#v·d·e or v?. I am fully will to add viewplain and miniv.
    • View (v) Allow you to view the template with <noinclude>s used for documentation and it may change depending if there were any parameter in the template.
    • Talk (d[iscussion]) obvious.
    • Edit (e) is there to promote spontaneous editing.
  3. See WP:OWN.

Also, the "normal way" is just horrible, the editor has to dig out the template name from the source and then know that it needs to prefix it with Template: before pasting it the in the address bar. Needless to say only experienced editor can accomplish this.

As for that comment on the "hopeless" template, it was referring to British Rail Diesel Loco templates which seem to abandoned and unmaintained. You can see the other by going to Category:Dynamic navigation box without vde

Ultimately, I see three template types: one that uses Navframe, another that uses Collapsible, and one that has a groups with lists. All with nearly the same parameters.

I also think there should be a template beside Template:hidden that can be used with navboxes (and doesn't break when JavaScript is disable) so we don't have atrocities like Template:NZR Lines.

--Dispenser 23:24, 4 January 2007 (UTC)Reply

I am fully aware of that previous discussion and of the motivation behind "v · d · e" in the first place. I'm not sure if you are asking me to look at WP:OWN because you think I am demonstrating ownership symptoms myself, or because you are reinforcing the motivation for these buttons. I trust it is the latter reason.
As I've mentioned, I believe that there are two problems with the current version. First, an editor has no control over whether they want those buttons there or not, and there are good reasons for not always having them. For the same reason that the "color" parameter was added back to this template, so should a mechanism be added to selectively choose what the title bar contains.
Second, the visual appearance of the whole "v · d · e" thing is clumsy and ought to be reviewed. In my opinion, the most logical thing would be for a single "[edit]" link to appear on the right hand side of the template header (this would imply a different position for the [show]/[hide] buttons), ideally user-selectable in the same way that section editing is enabled/disabled by user preferences. This makes spontaneous editing of a navigation template very similar to spontaneous editing of an article's main body. The same button style (namely, "[edit]") does a similar thing in both cases. I think "v" and "d" are extraneous once you have "[edit]" (especially since they are both a single click away from the open edit screen), and only contribute to clutter if present. However, I think I may have a minority opinon here...
I spent a lot of time converting some old nav boxes to use {{Dynamic navigation box}} because I believe in the value of visual consistency across Wikipedia and using meta-templates as a tool to achieve that. I have had to weather the storm while this template was being thrashed around (e.g. re-edit all the templates to concatenate all the contents onto one line to fix a problem introduced here). However, it would be unfortunate if I had to abandon use of this template if I can't use it to create what I'd like to see.
Andrwsc 23:56, 4 January 2007 (UTC)Reply
On the first point, I made the argument mandatory after nearly all the templates were converted, and there were new templates that didn't bother using it. I would prefer having v-d-e switch on by default to avoid re-editing new navboxes.
On the second point, I mostly agree with you. However, implementation would be very difficult for the user selectable part. It was also argued to me that hide/show would be used more often.
Dispenser 04:49, 5 January 2007 (UTC)Reply
Originally, I thought that [show]/[hide] ought to be on the right, but now I think [edit] ought to be in a consistent location for all situations. There is some merit to having [show]/[hide] appear immediately after the title (on the right), which would mirror the appearance and behaviour of the TOC control. Andrwsc 05:05, 5 January 2007 (UTC)Reply
I have created a working demo hack what it would be with the an [edit] button on the right and [hide]/[show] on left.
Dispenser 18:28, 5 January 2007 (UTC)Reply
edit

Would it be possible to add an optional parameter to this template allowing the vde and show/hide links to be color controlled? For example, at WikiProject College football we have lots of template that we would like to switch to this template to add the vde and show/hide capability, but quite a few of our templates use dark colors (school colors) for the background of the title bar. Thus, the vde and show/hide links won't show up since they are the default blue. If we could control them, we would make them identical to the other school color that is used in the title. See Template:NittanyLionsCoach for an example of the problem. We would change the color to the white which would match the title font color's. This should of course be optional as most templates using this won't need it. --MECUtalk 18:06, 11 January 2007 (UTC)Reply

Unfortunately, the current implementations of the two don’t all changing of the link colors, although you can change the text color. If you wanting to standardize on a single template I’d recommend that you create a project meta-template (e.g. {{CFB navigation}}) with parameters similar to {{Navigation}}. You could then attempt to apply hacks to it until the problem(s) are eventually fixed. Some thing that spring to mind are drop shadows or custom coded {{Tnavbar-rugby}}. I'd be willing to help with coding. --Dispenser 21:35, 12 January 2007 (UTC)Reply
This has been updated for {{Tnavbar}}. It is now possible to add a fontcolor=color attribute to set the v • d • e colors like so: (examine the code by editing this section). Cheers. (Netscott) 17:51, 18 March 2007 (UTC)Reply