Template talk:Navbox/Archive 7

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Archive 6 Archive 7 Archive 8

Title

Recent changes seem to have removed the title from {{Politics of Germany by state}} and I'm sure others. Cuold someone look into this please. Thx AndrewRT(Talk) 16:58, 2 May 2008 (UTC)

Many thanks!! AndrewRT(Talk) 18:50, 2 May 2008 (UTC)

Crash on Firefox

http://en.wikipedia.org/wiki/Template:Navbox crashes on FireFox (2.0.0.14). Some pages using Navbox also crash FireFox (for example, the current version of 2008 Stanley Cup Playoffs). (Chinissai (talk) 21:43, 6 May 2008 (UTC))

Not sure what is happening with your FireFox but its definately not crashing mine. -Djsasso (talk) 21:49, 6 May 2008 (UTC)
OK, the problem seems to originate from an add-on called Thai Words Separator. Disable that and crashes gone! Thanks. (Chinissai (talk) 22:22, 6 May 2008 (UTC))

Ported to outside Wiki - Problem if no image defined

I have ported this template (both Navbox and Navbox/core) to a wiki not accessible from the internet (so this may be a bit difficult to diagnose). The template works fine if the image parameter is defined, but if it is not, the group cell widths are increased to fill up the whole width of the screen minus the list items cell width (which is squeezed to the smallest size possible while still allowing the text to be readable. I used the User:Ned Scott/Navbox/core version to fix some problems that this particular Wiki was showing with the template. I am content for now to just have an image on the Navbox, but if in the future we have something that doesn't need an image, it would be nice not to have to worry about it. If need be I can post some of the coding, but I will have to print it and copy it over long hand since the two networks do not touch and I am in a no removable media environment. Tigey (talk) 17:18, 8 May 2008 (UTC)

Well first, {{Navbox/core}} is now obsolete and is not used by this template anymore, so you don't need to port it. The {{Navbox}} code recently underwent a major revision, so be sure that you're using the most up to date code. Next, be sure you got all of the proper CSS classes for navbox in MediaWiki:Common.css and the collapsible table code from MediaWiki:Common.js (the CSS was recently updated too, so double check you have the newest code). In the CSS file there's about a dozen classes you need to copy (.navbox, .navbox-group, .navbox-title, etc). --CapitalR (talk) 17:21, 8 May 2008 (UTC)
Alright. I have copied over the code from the Navbox template, and added the necessary coding to the Common.css and Common.js files. However it did little to alleviate the problems we have been having with this template. Due to the insane styling screwups that were making the Template:Navbox page difficult to read (some of the output was displayed under the logo area at top left, and the Navigation tools where pushed all the way down to the bottom) I commented out the documentation call at the end so that I could get a handle on what was going on. Currently the Template page is seperated from the tabs at the top and all that displays is "". In a sandbox, I tried the following:
{{Navbox
|Name = Test Name
|title = [[Top Level Page]]
|image = [[Image:125px-picture.jpg]]

|group1 = [[Group 1]]
|list1 = [[List Item 1]] [[List Item 2]]
|group2 = [[Group 2]]
|list2 = [[List Item 3]] [[List Item 4]]

}}

What I go was:

<tr><th style=";" colspan"3" class="navbox-title">
view.talk.edit
Top Level Page</th></tr?,tr style=height:2px;"><td></td></tr><tr><td class="navbox-group" 
style=";;">Group 1</td><td style="text-align:left;border-left:2px solid #fdfdfd; width:100%;padding:0px;;;"
class="navbox-list navbox-odd">
List Item 1 List Item 2</div></td><td style=width:0%;padding:0px 0px 0px 2px;" 
rowspan="3">Image:125px-Picture.jpg</td></tr><tr style=height:2px"><td></td></tr><tr><td 
class = navbox-group" style=";;">Group2</td><td style="text-align:left;border-left:2px solid
#fdfdfd;width:100%;padding:0px;;;" class="navbox-list navbox-even">
List Item 3 List Item 4</div></td></tr>
</td></tr></table>

I figure I am intermediately wiki-savy, so this beats the heck out of me. I am having a hard time following this template, but I would really love to have it's functionality. Any hep would be appreciated. Unfortunately, the Wiki that I am using is not accessible from the Internet. All of the code above was transcribed by hand, so there may be some minor errors in there like missing "<>" or something. Any help would be greatly appreciated. Tigey (talk) 17:36, 12 May 2008 (UTC)

Hmmmm....looks like most of the internal code is working the way it should, except for the first line. Could you get me a screenshot of what the navbox looks like on your wiki (a shot of your entire browser), and another screenshot of the exact (and entire) output code for the whole page? That's probably the only way I'll be able to figure this out from afar. Also, this template depends on {{tnavbar}}, so you should make sure that one is fully up to date (and I believe that it also requires some CSS classes of its own, namely, "plainlinksneverexpand" and possibly others). Oh, and the "name" parameter is all lowercase, not "Name". --CapitalR (talk) 17:58, 12 May 2008 (UTC)
It would also be helpful if you could calculate checksums for the copied material, as they would immediately reveal if you had made a transcription mistake - at least then you would know there was a problem to look for. —Dinoguy1000 19:21, 12 May 2008 (UTC)
Here are a couple of screen captures. Image:IPed Screenshot.png Image:IPed Screenshot2.png Notice the separation from the tabs at the top, and the tendency for the text to run through items like the tNavbar output. On the Screenshot2 image, not the text behind the top/left logo. Unfortunately I have no way to generate checksums on the network to which I am porting this. When I copied over to the wiki that IS on the internet (Same setup) I copied the entirety of the page. Currently for the Navbox Template I have ported directly from Wikipedia/MediaWiki: Template:Navbox, Common.css(Just the navbox styles), Common.js (Just the collapsible table code). I will try porting the TNavbar (we have an older version, but a first look says that it is going to require some work to fix too. Specifically it leaves a after the links, and forces the title of the template on which it is called to be pushed down below the View.Edit.Talk links. Anything you can tell me will be of help. Thanks for your help!Tigey (talk 12:18, 13 May 2008 (UTC)
ZOMG it's the famous CIA wiki! 81.94.106.82 (talk) 19:28, 14 May 2008 (UTC)

It's the tidy problem. There's some option called "tidy" that we have that other installations of MediaWiki don't normally have, and that normally breaks things with templates being copied over. I explained it once on User talk:Ned Scott#Porting Template:Navbox to other wikis, and I've been meaning to make a better explanation on WP:TRAN (which is also starting to list already converted templates, as well as a copy of Commons.css and .js that will work well on other wikis). I'll probably give another stab at this myself tonight. -- Ned Scott 04:40, 14 May 2008 (UTC)

Yeah, I've been working with User:Tigey via email and chat and that's the conclusion we just came to also. Any help with it is greatly appreciated though, since I don't know much about the tidy feature or its configuration. --CapitalR (talk) 06:00, 14 May 2008 (UTC)
Really, what needs to be done is updating this template so that Tidy isn't necessary for proper rendering (and while we're at it, do something about erroneous trailing semicolons in style attributes... and empty style attributes (seriously, look at the source for a navbox and count the number of times you see style="...;;" or style=";", although this is a problem with most templates that let you define custom styles)). —Dinoguy1000 17:17, 14 May 2008 (UTC)
Well the template (as a whole) produces html code that is perfectly correct as far as I can tell. It appears to me that on the other wikis the tidy function is being called after each parser function, which is causing the problems (the output of a specific parser function gets prematurely tidied, instead of just the entire template output being tidied as a whole). English Wikipedia doesn't call the tidy function after each parser function, which is what it should do, but the other wikis are calling tidy. In English Wikipedia, like I said before, the total output is good html so the tidy function has no effect, so there is really no need to change the {{Navbox}} code. If other wikis want to use this code, they'll have to disable tidying after each parser function to get it to work. As far as removing the style="...;;;..." calls, why bother? That code is used to force semicolons between different styles, and is necessary for backward compatibility and to protect against users forgetting them. I don't think it's that big of a deal to have a few extra semicolons here and there. It's a feature with a purpose at the cost of probably an extra 25 bytes. --CapitalR (talk) 17:27, 14 May 2008 (UTC)
As a potential fix, could we take a look at the Tidy.conf file some how that Wikipedia uses and use that. If I can replicate the environment as close as possible to this one, I don't see why it would still generate errors. Is there a way to see the source for Tidy.conf similar to Common.css? It resides a couple directories lower in the file system, but you never know. Tigey (talk) 19:17, 14 May 2008 (UTC)
When I asked about this on Wikia they told me it was something a dev had to set. -- Ned Scott 06:35, 15 May 2008 (UTC)
Made a post to Village Pump (Technical) After some playing around on my own wiki environment I found that HTMLTidy did not seem to be enabled. I enabled it, pointed it to the Tidy.conf file, and nothing has changed. A reply in VillagePump was made that it may be one of the other extensions installed to Wikipedia that I do not have. I will try tonight to install some of the likely ones and see if that alleviates the problem. Tigey (talk) 17:07, 16 May 2008 (UTC)
What version is your wiki running? If it isn't at least 1.12 final, try upgrading to that to see if it works.--Izno (talk) 05:31, 18 May 2008 (UTC)
Aha! On your separate wiki environment (from your post at the VP), you're running 1.11. This may be part of the problem; with 1.12 (final) comes a new preprocessor, which may have dispatched that problem. --Izno (talk) 05:39, 18 May 2008 (UTC)
Lo and behold! It werks! I installed the 1.12 version and it is now, as they say, all good. Now the hard part... Getting the admins on the wiki that I am porting this to to upgrade.... Tigey (talk) 18:07, 18 May 2008 (UTC)
Also, in the release notes for ver 1.12 it alludes to a bug that was fixed Bug 5678 that affected Templates with variables in the Else portion of #If Parsers. This is also a likely cause of the problem since this template is chock full of em. Tigey (talk) 18:17, 21 May 2008 (UTC)
Hey, that's great news. Let me know if there's other stuff you'd like me to look at for you (and sorry I've been a little busy lately and haven't been much help). --CapitalR (talk) 05:07, 22 May 2008 (UTC)

State: has something changed?

An empty value of the state parameter always meant show, and I defined lots of templates on that assumption. Now it seems this no longer works - templates are being hidden where previously they weren't. Example: the "Pomeranian Voivodeship" template at the bottom of Chojnice County (and similarly with most other Polish "counties"). Is there some good reason for this? Any chance of it being changed back, or do I have to go round all these templates changing the default state from empty to something else?--Kotniski (talk) 10:21, 10 May 2008 (UTC)

There was a major code upgrade on May 2nd, but it should not have changed functionality. However, looking more closely at the code, a blank state= parameter now seems to be ignored and default to autocollapse, and the documenttation does not reflect this. In fact, we tried to make it backward compatible, but we seem to have missed this one. CapitalR, the current code's architect, can tell you more. I think the idea was to eliminate the blank state= paramter in the long run. So maybe it's best to include the following code in your templates
| state = {{{state<includeonly>|uncollapsed</includeonly>}}}
Hope that helps. EdokterTalk 12:33, 10 May 2008 (UTC)
Yeah, sorry about that one, but I think it makes a lot more sense for a blank state parameter to autocollapse the template, which is the same as just not even including the state parameter. It just doesn't make sense for a blank parameter to do something different than not including the parameter at all. I can do a quick AWB run to fix those ones that were affected. --CapitalR (talk) 13:17, 10 May 2008 (UTC)
OK, that would be great. In the case of mine it would be a case of replacing
| state = {{{state|}}}
(possibly with different spacing) with Edokter's code as given above. Thanks,--Kotniski (talk) 13:24, 10 May 2008 (UTC)
There we go, should be all taken care of now. --CapitalR (talk) 14:22, 10 May 2008 (UTC)
I was under the impression that backward compatibility was built in, but I like it better this way anyway; I've corrected the documentation accordingly. EdokterTalk 14:34, 10 May 2008 (UTC)
Yeah, this is how I thought it worked originally; I didn't realize until just before I deployed the new version that I had changed the functionality, but I decided this way made more sense. Since there haven't been too many complaints, I think it was a good idea. --CapitalR (talk) 14:43, 10 May 2008 (UTC)
Thanks for doing the conversion. Could you do those in Category:Poland province (voivodeship) templates as well, as they seem to have been missed? Or if it's not convenient, I can do them by hand (should only be 16 of them).--Kotniski (talk) 08:17, 11 May 2008 (UTC)
All taken care of. --CapitalR (talk) 08:26, 11 May 2008 (UTC)
Great, thanks:)--Kotniski (talk) 08:46, 11 May 2008 (UTC)

{{High-use}} insted of {{intricate}}

Currently at the top of the documentation this template uses the {{intricate}} warning. I intend to change that to the {{high-use}} warning instead.

I have always felt that {{intricate}} doesn't really fit for high-risk / high-use templates, since it mostly talks about the code being intricate. That {{navbox}} is intricate is pretty obvious when one looks at the code or documentation, no need to tell that. What is not obvious from just looking at navbox is that it is used on 652,000 pages. So the {{high-use}} template is a way of telling that.

Also, I have noticed that many admins are sloppy and don't use sandboxes, instead they try things out directly on protected widely used high-risk templates. Edit comments like "just testing" on templates used on 100,000 pages or more are all too common. The {{high-use}} template points them to the /sandbox and /testcases instead.

I intend to add this code:

{{high-use| 600,000+}}

Which will render like this:

Any comments? Oh, and any suggestions for improvements of the {{high-use}} template are welcome.

--David Göthberg (talk) 16:43, 15 May 2008 (UTC)

  • Add the high-usage, but leave the intricate template, because the navbox is intricate after all. EdokterTalk 20:29, 15 May 2008 (UTC)

border-left color of th

I was wondering why <th style="border-left:2px solid #fdfdfd;width:100%;|<th style="}};" is the way it is, with regard to the color of "border-left". Why isn't it transparent, and/or not declared to begin with? This question also applies to the twenty other instances of this as well, for each row's th. The only class which takes this color for border-left in common.css is .navbox-list, and the other two classes — .navbox and .navbox-subgroup — which take this color refer to background. --Izno (talk) 01:56, 16 May 2008 (UTC)

