Template talk:Navbox generic/Archive 4

Use of this template on own MediaWiki site
Hi. I have my own Wiki system, using the MediaWiki software. Unfortunatelly this software doesn't come with any templates. I find this particular template very handy, and would like to use it on my Wiki as well. Though when I copy the source code, I get nothing but plain text. I think I miss some other templates used on this one.

Can someone please tell me what other templates I need to copy to my own Wiki, or if anyone has another idea of get this template working on my site, is someone willing to help me with that? Thanks very much in advance :-) -Jort227 16:03, 27 July 2007 (UTC)
 * I don't think that the problem is missing templates (They will show op with a red link, just like normal missing pages) but that the problem is in a wrong configuration setting . I have (I think) the same problem and that is in the http://www.mediawiki.org/wiki/manual:$wgUseTidy setting. I only haven't got it working yet so I don't know if this is the cure. I hope this helps Peter Schwegler 07:34, 29 July 2007 (UTC)
 * I'm not really sure if it has to do with those settings. I have just copied the source code from the template info a new page of my own Wiki. I made a picture of the outcome, and posted that on Imageshack: picture of the error. -Jort227 11:19, 29 July 2007 (UTC)
 * What version of mediaWiki are you using? Because that error looks like its not evaluating rowspan value right.  Anyway you need in addition to this template are (all of which are optional)
 * Copy of tnavbar for v-d-e
 * .navbox class in mediawiki:common.css for styling
 * collapsible tables code from mediawiki:common.js
 * /doc subpage for documentation
 * I don't think you need tidy enabled since it's all valid ;-), but you'd have to the option to allow user type HTML. But, it seem you already done that.  —Dispenser 12:21, 29 July 2007 (UTC)
 * Thanks Dispenser for the hints :D. Though one question: where can I find the commons.css and commons.js files? And where do I need to put them in my own Wiki? Do I need to upload them via FTP (if so, to what folder), or do I just need to add them to my own wiki on the pagenames you've just mentioned? Anyway, thanks for the help, hopefully it'll work :) -Jort227 12:42, 29 July 2007 (UTC)
 * Sorry I wrote down the wrong link, fixed now. Looking at the result again, it looks more like that ParserFunctions aren't enabled or that the syntax for the parser functions are different on your install.  —Dispenser 20:14, 29 July 2007 (UTC)
 * I have uploaded the common.css and the common.js files to my wiki (just kept them the same as on this Wiki) and the other pages, but it still doesn't really look good. When I view the source, it's still somewhat the same as on my example image. So I guess it's because of the parser functions... Do you know how I can fix that? How I can set those functions, so that they work properly? Because I really like this template :). Thank you -Jort227 20:24, 19 August 2007 (UTC)

Even more changes

 * Temporarily removing editprotected flag so I can possibly make one more change before submitting the changes again. --CapitalR 00:44, 14 August 2007 (UTC)
 * I've found other ways to get around these problems, so just forget about these changes. I'll leave the discussion below for reference, but do not implement them.  In the near future I may have more edits to address some of the problems, but not at this time.  --CapitalR 13:05, 17 August 2007 (UTC)

I've noticed a few more common problems with use of this template and have made changes to correct them. The change is to put each of the calls onto its own line to prevent incorrect spacing / newline errors in some browsers. This has always been a problem with this template (i.e., it's not a new problem introduced by my last edits) and should be fixed by this edit.

The code should be completely replaced with the following:

Thanks, and once again this is implemented at User:CapitalR/Test with test cases visible at CapitalR/Test3. Also, click here for the diff. Note that the general style of the template is remaining the same; only spacing/new-line errors are being corrected. --CapitalR


 * Erm, that's not quite true; changing the title to nowrap will horribly break any use of this template where a narrow explicit width is used in conjunction with a long title. I don't particularly see the need for this change, in any case; where is the wrapping a problem? Kirill 17:12, 13 August 2007 (UTC)


 * Ok, well I just removed the nowrapping on the title, but I would still like to see the other change go through. The spacing problems being fixed by this change are illustrated as follows:

Notice that the first and last items in the list are messed up (all should be on one line). Currently, the only way to fix this is as follows:

or

The new changes will do the following:

