Template talk:Navbox/Archive 2

Latest comment: 16 years ago by Teratornis in topic Copying to another wiki
Archive 1 Archive 2 Archive 3 Archive 4 Archive 5

text leaking

The text is leaking from the manager navbox that i have created. It is my intention that this will become standard across all of the football manager templates. As such i hope to remove this problem. This is only on firefox though and works correctly in IE7. Examples can be seen at Wikipedia talk:WikiProject Football#Manager templates. The base template can be found at User:Woodym555/Manager template. Is there a way of fixing it? thanks. Woodym555 17:27, 10 October 2007 (UTC)

Fixed i used a separate template to compose the list and this incorporated {{nowrap}} in it. Template:Football manager history Works fine now. Woodym555 16:43, 16 October 2007 (UTC)

Changing a Template

I would like to update and/or see Template:Power Rangers characters updated to use Navbox but i'm not sure how to do the sub groups. (eg: Zordon then theres I, II ect). Peachey88 (Talk Page | Contribs) 10:54, 14 October 2007 (UTC)

  • There you go, all done. --CapitalR 00:09, 15 October 2007 (UTC)

using {{navbox}} and {{navbox with columns}} together

I don't know if I've missed some information, how (if its possible) can I use them together, if you want some group/list and some columns etc. And ofc its suppose to be in the one same box. Chandlertalk 16:41, 16 October 2007 (UTC)

I've been experimenting with this recently. Check out the "Foreign relations of the United States" template here: http://en.wikipedia.org/wiki/User:Sardanaphalus. Caveat: No idea whether or not this example is a good one. Sardanaphalus 18:17, 17 October 2007 (UTC)

Navbox

Perhaps someone can help me out here. I have just been challenged for converting a ordinary author navigational box to one which uses this template. I believed this to be "normal" "standard" behavior. However having been challenged I would like to check out the "guidelines", policy" on the matter. :: Kevinalewis : (Talk Page)/(Desk) 11:53, 17 October 2007 (UTC)

  • I'm guessing you're referring to {{Gibsonian}}. There's not much official policy on Navboxes that I'm aware of (though there probably should be). The {{Navbox}} template is the most used form (used by over 10,000 other templates). I'm always a big fan of standardization, so I think that you were right to convert that template to use Navbox, and think your edits shouldn't have been reverted. Using the Navbox gives the advantage of having it stack properly with other Navboxes, giving it a standard format similar to other navigational boxes, and by simplifying the template logic. --CapitalR 22:03, 17 October 2007 (UTC)
I've added a comment in support of conversion at template talk:Gibsonian. Chris Cunningham 10:40, 18 October 2007 (UTC)

Suggestion

Well It would be great if you could have some like the above or below, but in between group/lists, I know you can have single lists, but not with a own style(?). So either being able to have something called above1-20 that goes above the group and list of that number you set (the above and above1 would be the same). And integration of columns. My idea would be colgroup1-21 and that places the colgroup above the groups. and inside all colgroups you have col1-10 with styles for all of them. Chandlertalk 13:09, 17 October 2007 (UTC)

Colorizing VDE links again

Hello, I read in Template talk:Navbox/Archive 1#Colorizing VDE links above that there are plans to allow specifying the colour of VDE links. I'd like to ask whether this is already implemented, because I wasn't able to realize how to do this now. This is important due to an accessibility problem related with the default link colours it the background style is changed, see Wikipedia_talk:WikiProject_Formula_One#Navbox_formatting. Thanks! —surueña 19:56, 23 October 2007 (UTC)

I've implemented a "VDEcolor" switch and implemented it at {{Scuderia Ferrari}}. We may look at doing it slightly differently however, with a style option similar to titlestyle (or to make that apply to the VDE links as well). Of course this has the side effect of hiding redlinks, so we need to discuss if that is a problem. violet/riga (t) 10:17, 24 October 2007 (UTC)
Thanks...looks nice on {{Scuderia Ferrari}}. A way to link it directly to the titlestyle would be fantastic and would allow Navbox-based templates to have variety. I'm thinking of {{CBB navbox}} and how different colleges could implement their color scheme for their navboxes. Unless there's another way to do that, which there very well could be...I'm pretty ignorant about the technical details of templates. WildCowboy 17:25, 24 October 2007 (UTC)
We may also need to change it to "vdecolor" (losing the capitalisation). violet/riga (t) 10:23, 24 October 2007 (UTC)