This is because the 2px gap between the groups and lists has to be drawn with a border instead of a spacing between the cells (this is done in order to make the navbox nest-able inside of itself). Thus, the border color is set to match the background color of the navbox as a whole. I recently added that CSS to MediaWiki:Common.css, so in a few more weeks (after common.css propagates to all users) we'll be able to remove it from the Navbox code again. It's a strange way of rendering cells, but it's the only way possible to make them perfectly nestable (believe me, I spend many many hours trying to do it another way). The downside is that if someone wants to use a different background color than the default, "liststyle = border-color:#xxxxx;" must be used to ensure the 2px gap matches it. Fortunately, I did a database scan and of the 35k templates using Navbox, only 2 used a different background color (not counting templates that used a white background, which is close enough). The other side effect is that if anyone wants to put borders around the list cells, they lose the gap between the lists and groups; again, a database scan showed that of the 35k templates, 0 used borders around the whole list area, so it's not a problem. I wish we could use a transparent border, but IE and Firefox don't agree on what transparent means. --CapitalR (talk) 02:18, 16 May 2008 (UTC)
Unfortunate how browsers can be inconsistent (I blame IE, but to each their own). So, after the CSS is done propagating, what will the final code be for any given th? I'm asking as I'm copy-pasting to an external wiki; presumably, the same, except for <th class="navbox-list" style="border-left: 2px solid; width: 100%;? --Izno (talk) 04:41, 16 May 2008 (UTC)
The final code will not contain any of the border-left statements in any of the cells. There is a parameter called "border"; be sure not to delete that (it's unrelated and coincidentally named border also). Just delete all "border-left:...;" and it should work. --CapitalR (talk) 05:20, 16 May 2008 (UTC)
Excellent; thank you for the aid. That also means that <th class="navbox-list" style="width: 100%; is correct? --Izno (talk) 05:41, 16 May 2008 (UTC)
Yup. Just make sure you've got all the latest CSS from MediaWiki:Common.css. --CapitalR (talk) 05:58, 16 May 2008 (UTC)

Possible code change?

Is it possible to remove the <td></td> and <tr></tr> stuff and replace them with other code?--Richard (Talk - Contribs) 22:42, 16 May 2008 (UTC)

No. The template uses raw HTML tables instead of wikitables in order to minimize conflicts with parser functions. EdokterTalk 22:56, 16 May 2008 (UTC)
Yeah, the code would be much longer and more complicated using wikitables, and frankly I'm not sure it's even possible at all. --CapitalR (talk) 00:29, 17 May 2008 (UTC)
It's completely possible, and isn't always that much more complicated. I've done a bunch of these kinds of conversions myself, and am currently doing one for a copy of Navbox now for other wikis. From a compatibility standpoint (reuse is one of our goals), I support doing this, but I understand if others have objections. It's hard to get people to change when there's not a lot of incentive for Wikipedia's own use. -- Ned Scott 04:36, 18 May 2008 (UTC)
And on another note, this really is a mess of a template. It would have made far more sense to just enforce a MOS guideline and keep the vast majority of these templates simple in their code. We have Wikitable code, parser functions, and the like, specifically for these reasons. -- Ned Scott 04:37, 18 May 2008 (UTC)

(Warning: Answer isn't very focused but should cover all of your points, also, outdent) Wikitable code is an editor's friend; the way this template is coded is obviously for presentation purposes, and nothing else, and thus I see little purpose in recoding it simply for the editor's eyes. Following from that point, this template is used on thousands of pages, and as such does not need to be friendly to an editor's eyes, as it will rarely if ever be changed. As well, I believe (read: am unsure) it's easier on the parser to have this coded in straight html rather than the corresponding wikicode. From a compatibility standpoint, the only difference between compatible for this wiki and compatible for most wikis is simply setting UseTidy to true (alternatively, it may be the 1.12 final preprocessor; I'm not sure of which anymore).
Yes, it is possible, but I would disagree that it is only a degree more difficult, as I myself went through this in its pre-May update form and coded it using wiki-tml, which required that I use templates to call the correct characters to create a wiki table (such as {{!}}), as well as eliminate (possibly) desired functionality in {{Tnavbar}}. Not fun, and definitely not worth sacrificing other functionality.
No, that's not the reason we have parsers. We have parserfunctions because they are definitely easier for the parsers to handle, as compared to something like a template (ie, {{qif}}) which duplicated the functionality of current parsers but was not only subjected to template limitations, but also "kill the wiki" limitations. As for wikitable code, it's a presentation based code, which keeps it simple for editors. Obviously, the people who maintain navbox know the corresponding html and thus design in that to get around those other issues (which they have specified).
MoS guideline... simple? Huh? I don't understand what you're saying. --Izno (talk) 05:25, 18 May 2008 (UTC)

I think you mixed up my two replies, or rather, I wasn't very clear in my two replies. In my second reply I was saying it would be better to not rely on a mother template like this to keep things standardized. Sure, it limits things from a technical standpoint, but it's always struck me as a sloppy way of enforcing standardization. I'm not commenting on the use of HTML vs wikitable code when I say that we have parsers and such. That comment was directed at the use of individual templates that don't require a mother template.
The reason I think it's a good idea to use Wikitable code doesn't have to do with parsers or to make it easier for editors to edit the template. The reason is for compatibility with other sites that use MediaWiki. Sorry I wasn't very clear. -- Ned Scott 05:22, 22 May 2008 (UTC)
You would see it as sloppy; I would see it as a rather neat solution to standardization issues. I think it especially applies to meta-templates, as it ensures users (editors) stick with the program. This template is by itself used on several thousand other templates; can you imagine the logistical nightmare associated if there were a need to change how such templates were displayed without a meta template? Now imagine that nightmare without automated editing programs. Yeah...
Other sites which use MediaWiki should keep up-to-date; iirc, 1.12 final was released in November, some 6 months ago, which if they aren't using 1.12 by now (or 1.13a), that's their problem. This template is first and foremost for use by WikiMedia wikis, and from my perspective (no, WikiMedia wikis aren't my main focus), any trickle-down to Wikia or otherwise is a benefit of the MediaWiki system, rather than something that should be (or "is") done with purpose from the top down. --Izno (talk) 06:04, 22 May 2008 (UTC)
Because navbox allows customization options, the only way to standardize them is to still edit each and every template. You're not gaining anything from the current system here. That is the reality here, and my watchlist can back this up. In some cases the template actually generates more characters than using a direct table. Font sizes, table widths, and colors can easily be controlled by CSS classes, which would take care of most of the constancy issues.
Being up to date with MediaWiki has nothing to do with compatibility, because the issue is with the Tidy settings. This attitude of "fuck you, you're not wikipedia, so we're going to make it harder for you" is the kind of isolationist thinking we can do without. It wouldn't make anything harder, at all, to make this template work with pure wikitable code. You've said yourself that the template doesn't get edited often anyways, and won't look pretty to editors. Excuse me if a one time conversion that would greatly benefit others wishing to reuse our content (which has always been a core goal of Wikipedia) seems like a good idea. -- Ned Scott 06:55, 22 May 2008 (UTC)
True, but enforcing navbox prevents users from going off on wild tangents; the customization options are allowed, but discouraged (it says so on the template). I never said navbox was smaller, so I don't know why you would bring that up.
Incorrect: See here. Navbox works correctly on MW 1.12 final without Tidy changed (and if it requires tidy, then I'm reading that whole conversation incorrectly, which I shouldn't be, as I provided the correct solution). If I had meant "Fuck them", I would have said "fuck them". In truth, it sounds like part of the issue you're having is troubleshooting, and that is something to be left for IRC or this talk page; there are numerous occasions as can be seen on both this active page and in the archives. I did not say Wikipedia was going to make it harder by not changing it, I said that it is up to them to take initiative. If the people like how navbox is constructed, they can easily c+p the code here, or convert the code on their side. If they don't like how it is constructed, they can take other options available to them, such as designing their own table or eliminating functionality of their choosing. Furthermore, if Wikipedia were to change how Navbox is designed, it would require that we use templates embedded in this one, a la {{!}}. It would not be an option, but required. Blame ParserFunctions.
You seem to have the mistaken assumption that I'm doing arguing my side maliciously. I'm not. I don't normally edit Wikipedia, instead editing a Wikia of my choosing, as it both suits my interests and allows me much more flexibility policy-wise. I've successfully ported navbox using the code provided here, and properly skinned it for both a dark and light version. In the end, I will again state that it is the other people's initiative to engage in figuring this template out. --Izno (talk) 21:18, 22 May 2008 (UTC)
"I used the User:Ned Scott/Navbox/core version to fix some problems that this particular Wiki was showing with the template.", which converts the template from HTML table code to Wikitable code via {{!}}, etc. So yes, the tidy option does break the template, and I know first hand what is involved for converting the template. I personally am not having any troubleshooting issues (though I am dragging my feet about re-converting the newer version of navbox for use on some other Wikis I work with), so I'm not sure what you mean by that comment.
However, it seems I have misunderstood the bulk of your comments and I completely apologies. Re-reading it now I can see you didn't mean things the way I assumed. -- Ned Scott 04:23, 25 May 2008 (UTC)
Heh, it's alright. And I ended up wrong about tidy; you need both 1.12 and Tidy to fix it... Sigh. --Izno (talk) 17:39, 25 May 2008 (UTC)

Autocollapse disabled?

I am viewing this on Opera, and on a number of pages with the Navbox used that I look at, the autocollapse has been disabled. Is it possible to reactivate it, because it is making pages look very unwieldy. --AEMoreira042281 (talk) 04:53, 22 May 2008 (UTC)

Can you give some examples of pages with this problem so I can take a look in Opera? --CapitalR (talk) 05:05, 22 May 2008 (UTC)
For starters, you can look at articles such as SEPTA, and any article under the WP:NYCPT WikiProject, where navboxes are employed in almost if not every article in the WikiProject.--AEMoreira042281 (talk) 14:56, 22 May 2008 (UTC)
It's not disabled here... Is JavaScript turned on? Autocollapse depends on it. EdokterTalk 15:05, 22 May 2008 (UTC)
I will have to check here. I am also having problems with Twinkle...again, using Opera. --AEMoreira042281 (talk) 15:24, 22 May 2008 (UTC)