Template talk:Bar percent

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

I can't get it to work on a MediaWIki installation - I had to delete all table syntax wrapping the parser functions (or how do you call it) because it was showing up raw after saving the page and now I have bare bars - I have all sorts of parser extensions and css classes set up and everythig else from wikipedia pretty much works.

Does the table syntax in this template use some advanced fonctionalities I might not have installed? 354d 18:47, 11 October 2007 (UTC)[reply]

Edit request[edit]

{{editprotected}} Please change:

width:100px

to

width:{{{barwidth|100px}}}

The problem here is that while {{bar box}} has a parameter to adjust the width of the bar area, the actual bar (which is generated by this template) is fixed at 100px. This change adds a parameter to manually change the width here as well. See Template talk:Bar box for details on how these templates work. PC78 (talk) 23:29, 19 February 2009 (UTC)[reply]

Done. Cheers.--Fuhghettaboutit (talk) 23:46, 19 February 2009 (UTC)[reply]

Template-protected edit request on 4 December 2014[edit]

Please replace:

<noinclude><table>
</noinclude><tr>
<td colspan="2" style="padding-left:0.4em;padding-right:0.4em;min-width:8em">{{{1}}}</td>
<td style="width:{{{barwidth|100px}}};border-left:solid 1px silver;border-right:solid 1px silver;"><div style="background:{{{2|gray}}}; width:{{{3|0}}}%; overflow:hidden">&nbsp;&thinsp;</div></td>
<td colspan="2" style="padding-left:0.4em;padding-right:0.4em" align="right">{{{4|{{{3|0}}}%}}}</td>
</tr><noinclude>
</table>
{{documentation}}
</noinclude>

with

<noinclude><table>
</noinclude><tr>
<td colspan="2" style="padding-left: 0.4em; padding-right: 0.4em; min-width: 8em;">{{{1}}}</td>
<td style="width: {{{barwidth|100px}}}; border-left: solid 1px #C0C0C0; border-right: solid 1px #C0C0C0;"><div style="background:{{{2|#808080}}}; width:{{{3|0}}}%; overflow: hidden;">&nbsp;&thinsp;</div></td>
<td colspan="2" style="padding-left: 0.4em; padding-right: 0.4em; text-align: right;">{{{4|{{{3|0}}}%}}}</td>
</tr><noinclude>
</table>
{{Documentation}}
</noinclude>

for HTML5 compliance. Thank you. — {{U|Technical 13}} (etc) 19:53, 4 December 2014 (UTC)[reply]

(i) Why paste code blobs here when you have made what I presume are the appropriate changes in the template's sandbox? (ii) What is non-compliant about (a) the colour values silver and gray; (b) the lack of spacing in the style= attributes? Sifting carefully through this maze shows me that the only change that is truly for HTML5 compliance is the replacement of one align="right" attribute with the CSS declaration text-align: right;. --Redrose64 (talk) 20:34, 4 December 2014 (UTC)[reply]
The changes for color names to hex values is for consistency as not all browsers rendered named colors exactly the same, spacing changes are for readability of code, and yes, the only "technical" HTML5 compliance change is eliminating the align=right in favor of the css equivalent. The changes requested are as I would have made them. Whomever carries out this request, please make the changes as you see fit as long as the goal of this request is realized. Thank you. — {{U|Technical 13}} (etc) 20:52, 4 December 2014 (UTC)[reply]
There shouldn't be any browser inconsistency in the colour values, because they are defined in CSS 2.1 and CSS Color Module Level 3. --Redrose64 (talk) 21:22, 4 December 2014 (UTC)[reply]
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value says that earlier version of IE don't support all named colors. Especially (.*grey.*) colors. Using hex instead promotes consistency. — {{U|Technical 13}} (etc) 22:09, 4 December 2014 (UTC)[reply]
It says that the keywords colours (which include gray and silver) work with IE 3.0 on. It also states "the 'e'-grey colors (with an e) (grey, ...) are only supported since IE 8.0. IE 3 to IE 6 only support the 'a' variants: gray, ...". Earlier versions of IE need not concern us, because MediaWiki has not supported IE 5 or earlier for some years, and in October this year dropped support for IE 6 also; and for those using IE 7, the existing code uses the "a" spelling, which works all the way back to IE 3. --Redrose64 (talk) 23:18, 4 December 2014 (UTC)[reply]
Done{{U|Technical 13}} (etc) 16:00, 16 December 2014 (UTC)[reply]

Edit request 2[edit]

To fix an issue, which can be demonstrated by just looking at mobile version of Template_talk:Bar_box in FF/Chrome, or just in Android app (see last Barfoobaz orange bar), please replace

 &nbsp;&thinsp;

with

 &thinsp;

Mykhal (talk) 17:30, 22 October 2017 (UTC)[reply]

Verified experimentally, in different Wikipedia language incarnation, that such a fix works (this template fix, verified e.g. on this page). —Mykhal (talk) 18:08, 22 October 2017 (UTC)[reply]
@Mykhal: Please describe the problem in more detail. I've looked at the mobile version of Template talk:Bar box in Chrome (on Mac OS X) and see no problem. The cs.wikipedia.org doesn't seem relevant, since it has something to do with &nbsp; followed by a regular space, then the &mspace; entity, which isn't under discussion here.  — SMcCandlish ¢ >ʌⱷ҅ʌ<  04:55, 23 October 2017 (UTC)[reply]
@SMcCandlish: Below is a better example, which on Chrome for Android shows that Barfoobaz is twice the height of Bazbar. --Ahecht (TALK
PAGE
) 14:43, 25 October 2017 (UTC)[reply]
.
Title
Bazbar
100% note 3
Barfoobaz
1% note 4
You can see how this looks on Chrome for Android at File:Ahecht Screenshot Bar Percent.png. --Ahecht (TALK
PAGE
) 15:44, 25 October 2017 (UTC)[reply]
@Mykhal: Not done for now: I'm not seeing any issue with the mobile version of Template talk:Bar box on Chrome for Android either. I'm closing this edit request until more details are provided. --Ahecht (TALK
PAGE
) 14:36, 25 October 2017 (UTC)
[reply]
seems reasonable, so now done. Frietjes (talk) 15:46, 25 October 2017 (UTC)[reply]
Beat me to it. :-)  — SMcCandlish ¢ >ʌⱷ҅ʌ<  20:19, 25 October 2017 (UTC)[reply]

Remove min-width[edit]

I don't see the benefit of specifying min-width: 8em; in the third line of this template. The only thing it seems to accomplish is to generate a lot of useless whitespace in cases where all the labels are quite short. See, e.g., the first example in the {Bar box} documentation. Unless there is some good reason not to, I propose removing it. I have already done that to the similar Template:Bar percent 2 and Template:Bar percent 3, with no ill effects observed in any of the articles where those templates were being used. (Note that before my change to {Bar percent 2}, the third example in the {Bar box} docs required scrolling to see the whole table, and the same problem could be seen in some of the uses of the template in articles. I haven't found any examples of that in articles using this template, but surely they're out there…) - dcljr (talk) 12:15, 12 March 2022 (UTC) Alternatively, perhaps a parameter could be provided to accomplish the same thing only when actually needed. - dcljr (talk) 13:21, 12 March 2022 (UTC)[reply]