So can we think of any time when the VDE and hide/show texts will be a different colour? If not then we should improve my little hack so that it uses the titlestyle parameter for both parts. violet/riga (t) 10:27, 24 October 2007 (UTC)

IMHO a single parameter should control the style of all the titlebar text (VDE, title, [hide]) at the same time. This makes the template simple to understand and use, and otherwise you can have navboxes where those VDE and [hide] links are nearly invisible. In addition, it would be too much work to fix all existing boxes. Thanks —surueña 18:44, 24 October 2007 (UTC)
I completely agree with the above comment. The VDE/HIDE should be the same colour as the title text. This makes them consistent and accessible. At the moment you cannot see the links in some navboxes. I also agree that it would be some work to amend all the templates although i am sure a bot could recognise the title colour and add in the new parameters if needs be. Woodym555 18:49, 24 October 2007 (UTC)
This should take no more then a single edit in Navbox/core. EdokterTalk 21:10, 24 October 2007 (UTC)

Upon closer inspection, font colors of the vde links and title are problematic without introducing a 'titlefontcolor' parameter. Try setting the font color in titlestyle while linking the title; it will fail when the text is wikilinked. This is because the style parameters can't handle font colors in the current setup (the style can't override the style associated with wikilinks). It can be overridden using font tags, but this means we would also have to include font color options for the other sections to be consistent. This is the only way to a permanent solution. EdokterTalk 21:33, 24 October 2007 (UTC)

So you are proposing to add a 'titlefontcolor' parameter (removing the 'VDEcolor' completely), and modify the current usage (instead of specifying the text color in 'titlestyle' and directly on the title), isn't it? IMHO this is less elegant, but it achieves what we want after all... The idea of using a bot to modify current instances will be really needed if this is the solution chosen. Cheers —surueña 09:52, 26 October 2007 (UTC)
Basically, yes. If you want to give the title a color, it would have to be done using a HTML font tag as opposed to using a CSS style (in /core). And since you can't extract only the font-color form a style tag, you will have to pass a color explicitly. I don't like the VDEcolor parameter, as it is too narrow and defeats the purpose of this template, which was designed to standardise all navigation template parameters. EdokterTalk 14:03, 26 October 2007 (UTC)
I think I found a way to apply the titlestyle to all elements after all (using a <font style=...> hack). I'll soon make some edits to /core and Tnavbar (after testing) so that a given style will always be applied to the title, as well as the VDE links and the show/hide link. Then we can do away with the VDEcolor parameter. EdokterTalk 15:23, 26 October 2007 (UTC)

It would be easy enough to carry the titlestyle through to {{tnavbar}}, but I'm not sure if that might mess other uses of said template up a bit. I'll try and look into it when I have time. violet/riga (t) 09:59, 26 October 2007 (UTC)

Hello again. Any advances on this? Cheers —surueña 20:55, 4 November 2007 (UTC)
I finished hacking Tnavbar to accept the given style (test code here); going to implement it tonight. Then VDEcolor can be removed. EdokterTalk 16:18, 5 November 2007 (UTC)
That's great! Thanks —surueña 17:15, 5 November 2007 (UTC)

All done! Please test if it works... Also note: VDEcolor no longer works! EdokterTalk 18:00, 5 November 2007 (UTC)

Making progress...thanks! Again, I'm completely ignorant about the intricacies of templates, so maybe you can help. For example, {{GeorgiaStateBasketballCoach}} does not display correctly...non-linked text looks great, but links still display using browser colors. But I'm not sure what needs to be changed in order to correct this, as the template depends on {{CBB navbox}}, which depends on {{Navbox}}. Can you assist in figuring this out? Thanks! WildCowboy 18:40, 5 November 2007 (UTC)
Please check again... I corrected a mistake I made. It now displays red on blue for me. EdokterTalk 19:50, 5 November 2007 (UTC)
Excellent...looks great! Thanks for all of your hard work! WildCowboy 20:13, 5 November 2007 (UTC)
The D and E links are still blue to me, and thus not readable. Also, WildCowboy: please see Wikipedia:Colours - we shouldn't really be using red on blue. violet/riga (t) 21:28, 5 November 2007 (UTC)
Yep, the changes to Tnavbar were reverted...I think a fix is being deployed. I agree about the colors...checking hundreds of college athletic team templates and changing a large number of them is a daunting task though. I'll change what I spot when it's easy to do so. WildCowboy 21:45, 5 November 2007 (UTC)

Hold on everyone... My changes in Tnavbar were reverted temporarely. EdokterTalk 21:39, 5 November 2007 (UTC)