Lots of editors like to put each item in a list on a newline to make the list easier to read (especially long lists with long wikilinks). Adding these extra line breaks to this master template will make it less confusing for editors who get those strange newline problems in child templates. I find it annoying to keep having to fix other editors mistakes by either removing the line breaks or adding the html comments around the line breaks in child templates, both of which make the child template code harder to read. This simple fix will improve working with this template and help avoid these errors for less experienced editors. I know that it will take up some server time to apply the changes, but it is well worth it. --CapitalR 18:18, 13 August 2007 (UTC)


 * Well, one solution (although not perfect) that I learnt from reading the docs for one of the other generic navboxes is to use a div tag. Like this:


 * Off course, it would be even better if the template took care of this so the editors don't need to think about div tags or similar.
 * --David Göthberg 19:40, 19 August 2007 (UTC)

Category field problem
Hey guys. I have been noticing that the category field in Template:Big 12 Football Venues, Template:SEC Baseball Venues, etc. (all the similar ones) are not including the category field for some odd reason for the Navbox generic. For instance, I was about to change the one for Template:Big 12 Basketball Venues to a Navbox generic so that it had the v/d/e controls and the division (North and South) could be separated like for Template:Big 12 Football Venues (among others), and I noticed that it was indeed working for that one. The reason the category is important is so it displays the category down at the bottom of all pages where it is (in this case the Big 12 Conference category). The noinclude ones still work, but not the regular category. Is this a fixable problem (am I doing something wrong?) or is just a flaw with the design of the Navbox generic? Any help is appreciated. (Cardsplayer4life 16:27, 16 August 2007 (UTC))


 * The problem would be that Navbox generic doesn't have a category parameter. This should be easy enough to fix, just request a change. --Dinoguy1000 Talk 03:56, 17 August 2007 (UTC)


 * Where would be the proper place to go about requesting such a change at? (Cardsplayer4life 05:28, 17 August 2007 (UTC))

In my opinion, the category parameters in nav boxes are a very bad idea. You can still do what you want without any changes to the template being necessary. All you need to do is add the following after the code for the Navbox generic and it will work: This has the effect of adding every page that uses the template to the category, but not the template itself. I modified as an example for you. Hope that solves your problems. --CapitalR 13:13, 17 August 2007 (UTC)
 * Thank you very much CapitalR. You are a gentleman and a scholar. (Cardsplayer4life 14:57, 17 August 2007 (UTC))

style="width:auto"
When the template is set to auto width the width shrinks significantly when the template is hidden. Can this behavior be changed so that the width stays the same whether the template is hidden or not? Paul C/T+ 14:37, 31 May 2007 (UTC)


 * Try "width: xem", where x is a number. But draw back of this is you need to know x in advance, and you need to give enough minimal white space so that there isn't excessive wraping. Another alternative is to not specify any width at all. --ChoChoPK (球球PK) (talk | contrib) 21:51, 31 May 2007 (UTC)


 * Here is a useful little tool I've found in this regard. Regards, David Kernow (talk) 16:39, 9 June 2007 (UTC)


 * Neither of these suggestions fix the problem. The idea is to have a dynamically resized template that when collapsed is the same width as when it is expanded.  There has been some discussion on other pages about the problem.  Is this something that can be resolved or is the "width:auto" function essentially broken when the template is hidden?  The only workaround I've seen is to hardcode the width of the template by ems or use "width:100%" to force the template to span the whole page. Am I missing something here? Paul C/T+ 23:12, 21 August 2007 (UTC)
 * Edit: More discussion below... Paul C/T+ 23:31, 21 August 2007 (UTC)


 * I've come up with a possible solution, but I don't know how to implement it. Essentially what there needs to be user-modifiable "minimum width" and "maximum width" parameters that the template could shrink and expand to without having to resort to width:auto;.  Is this possible? I know you can specify an exact width, but this can look poor on screens with different resolutions... Paul C/T+ 08:53, 22 August 2007 (UTC)

Class nowraplinks
I have made a template and some CSS code that prevents word wraps inside links and only allows word wraps between the links and in normal text. This is useful for instance for long link lists.

The nowraplinks template has now been fully deployed and the CSS code added to common.css. I and other editors have tested it in several ways in several browsers. There for I suggest that the CSS class is used here (in Template:Navbox generic) to save users of this navigation box from using lots and lots of &amp;nbsp; or nowrap. I have tested it with the template's current code in my own testpages/sandboxes.

I suggest that the first half of the first line should be changed to:

