Template talk:Navbox generic/Archive 2
![]() | This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 | Archive 3 | Archive 4 | Archive 5 |
Changing CSS padding of table
UPDATE: The padding issue was resolved in this edit to MediaWiki:Common.css, therefore the examples below do not accurately show the differences that existed prior to 18 March 2007. -- Zyxw 04:03, 28 March 2007 (UTC)
The following examples show the effects of different CSS padding values on the table generated by {{Navbox generic}} (users of Internet Explorer 6 for Windows will see no differences in these examples, as CSS padding for tables seems to be ignored). Each is followed by a {{Navigation}}-based template with the title background color changed for comparison.
- The first example uses the default value of 5px, which comes from the template's use of
class="navbox"
(see table.navbox in MediaWiki:common.css). This creates a large amount of padding between the border and the body of the table.
- The second example uses a value of 2px, which is the default for
class="NavFrame"
(see div.NavFrame in MediaWiki:common.css) used by the Navigation template. However, this creates a larger amount of padding than seen in the Navigation template. The reason for the difference is the "cellspacing" (or "border-spacing" in CSS) of the table created by Navbox generic, which is not an issue in Navigation because it does not use tables.
- The final example uses
padding: 0;
which gives the template an appearance much closer to that of the Navigation-based template.
Based on the above results, I suggest making the change shown in the final example. I have tested these examples with three Windows browsers: Internet Explorer, Firefox and Opera. If it does not work correctly in other browsers, please let me know. -- Zyxw 08:49, 5 March 2007 (UTC)
- Since there have been no comments in 10 days, I updated {{Navbox generic}} so it now appears as shown above in the third example. -- Zyxw 10:53, 15 March 2007 (UTC)
- These templates are suppose to be basic and not bloated. If you want to make these changes I'd suggest to make them on a site-wide basic instead of template specific. Perhaps it should be the other way around with {{navigation}} getting more padding? —Dispenser 02:13, 16 March 2007 (UTC)
- Agreed that there should be uniform padding on all navboxes. 2px looks good; see the contast between Toronto and Canada, for example. Whether changes should be made at common.css or here, I don't know enough to tell. Is it possible to strictly center the heading on tables that use navbox collapsible? It looks awkward if any centered subheadings are used below. –Pomte 04:54, 16 March 2007 (UTC)
- I agree that the best solution would be changes to MediaWiki:common.css that more closely align all settings for the two types of navigation boxes. For example, the padding of table.navbox could be decreased from 5px to 2px, while div.NavFrame is increased from 2px to 4px (navbox needs to be 2px less than NavFrame to create the same appearance). Another area to be addressed is the difference in font sizes. I also think that MediaWiki:common.js should be changed to have navbox and NavFrame templates use the same JavaScript for auto-collapsing. To see why, just look at bottom of the Toronto article with its mix of uncollapsed NavFrame templates and collapsed navbox templates which have 5px more padding (3px from the CSS settings plus 2px from the use of tables). Until such time as those changes are made on a site-wide basis, I see no reason to avoid temporarily fixing the problem directly in this template. The current padding is too large and should be reduced. If the consensus is that
padding:0
makes it too small, then let's change it topadding:2px
. – Zyxw 20:08, 16 March 2007 (UTC)
- I agree that the best solution would be changes to MediaWiki:common.css that more closely align all settings for the two types of navigation boxes. For example, the padding of table.navbox could be decreased from 5px to 2px, while div.NavFrame is increased from 2px to 4px (navbox needs to be 2px less than NavFrame to create the same appearance). Another area to be addressed is the difference in font sizes. I also think that MediaWiki:common.js should be changed to have navbox and NavFrame templates use the same JavaScript for auto-collapsing. To see why, just look at bottom of the Toronto article with its mix of uncollapsed NavFrame templates and collapsed navbox templates which have 5px more padding (3px from the CSS settings plus 2px from the use of tables). Until such time as those changes are made on a site-wide basis, I see no reason to avoid temporarily fixing the problem directly in this template. The current padding is too large and should be reduced. If the consensus is that
Code readability
I made the template code more readable, it shouldn't have broken anything, but tell me if it did. --Dinoguy1000 Talk 23:03, 7 March 2007 (UTC)
Style guideline for footer templates
If you're interested in participating in a discussion about a potential style guideline for navigational templates (specifically footers), please indicate your interest at Wikipedia talk:Navigational templates#Style guideline for footer templates. -- Rick Block (talk) 02:03, 25 March 2007 (UTC)
Any chance we can add subheaders
I'd like to convert Template:Barenaked Ladies over to this standardized template, but the template requires a few subheaders (the grey rows). I don't think any of the existing navboxes accept this style (please point me to one if one exists). I could do it with a listx and no groupx, if you could control the bgcolor of listx's, but you can't. Is there any way we could add a subheaderx tag to accomodate this? Thanks. TheHYPO 21:34, 5 April 2007 (UTC)
- See example at [1] and related discussion at Wikipedia talk:Navigational templates#Subheadings and title alignment --ChoChoPK (球球PK) (talk | contrib) 20:03, 7 April 2007 (UTC)
- Along the lines of ChoChoPK's example above, I think what you're after may be achieved using listN parameters without any corresponding groupN parameters, so I've tried this on the {{Barenaked Ladies}} template. At present, the {{Tnavbar}} template used to generate the titlebar has a fontcolor option that doesn't seem to handle colors as comprehensively as I'd thought, so the "v-d-e" and "[hide]/[show]" links it adds are in default blue (i.e. not that visible). User:Netscott, Tnavbar's original designer, may be able to help (or point out something I've overlooked!). Best wishes, David Kernow (talk) 07:17, 11 April 2007 (UTC)
- If you read his comments in the place he linked to, it's known you can achieve subheadings with listN fields, but it's not ideal - if you notice, the subheadings are not the exact proper width they should be, and additionally, it's html code - and when standardizing navboxes, that type of complexity is frowned upon. TheHYPO 17:04, 11 April 2007 (UTC)
- Sorry to've misunderstood / under-read! David (talk) 08:55, 12 April 2007 (UTC)
parameter templateName vs name
Hmm, maybe it's just me, but something changed with the parameter names. Take a look at {{NHL}}. This is good (new version), and this is bad (old version), and here is the the diff. I'm sure this has to be happening to many other templates, but I didn't want to jump in the middle and try to fix it myself. Certainly not on a Monday after Friday the 13th. :) — MrDolomite • Talk 18:08, 16 April 2007 (UTC)
- Mea culpa; hopefully now fixed! Thanks for spotting, David Kernow (talk) 18:16, 16 April 2007 (UTC)
- No problem, thanks for being WP:BOLD enough to tinker into the inner workings of a template like this. — MrDolomite • Talk 19:08, 16 April 2007 (UTC)
Updated Protected template
I updated the Protected template to reflect this template's new protected status (from {{sprotected2}} to {{pp-protected}}). If anyone thinks of a better reason to put, feel free to put it there. --Dinoguy1000 Talk 05:56, 28 April 2007 (UTC)
Font size
Compared to similar templates in the navigation series, it seems that font sizes for this template is slightly larger. How about reducing its font size to that in Template:Navigation? I just applied this template to Template:Singapore bus stations and the text size seems rather overwelming compared to the previous version [2].--Huaiwei 09:46, 29 April 2007 (UTC)
- Perhaps it's the line-spacing (line-height?) rather than the font-size that might be tweaked..? Regards, David Kernow (talk) 14:06, 29 April 2007 (UTC)
- Doubt so, for that simply adds more white space and bulk to the template.--Huaiwei 13:16, 30 April 2007 (UTC)
Error:Stripping namespace
I created a navbox generic in userspace for my user page (still up), as an experiment, and found that the v/d/e links are broken. It strips the namespace portion out of the template name. Is this a problem here or with the susbt'd pagename template? MrZaiustalk 08:25, 18 May 2007 (UTC)
- Doesn't work in userspace because {{Tnavbar}} prefixes all its links with
Template:
. I don't know of any such template for other namespaces. You can try to substitute and work out how to manually make the three links, or avoid vde by using {{Navbox}} instead. ({{PAGENAME}}
isn't a template but a magic word.) –Pomte 03:29, 19 May 2007 (UTC)
Is it possible to make a template show by default?
At the bottom of New York City Subway, it would be nice if the subway template were expanded by default, since, well, the article is about the subway. Is that possible? --NE2 16:43, 23 April 2007 (UTC)
- I added the parameter
show
, which, if set to any value other thancollapsed
orautocollapse
, will expand the navbox. –Pomte 01:47, 25 April 2007 (UTC)- Thank you very much. --NE2 06:30, 25 April 2007 (UTC)
This trick should be documented. For you convenience, the change is [3] and [4]. Another example is {{peso}}. --ChoChoPK (球球PK) (talk | contrib) 03:31, 27 April 2007 (UTC)
- {{peso}} does it better, and
state
is a more appropriate parameter name, so I have documented that method. –Pomte 03:49, 27 April 2007 (UTC)
- is there anyway to do the opposite, make it show by default, but have it automatically disabled for normal pages for those who so choose it? Oldag07 03:53, 2 June 2007 (UTC)
- Absolutely, see {{AUD}} for example. The trick is
|state = {{{state<includeonly>|expanded</includeonly>}}}
.- I have written the trick into the documentation. --ChoChoPK (球球PK) (talk | contrib) 21:55, 2 June 2007 (UTC)
- <includeonly> isn't necessary in that case - I'm pretty sure it was there only to expand the box in the template page itself. –Pomte 22:19, 2 June 2007 (UTC)
- It isn't. But if editors actually go to the template page, I guess they would like to see what's in it... --ChoChoPK (球球PK) (talk | contrib) 23:43, 2 June 2007 (UTC)
- I mean it's only an issue if the default value is 1. collapsed, or 2. autocollapse and there's another box on the page. No big deal. –Pomte 00:12, 3 June 2007 (UTC)
- It isn't. But if editors actually go to the template page, I guess they would like to see what's in it... --ChoChoPK (球球PK) (talk | contrib) 23:43, 2 June 2007 (UTC)
doesn't collapse
{{European Union topics}} on Eurozone. I think I spelled |state=collapsed
correctly. --ChoChoPK (球球PK) (talk | contrib) 04:31, 18 June 2007 (UTC)
- The template was missing a "{", fixed that now. —Dispenser 04:51, 18 June 2007 (UTC)
This template in other languages
Hello :en:User:All-of-you
As you probably know, users on other wiki-languages are working on their own languages, but based on your work. For my specific case, I translate articles for Wikipédia, and trying to use templates uniformaly. Since few days, I'm working on cities of British-Columbia (FR) and I've tried to include this template. With a little search, I've noticed that many languages are using this template, but some are not working proprely.
In certain cases, the default colors are right but the collapse doesn't work, in other cases it's the opposite! My problem is for french : the default colors AND the collapse doesn't work. I think it's the MediaWiki:Common.css or MediaWiki:Common.js, but I'm not sure what I need to request to Admins!? Can someone give me a hand with that? I not really good with "Style sheets". Thanks in advance for your help!
Have a nice day! --Antaya 10:36, 2 July 2007 (UTC)
Title style
If I want to change the background and foreground colors in the title bar, how do I go about making links (like text) show in the foreground color? I can't see how to do that with this template. Stevie is the man! Talk • Work 16:45, 4 June 2007 (UTC)
- I'd experiment with
titlestyle = background:named_color; color:named_color; ...
but currently I'm not sure how well the {{Tnavbar}} template Navbox generic uses in the titlebar handles colors... Regards, David Kernow (talk) 16:36, 9 June 2007 (UTC)- I believe I already tried that, and the foreground color didn't apply to links. Stevie is the man! Talk • Work 16:58, 9 June 2007 (UTC)
- Set
title = <font color="#abcdef">[[title]]</font>
. See {{Elliott Smith}} for an example. While the link color changes, hovering over the link produces the same blue underline. Ugly, but I've found no other way to do it. –Pomte 17:31, 9 June 2007 (UTC)- Thanks, this is helpful, but I would also like the v/d/e and show/hide links to show this color (so they can be seen over a dark blue background). I'm starting to wonder if this template is just too limited and search for an alternative, or roll my own. Stevie is the man! Talk • Work 17:52, 9 June 2007 (UTC)
- On the title itself, a cleaner method is
title = [[link|<span style="color:#abcdef;">title</span>]]
. - For v/d/e/show/hide, {{Tnavbar}} has a
fontcolor
parameter, which can easily be added to this template by David. It's not the templates' fault; there's simply no convenient way to change link styles. –Pomte 18:25, 9 June 2007 (UTC)- Thanks for the additional info. I'm not blaming the template, per se, as I realize it could perhaps be updated, but I wasn't sure if there would be easy agreement to do that. This is something I can be patient with, but I would like to be able to update the colors of {{Louisville}} (based on this template) as soon as David (hopefully) makes the update you describe. Sounds like a positive enhancement. Cheers! Stevie is the man! Talk • Work 18:51, 9 June 2007 (UTC)
- On the title itself, a cleaner method is
- Thanks, this is helpful, but I would also like the v/d/e and show/hide links to show this color (so they can be seen over a dark blue background). I'm starting to wonder if this template is just too limited and search for an alternative, or roll my own. Stevie is the man! Talk • Work 17:52, 9 June 2007 (UTC)
- Set
- I believe I already tried that, and the foreground color didn't apply to links. Stevie is the man! Talk • Work 16:58, 9 June 2007 (UTC)
{{editprotected}} On the line that transcludes {{Tnavbar}}, please add the fontcolor parameter. Change
- }}|mini=1}}
to
}}|{{#if:{{{fontcolor|}}}|fontcolor={{{fontcolor}}}|}}|mini=1}}
{{Tnavbar}} has no numbered parameter 2, so the extra | won't cause any problems. –Pomte 07:09, 18 June 2007 (UTC)
- What about
}}}| fontcolor={{{fontcolor|}}}|mini=1}}
- fontcolor is optional to tnavbar. So it's ok to have it blank. --ChoChoPK (球球PK) (talk | contrib) 07:21, 18 June 2007 (UTC)
- You're right, that's better. –Pomte 07:26, 18 June 2007 (UTC)
- fontcolor is optional to tnavbar. So it's ok to have it blank. --ChoChoPK (球球PK) (talk | contrib) 07:21, 18 June 2007 (UTC)
I'll do it tomorrow when I have the time to carefully test and document it. --ChoChoPK (球球PK) (talk | contrib) 07:30, 18 June 2007 (UTC)
Disabling editprotected. Chochopk, I'll let you test and make the edit. — Carl (CBM · talk) 15:49, 18 June 2007 (UTC)
- Sorry, I find myself getting busy in real life. Retagging for help. --ChoChoPK (球球PK) (talk | contrib) 06:34, 19 June 2007 (UTC)
- Someone who is familiar with the applications should write and test the code. I'll be glad to copy it over here once it's done. — Carl (CBM · talk) 21:22, 22 June 2007 (UTC)
Has there been any progress with this? Does anyone have something I can test? Thanks. Stevie is the man! Talk • Work 16:30, 29 July 2007 (UTC)
- I create the sandbox with the change over a month ago and created the associate testcases page. —Dispenser 20:42, 29 July 2007 (UTC)
- Thnnks. Just looked at it. Is it still in development? I ask because some of the linked words in the title text are invisible. I was thinking that the "white" fontcolor choice would apply to all the text, or that there would be some way to make all the text (linked or not) clearly readable over a dark background. Stevie is the man! Talk • Work 14:21, 30 July 2007 (UTC)
- 1. No it finished. 2. That's a general problem about using dark background. You always need to specify the link tags with another color. Maybe this would be a little more obvious if
fontcolor=
was just passed to {{tnavbar}} and not color the title bar? It would have the benefit to allow the color of the links differently. —Dispenser 15:31, 30 July 2007 (UTC)
- 1. No it finished. 2. That's a general problem about using dark background. You always need to specify the link tags with another color. Maybe this would be a little more obvious if
Any objections to the overdue edit request? I see no technical controversy about this parameter. I know User:MZMcBride is an admin familiar with templates, so you should contact him directly to get this over with. –Pomte 21:22, 1 August 2007 (UTC)
- I am frankly a little lost as to what I would be requesting. I'm not sure we have a complete solution at this point. Or do we? Stevie is the man! Talk • Work 21:30, 1 August 2007 (UTC)
- Looking at the testcases, it seems the show/hide links are still blue, and any links added to the title are left unchanged as well. I can easily update the code, however, does anyone want to try to fix these issues first? Cheers. --MZMcBride 13:25, 2 August 2007 (UTC)