Second try... good work! Now {{Scuderia Ferrari}} looks perfect, thank you very much. I will wait still a few days to remove the accessibility banner to be sure everything is OK and there are no more problems. Cheers —surueña 09:18, 6 November 2007 (UTC)
Done —surueña 21:10, 10 November 2007 (UTC)

Why does the 'name' parameter assume template space?

Why does the Navbox/core assume that these always live in template space? Is there anyway to check to see if {{{name}}} starts with "Portal:" or the like and act appropriately vis-a-vis the v-d-e links, please? I would like for Portal:Sustainable development/Topics/Sustainability and energy development to be v-d-e able.

Also, what is the deal with noincludes in navbox's name parameter:

|name = {{{name<noinclude>|{{FULLPAGENAME}}</noinclude>}}}

Huh? CME94 02:14, 28 October 2007 (UTC)

More directly, why is there a need for a name attribute in the first place? Couldn't this just be automagic? Chris Cunningham 10:57, 30 October 2007 (UTC)
  1. A template usually lives in template space.
  2. {{FULLPAGENAME}} should not be transcluded to the article.
  3. The template does not know where it lives when transcluded, so the name is required to enable the VDE links. EdokterTalk 11:32, 30 October 2007 (UTC)

Back to the original question. How do you get Portal:Sustainable development/Topics/Sustainability and energy development to work for v-d-e? If it doesn't work now, what will it take to fix it? RichardF 19:34, 2 November 2007 (UTC)

Ah I see... I checked and it seems the 'Template:' prefix is hardcoded in {{Tnavbar}}, with no way to override (another to-do). The only way to fix it is to move your template to 'Template:' space. EdokterTalk 19:50, 2 November 2007 (UTC)
Thanks for the suggestion, but I hate wikibickering! ;-) RichardF 01:14, 3 November 2007 (UTC)
"Portalize"? Geez, what word do they come up with next? (And shouldn't that have been "portify portalify"?) :) EdokterTalk 01:24, 3 November 2007 (UTC)
Exactly!!! :-) Do you have a time frame when you or someone else might be able to get to it? No real rush I'm aware of, just curious. RichardF 01:38, 3 November 2007 (UTC)
I'll take that as a "No." ;-) RichardF 03:14, 11 November 2007 (UTC)
Well, not yet anyway. I need to experiment a bit. EdokterTalk 11:11, 11 November 2007 (UTC)

Suggestion for minor layout changes

Having put {{Navbox Television}} out of commission in favor of Navbox, I noticed a small difference in the layout of the group header. I think the group header of the TV navbox looked slightly better, and I'd like to implement a small change here, after consensus of course. Two small changes are involved:

  1. decreasing the padding of the group header form 1em to .5em.
  2. Making the group header text top-aligned.

Thoughts? EdokterTalk 23:21, 1 November 2007 (UTC)

Personally, I think the centered group-header looks better than the top-aligned one. Kirill 00:55, 2 November 2007 (UTC)
Not sure about the padding, but agree with Kirill as regards the vertical alignment. I think I'd also make wikilinks in the lists linewrap by default as I've seen odd-looking gaps appearing at the ends of lines where a long wikilink has been moved onto the next line. Sardanaphalus 18:41, 2 November 2007 (UTC)
Also, perhaps the lists' righthand margin might be increased a little in order to prevent those occasions where the "divider template" {{·}} nearly collides with the righthand edge of the template. Sardanaphalus 18:48, 2 November 2007 (UTC)

Help wanted

Hi folks, apologies if this is a stupid question but I'd rather ask here than spend hours trying to figure it out by myself.

The International Criminal Court navbox is set to autocollapse. How do I override this on the main International Criminal Court article so that it expands by default in that one article? (I'd also like to set the other navboxes in the article to collapse but for some reason the International criminal law box won't collapse for me.)

Thanks in advance, Sideshow Bob Roberts 04:34, 6 November 2007 (UTC)