The change of the last few lines is to get the documentation look and feel recommended in Template documentation. The two empty lines between the "pp-template" and the "template doc" is to prevent the documentation to come too close to the template, just to make the template page more readable.

--David Göthberg 20:13, 19 August 2007 (UTC)
 * [[Image:Yes check.svg|20px]] Done. See my note on Template talk:Navigation about spacing issues. Cheers. --MZMcBride 20:21, 19 August 2007 (UTC)


 * Ehm, you misunderstood me. The primary change I suggest for the last lines is to add the template doc. Currently the more primitive /doc is used instead. The two blank lines were just layout extras. If/when the template doc is used the two blank lines can not be added in the /doc subpage since they will then end up inside the green template doc box.
 * --David Göthberg 21:03, 19 August 2007 (UTC)


 * My apologies. [[Image:Yes check.svg|20px]] Done. Cheers. --MZMcBride 21:10, 19 August 2007 (UTC)


 * All my fault for not being clear enough. Now the template page look very nice and I just did some additional testing and it seems the nowrap code works very nice out there in the real articles. --David Göthberg 21:16, 19 August 2007 (UTC)

Take a look at in IE and in Firefox. Both have problems associated with the nowraplinks modification to Navbox generic. In IE, it causes wrapping to occur before a right parenthesis and/or after a left parenthesis, which didn't happen before (and shouldn't happen). In Firefox, it causes the text to go outside of the box and off the screen, causing a scrollbar to appear sometimes. I like the nowraplinks addition, but perhaps we can find a way to correct this (I think I'll fix this template in particular with regular additions, but there are probably other templates out there with this problem too). --CapitalR 23:53, 21 August 2007 (UTC)


 * Yes, I was aware of both bugs. Firefox seems to calculate the width (of spaces I think) wrong when using nowraplinks. But in the tests I had done so far the text just went some pixels outside the box so I thought it was no big problem. But your example shows it can be much worse. And several of the browsers seem to sometimes allow line breaks immediately before and after a nowraps section even if according to rules they should not. But I have just seen it happen occasionally so I thought that that too was a to minor problem to bother about.
 * I am very interested to see if you can fix that template by using instead.
 * I have some other ideas too that might work around these bugs, but I need to test them carefully first. But those techniques will be tricky for the template users to grasp so they will probably use them wrong and cause nasty problems. I'll get back to you when I tested more.
 * --David Göthberg 01:26, 22 August 2007 (UTC)


 * I just updated that template using ... could someone take a look and see if there is still a problem? (I'm using Safari on Mac OS X, so I can't check in IE.) Also, due to the nature of that template, I don't think the nowraplinks class will help at all with the wrapping since the sections that need to be kept together aren't in one single link... or am I looking too much into this? Paul C/T+ 01:33, 22 August 2007 (UTC)


 * Great work Psantora! Now that template looks fine in all my three browsers. (IE 5.5, Opera 9.02 and Firefox 2.0.) Nothing goes outside the box in my Firefox and line breaks only occur after the dots in all three browsers. Thanks Psantora. And you are right, in this case the nowraplinks class doesn't help much since we want to keep several links together here in sections.
 * But now the code in that navbox is as nasty as most such navboxes were before we had nowraplinks. So now that I had my lunch I'll go on and code up and test the solution I have in mind. Keep your fingers crossed that it works.
 * --David Göthberg 02:17, 22 August 2007 (UTC)


 * Ok, I have tested several solutions. Only the worst one of them worked. So I guess I need to think more about this. --David Göthberg 03:27, 22 August 2007 (UTC)


 * I managed to package my "worst solution" in a very nice way as ready to use templates. Take a look at nowrap begin and how I use it and its "helper templates" in . Now the code in looks good and is easy to maintain, and it works perfectly in all three web browsers I have. (IE 5.5, Opera 9.02 and Firefox 2.0.) I hope it works in Safari too. --David Göthberg 09:53, 22 August 2007 (UTC)
 * It looks good to me in all of the browsers that I have (same as you, but Safari also). When I was converting another 1000 templates to use  last night, I noticed about 50 or so that had the same problem as the  (I was using WP:AWB to make the conversions, which uses IE).  The problems were all wrapping between parentheses and the words they surround.  I think what I'll do is wait for the next database dump to come (in a week or two), and then run a simple scan to find all of the templates that have this problem and fix them manually.  Thanks for looking into it for me.  --CapitalR 13:35, 22 August 2007 (UTC)