Just add an empty "|state=" parameter (or fill in anything other then "autocollapse" or "collapsed") to the template. EdokterTalk 11:07, 6 November 2007 (UTC)
That doesn't always seem to work. Curiously it works sometimes, e.g. on the International Criminal Court page the last template, {{Supranationalism/World government topics}}, shows as collapsed, but not the {{International Criminal Law}} template, both same with the "|state=collapsed" switch. My actual problem though is to collapse {{Sufism}} on the Khwajagan page. __meco (talk) 02:57, 1 January 2008 (UTC)
{{International Criminal Law}} is not a navbox, just a table with navbox style. {{Sufism}} is a navbox, but has no state parameter set. Remember, state= must be set within the template; you cannot call it from the article (ie. {{Sufism|state=collapsed}} will not work). EdokterTalk 03:10, 1 January 2008 (UTC)
Ah, that is what I needed, and I also notice that that is what has been attempted in International Criminal Court. I would have thought that such an option would be useful. Could it be easily implemented? __meco (talk) 11:01, 1 January 2008 (UTC)
You could try puting the following line in the template: {{#if:{{{state}}}|state = {{{state|}}}}} Then you can pass the state parameter from the aricle. EdokterTalk 18:44, 1 January 2008 (UTC)
didn't work. __meco (talk) 19:13, 1 January 2008 (UTC)
Forgot a "|" in front of the line in the template. Try again. EdokterTalk 20:11, 1 January 2008 (UTC)
Very good :-) __meco (talk) 13:00, 2 January 2008 (UTC)

Copying to another wiki

I would like to copy Template:Navbox to another wiki but can't access the code as it's protected. Any chance of assistance? TheresaWilson (talk) 17:30, 18 November 2007 (UTC)

You should be able to access the code by clicking on "View Source" at the top of the page. Woodym555 (talk) 17:32, 18 November 2007 (UTC)
Thank muchly.TheresaWilson (talk) 17:34, 18 November 2007 (UTC)
Oh, you will also need to copy over Template:Navbox/core if you want this to work properly. Woodym555 (talk) 17:43, 18 November 2007 (UTC)
I'm also trying to implement this in an install of MediaWiki that was just set up. However, after copying Template:Navbox and Template:Navbox/core, I just get a string of code (mostly the if statements) that refuse to be parsed. It looks like I'm encountering a problem due to the fact that this seems to reference a ton of other templates or various includes. This also means that I can't tell what all of this code is doing because I'm having trouble tracing everything out to all the templates or whatever used and being able to understand what's being referenced. Can anybody help me figure out a way to either move this over or see a clearer way to code something like this myself? I think I've looked at 15 different template pages now and I'm lost. Geektastic (talk) 17:56, 20 December 2007 (UTC)
The template itself (at least as far as I can tell) only directly calls {{Navbox/core}} and {{Tnavbar}}. All other template calls are made either by one of these two templates, or by the template documentation (for reference, there is a list of transcluded templates near the bottom of the edit page). Your main problem sounds like the ParserFunctions aren't being parsed. You mentioned that it's a new installation; are you sure that the ParserFunctions extension has been installed on it? --Dinoguy1000 18:53, 20 December 2007 (UTC)
Looks like that's the issue. Thanks! 132.170.89.59 (talk) 21:21, 20 December 2007 (UTC)
My Navbox cannot display properly, showing the DIV and SPAN tag. Also, the box itself is missing, making it borderless. Any ideas?--203.125.118.13 (talk) 10:08, 4 January 2008 (UTC)
Have you copied the appropriate styles from MediaWiki:Common.css and scripts from MediaWiki:Common.js? I think the navbox class group is all you need from Common.css, and the hasClass() and Collapsible tables scripts are necessary from Common.js, though someone who knows better than I do should confirm this. --Dinoguy1000 18:48, 4 January 2008 (UTC)
(A different user than the above) I have the same issues. All the js and css is correctly in place, and the code was copied as is. I even have a test template set up. I'm thinking there's a div not being considered, but I don't know where :/. I could copy-paste the classes into the template, even, but I'm not sure that would help. If you need links, let me know. --Izno (talk) 08:14, 5 January 2008 (UTC)
We figured it out locally. We have an old version of MW (1.10.2), so we think we may be having an issue with ParserFunctions not taking <td><tr><th><span> and <div>. I don't want to dig up the bug that I'm sure is listed on bugzilla somewhere, but that's probably the reason. --Izno (talk) 19:02, 6 January 2008 (UTC)
I've checked both common.css and common.js contain the neccessary styles now running on MW 1.11.0 which should be ok? navbox still doesn't render DIV and SPAN tags but just display them.--203.125.118.13 (talk) 06:38, 7 January 2008 (UTC)
Fixed the problem, apparently by setting $wgUseTidy = true solve the tag issue.--203.125.118.13 (talk) 02:15, 17 January 2008 (UTC)
As noted above, it is a Tidy issue. However, with a little bit of tweaking, it can be used without changing Tidy. -- Ned Scott 09:22, 6 February 2008 (UTC)
I ran into the same problem, and I was able to fix it by installing HTML Tidy according to the discussion here:
However, I run backups of my wiki on several servers, not all of which have HTML Tidy installed, and according to the above discussion, if a template requires HTML Tidy, then the template contains invalid code. I.e., none of our templates should require HTML Tidy if we write them correctly. Can you tell us what you changed to get {{Navbox}} to work without HTML Tidy? I would prefer not to install HTML Tidy on my wikis unless I need it. I have seen other templates on Wikipedia with problems that HTML Tidy seems to be silently masking, so template writers do not notice them until somebody tries to port. --Teratornis (talk) 00:44, 19 February 2008 (UTC)
Teratornis also asked me this on my talk page, but I'll post it here as well: -- Ned Scott 06:09, 19 February 2008 (UTC)
Tidy basically fixes when formatting gets mixed. For example (wikitag) (html) (/html) (wikitag) would work, but (wikitag) (html) (wikitag) (/html) will break. At least I think that's how it works.. it's been a while since I explored the issue. I've converted a bunch of templates for use on Digimon Wiki. When I first started exporting Wikipedia articles to there, everything broke. It drove me crazy for a week or so. Finally, after asking around, I was able to see how to write the wiki table code without it breaking. The reason we use HTML at all is because normal wikicode gets broken when used with #if functions, but the way around this is to use {{!}} to replace I (and {{!!}} to replace ||). I already knew how to do this, but when I did I got extra line breaks in my boxes, a lot of extra line breaks.
The trick that I found out was to use <nowiki/>after the #if statement, then go to the next line to start the table row or table cell. For example:


 {{#if:{{{l1|}}}|<nowiki/>
 {{tl|!}}-


In any case, I went ahead and made a version of {{Navbox}} that has all this converted already. Basically there's {{Navbox}} and {{Navbox/core}}. Navbox/core is the part that needs the update, and that can be seen on User:Ned Scott/Navbox/core. With this diff you can see what changes I had to make. Make sure that you have the templates {{!}} and {{!!}}, and everything should work.
Let me know if you need any more help, or if it doesn't work right. -- Ned Scott 03:49, 19 February 2008 (UTC)
Wow, thanks. I'm not impressed very often on Wikipedia any more, but that was impressive. Your explanation makes sense, and adds weight to a suspicion I had some time ago with infoboxes that MediaWiki's syntax over-uses the pipe character in ways which readily lead to ambiguous parsing in complex templates. But at least we know how to get around the problem. I'm used to languages like Perl and the Unix shells that have methods for escaping metacharacters from processing. It seems like kind of a hack to have to use templates to escape metacharacters (suggesting that the original MediaWiki designers did not plan quite far enough ahead), but hey I'm grateful to get such powerful software for free. --Teratornis (talk) 18:15, 19 February 2008 (UTC)

width:auto;/max width possible?

Can the style parameter for this template have an additional "max width" setting? When using "width:auto;" if the template is collapsed, the width of the template drops down to the size of the title, which can be startling. Using a fixed width works in many cases, but can cause problems with narrow displays if the fixed size is too large. The ideal solution is to have a "maximum width" setting. This way the template will only expand to a specified width so there isn't too much whitespace inside of a template, but it can also gracefully be shrunk to smaller sizes if needed. An example of this is {{Apple}}. On very wide pages the template looks "left heavy" and the whole right side of the template has way too much whitespace. An example of a template that has a fixed width to try and overcome this limitation is {{Final Cut Studio}}. However, in very small windows, the template forces horizontal scrolling instead of dynamically resizing like {{Apple}} does. Is there any way to implement a "width-max:xxpx;" setting or some other way to be able to control the behavior of these templates? It would be ideal if width:auto; had an additional parameter you could specify that would add a max/min width. PaulC/T+ 19:01, 18 November 2007 (UTC)

You can add any CSS tag to the bodystyle parameter. Try adding a max-width tag. Be aware though that this wouldn't work in all browsers; one of the reasons we try to keep CSS as lean and compatible as possible. EdokterTalk 19:57, 18 November 2007 (UTC)
Hmm... "style = max-width:xxpx;" doesn't seem to work in Safari... I'll try some other browsers... Is that the correct syntax? PaulC/T+ 00:02, 19 November 2007 (UTC)
Syntax is correct, but like I said, it's a property not supported by all browsers. EdokterTalk 00:51, 19 November 2007 (UTC)