Template talk:Userbox/Archive 1

Active discussions
Archive 1


Could you explain how are the parameters 5 and 14 used ? -- ( drini's vandalproof page ) 03:54, 1 December 2005 (UTC)

  • There is a parameter 5, that is the fontsize of the text in the small box, it's defaults to 14, I can't see any parameter 14 sorry. AzaToth 05:05, 1 December 2005 (UTC)
the parameter 5 box looks like this: " {{5|14}} " this is probably the "parameter 14" referred to (which, like you said, is just its default value, not a parameter)--HTL2001 (Talk|Contrib) 18:03, 2 December 2005 (UTC)

page Wikipedia:Proposed policy on userboxes has been created

based on a suggestion at WP:VP. ++Lar: t/c 05:22, 2 January 2006 (UTC)

Edit request

The first line should be changed to

<div style="float: left; border: {{{border-s|1}}}px solid {{{1|{{{border-c|{{{id-c|#999999}}}}}}}}}; margin: 1px;">

per the other userbox templates. —Andux 03:02, 5 February 2006 (UTC)

Done. Ashibaka tock 03:13, 6 February 2006 (UTC)

Standardisation proposal

I propose that we eliminate the deprecated parameters entirely, and rename the parameters to be more user-friendly. The current and proposed syntax are below; the parameters were arbitrarily renamed in a manner I think makes their function obvious without any need for referencing. Any part of this proposal could of course be tweaked per discussion. If this change is accepted, the new parameters could be added without removing the old, and all instances of the template semi-automatically updated with regex and the AutoWikiBrowser. All deprecated parameters could then be removed.

Current syntax:

  |id       =
  |id-c     =
  |id-fc    =
  |id-s     =
  |info     =
  |info-c   =
  |info-fc  =
  |info-s   =
  |border-c =
  |border-s =
<!-- deprecated but still present -->
  |color 1  =
  |color 2  =
  |id       =
  |info     =
  |id size  =

Proposed syntax:

  | l-content    =
  | l-background =
  | l-font-color =
  | l-font-size  =
  | r-content    =
  | r-font-color =
  | r-font-size  =
  | box-background =
  | border-width =

// Pathoschild (admin / talk) 10:14, 25 February 2006 (UTC)

Changing things now seems like more trouble than it's worth. The "deprecated" syntax is still in wide use, and it's much more compact—if less flexible. Identifying the boxes as L and R would also make for more work when switching between {{userbox}} and {{userbox-r}} (currently, they use identical syntax). —Andux 13:56, 25 February 2006 (UTC)
Given some good regex and the AutoWikiBrowser, the transition would be relatively easy. Converting the deprecated syntax to the new syntax expands the size of the code, but not severely. The updated proposal below should solve the left-right issue you mentioned; 's' and 'w' for 'small' and 'wide'.
  | s-content    =
  | s-background =
  | s-font-color =
  | s-font-size  =
  | w-content    =
  | w-font-color =
  | w-font-size  =
  | box-background =
  | border-width =
// Pathoschild (admin / talk) 14:21, 25 February 2006 (UTC)
Add your param names if you want, but I just don't see the point of changing all of the hundreds of pages that already use this template if nothing is really broken. —Andux 14:41, 25 February 2006 (UTC)
The main reason for that is to prevent increasing and needless complexity in template coding. For example, this is what one value will look like if we add the new parameters without removing the deprecated ones: {{{1|{{{border-color|{{{border-c|{{{id-c|#999999}}}}}}}}}}}} instead of {{{border-color|#999}}}. // Pathoschild (admin / talk) 14:47, 25 February 2006 (UTC)
It's protected as a high-risk template; ease of editing isn't really a high priority. —Andux 15:14, 25 February 2006 (UTC)

I've added the following new parameters, and created {{user box}} as a redirect. Templates using the new syntax will use that redirect, so that we (or I) can use whatlinkshere to slowly deprecate older syntax.

{{user box
  | border-width =
  | border-color =
  | logo-background =
  | logo-size =
  | logo-color =
  | logo = 
  | info-background =
  | info-size =
  | info-color =
  | info = 

// Pathoschild (admin / talk) 09:55, 27 February 2006 (UTC).

Height of Userbox

Proposing/Requesting to add few more parameters : like "logo-line-space" or "logo-line-height" or "logo-line-gap" or "logo-line-gapspace", etc, and a similar one starting with "info-..." for the information side, so that we can specify CSS properties and values, like style="line-height: X em;", this is very important, as this helps to reduce the space in between the text lines, thus reducing the overall userbox's height to the recommended 45px userbox height. If the height of the userbox remains same (45px) then it is easier to place them horizontally with the sequence they were placed in, otherwise, different userbox with different height is placed by the web browser at different places with un-wanted sequence. Also requesting to add another parameter, something like, logo-cellpadding, or, logo-padding, or, logo-padspace, etc, so that we can specify CSS properties like, style="padding:4px;" (for all side padding), or, style="padding:2px 3px 2px 3px;" (for top-right-bottom-left side, different amount of padding). Those two types of parameters will help greatly customizing the userbox, while maintaining organized. For an example, please also see the Template:User Multi, what i had to do to reduce its height to 45px. I also tried to lower the userbox height in the Template:User you and me, but failed to bring it down to 45px height, unless the source code is further adopted. Thanks. ~Tarikash 06:22, 18 August 2006 (UTC).

Finally the userbox Template:User you and me height was changed to 45px, with the help of the new parameters. Whenever applicable, others should apply the new params also. Many thanks to CSCWEM. I'll look into the code & aspect, if any further modification can also be done. --Tarikash 11:02, 12 January 2007 (UTC).

Bug solved. Gecko/Mozilla browser displays the userbox, (which is actually a "table" wrapped around "div"), with 45px height +(plus) 2px extra for the top and bottom 1px border of div, so total becomes 47px, (with other params at default). Which is nice, good and right way. But Trident/Internet Explorer type of browser displays it different, 2px of the overall height comes from the div's top 1px & bottom 1px borders) and 44px (for the table) = so total is 46px. But, if the cell padding is set at 1px, then the browser/client/user-agent renders the userbox correctly, 2px (div's border) + 45px (table) = total is 47px, (half width of border and half of padding, makes up for "One"). You may see the box model for HTML/CSS, for more accurate analysis. There is also height discrepancy among the userboxes, which are created used with this userbox template, and which are created by calling a template containing the div-table combination, specially in the case of Trident/Internet Explorer type of browsers. Userboxes created with this template was being displayed 1px less than the other one. If padding is set at 1px then, it solves that problem, by removing the inherited 0px padding width, and keeps the userboxes similar across different browsers. --Tarikash 03:32, 15 January 2007 (UTC).


This should be recategorized to go with the rest of the userbox templates. I was able to recat all the others. It should be categorized under Category:User templates|* Userbox so it's sorted at the top of the category. – Someguy0830 (Talk | contribs) 20:29, 3 May 2006 (UTC)

eu interwiki

Please, would it be possible to add eu:Txantiloi:Taulatxo oinarria interwiki? Thanks.--Berria 18:55, 3 July 2006 (UTC)

Done. howcheng {chat} 17:22, 7 July 2006 (UTC)

Better category?

I would like to suggest that Category:User templates be used instead of the current category. That seems to be the proper place for these generic templates. —Shayltalk 06:42, 4 July 2006 (UTC)

Wow, I just came back and read my comment, and boy, did I get it wrong. I meant to say Category:Userbox templates. —Shayltalk 05:54, 8 July 2006 (UTC)

Please change the category this is in from Category:Wikipedia userboxes to Category:Userbox templates. —Mira 01:02, 26 August 2006 (UTC)

Done. —Mets501 (talk) 04:54, 27 August 2006 (UTC)
Thank you. —Mira 08:32, 27 August 2006 (UTC)


How do you use this thing properly together with other formatting? I tried tweaking it to my settings at my user page, and the width settings seem to have gone haywire. Can someone help me out here? Thanks. --Terrancommander 15:36, 8 July 2006 (UTC)

Userbox list?

Is there a list posted somewhere of all (or most) of the current Userboxes? Thanks. --Schmendrick 18:32, 10 August 2006 (UTC)

Here is the list :-) --sverde1 16:13, 11 August 2006 (UTC)
I think that this list is incomplete.

--Meno25 14:58, 26 November 2006 (UTC)


I recently unprotected this template as "unprotected" is the de facto state of affairs per Wikipedia:Protection_policy: "used in limited circumstances as protected pages are considered harmful." Further Wikipedia:High-risk templates does not spell out which templates are "high risk." This particular template does not appear on any articles and does not affect any "mission critical" systems. Unless some very compelling arguments are made, it should be unprotected.
brenneman 10:47, 19 December 2006 (UTC)

Simple userbox template

I created a new template at {{userbox-simple}}, which uses just 5 numbered parameters for simplicity. Λυδαcιτγ 23:01, 23 January 2007 (UTC)

Interwiki link

Please, add sl:Predloga:Uporabniško polje. Thanks. --Eleassar my talk 12:10, 6 March 2007 (UTC)

  Done. Next time, please place edit requests in a new conversation. Harryboyles 13:27, 6 March 2007 (UTC)

Style Parameters

{{{id-op}}} and {{{info-op}}} should be changed to {{{id-op|}}} and {{{info-op|}}} so it will default to nothing. Otherwise {{{id-op}}} and {{{info-op}}} will be placed inside the style attribute if they're not set and Opera ends up ignoring the whole style attribute. -- 10:37, 13 March 2007 (UTC)

Thanks -- 18:05, 14 March 2007 (UTC)

Link colours?


Is there some way we can get the link colours to change? I want a userbox with a dark blue background, and a link of a paler colour. Can it be done?

-- TimNelson 13:29, 23 March 2007 (UTC)

Yes, but not by editing {{userbox}}. Try something like this for the info parameter:
info=This box contains a [[Wikipedia:About|<span style='color:yellow'>yellow link</span>]]
This box contains a yellow link
which looks like the userbox I've put on the right here. Hope that helps! --ais523 13:35, 23 March 2007 (UTC)

Russian interwiki

Please, add ru:Шаблон:Userbox. ~ kintup 20:26, 22 July 2007 (UTC)

Uppersorbian interwiki

Hello. Could someone add a interwiki to hsb:Předłoha:Userbox, please? Thanks and greetings --Tlustulimu 12:03, 1 August 2007 (UTC)

Fix font-size

Please implement id-fs and info-fs (for font-size) parameters that output "%" after the number given instead of "pt"; we should not be doing things in point-sizes, since this will make userboxes look completely ridiculous when people set their default font size larger or smaller than is common. They should then be documented and the old id-s and info-s parameters either marked with 'Deprecated: Use id-fs instead. (and info-fs for the other one of course), or simply remove any mention of them from the documentation. — SMcCandlish [talk] [cont] ‹(-¿-)› 18:41, 30 December 2007 (UTC)

Force vertical alignment


For {{user infobox}}, I need to allow infoboxes to keep their central valign attribute. As this is the default for tables, it isn't specified in this template; but this means it gets overridden by the forced top alignment for .infobox td in common.css.

The following changes are needed:

{{{logo-other-param|{{{id-op|}}}}}}" |


{{{logo-other-param|{{{id-op|}}}}}}; vertical-align: center" |


{{{info-other-param|{{{info-op|}}}}}}" |


{{{info-other-param|{{{info-op|}}}}}}; vertical-align: center" |

Chris Cunningham (not at work) - talk 11:19, 12 March 2008 (UTC)

  Done. עוד מישהו Od Mishehu 12:45, 12 March 2008 (UTC)
Changed to "middle", as "center" is not a valid CSS value for vertical-align. EdokterTalk 14:11, 12 March 2008 (UTC)
Could this be the reason the alignment of the contents of my userboxes (see my user page) has become messed up? - Dudesleeper / Talk 00:53, 26 March 2008 (UTC)
Yes, in a round about way. {{infobox user}} now uses default infobox styling rather than being hand-hacked, so userboxes which don't identify as such (class="userbox") might behave funny. They're trivial to update though. I've done a couple of the ones on your page as an example, {{user:UBX/male}} and {{user:UBX/User Scottish Ancestry}}. Chris Cunningham (not at work) - talk 18:49, 11 April 2008 (UTC)

Remove bold from id

Please remove the bolding of the id. A lot of templates have more than just one or two characters in that field. If the creator wants it bold, then the creator can bold the text. - LA @ 15:24, 14 March 2008 (UTC)

I removed the edit protected template for discussion of this first. - LA @ 15:25, 14 March 2008 (UTC)

Change Hyperlink Colo(u)r

How would i go about changing the hyperlink colour at templates such as Wikipedia:WikiProject Silver Dollar City/Userbox, Because the blue on blue is really hard to see. Thanks in advance Peachey88 (Talk Page | Contribs) 08:30, 29 March 2008 (UTC)

You can surround the link with <font color=colorYouWant>[[linkYouWant]]</font>. There are more ways to do it besides that, but that's the clearest way of writing it I've seen. --Eruhildo (talk) 18:10, 1 April 2008 (UTC)

Request to edit

Sysops, please help me! In the template, I need you to write [[Category:Wikipedians that use userboxes]] that will open up a wole new category. Nothing444 21:40, 5 April 2008 (UTC)

 N Not done - Please get consensus for making such an edit first on a Village Pump; I suspect that people will object to the change in multiple ways. Also, when you use the {{editprotected}} template, please place it immediately above your comment rather than at the top of the page. Thank you. Nihiltres{t.l} 23:57, 5 April 2008 (UTC)

Why a floating DIV?

Since this template is used a lot within tables, and floating DIVs don't mix very well with tables, I'd rather do away with the DIV all togeter. I see a lot of problems userboxed and I believe removing it (and moving the styling to the table) will fix a lot of problems, especially when used in conjuction with {{Infobox user}}. Thoughts? EdokterTalk 15:06, 3 September 2008 (UTC)

Anyone? EdokterTalk 00:43, 12 January 2009 (UTC)

logo-padding 1pt → 1px

Shouldn't the padding be 1px, given that logos are supposed to be 43x43px within a 45x45px cell? Padding in units of pt only makes sense for the info cell. --Charles Brooking (talk) 12:03, 5 September 2008 (UTC)

Quite right. Actually, 4px instead of 4pt makes more sense for the info cell as well; giving the text slightly more breathing space. EdokterTalk 14:12, 5 September 2008 (UTC)

id width problems

I tired changing an existing userbox, Template:User_Brisbane, to use this template and encountered something bizarre: setting id-p = 0 and including an image with width 45px as the logo caused the id cell to actually be smaller than the image! This happens in Firefox 2 and 3 at least.

Compare these:

Looking at the resulting HTML, I can't see what the problem lies. Anyone got better eyes?

Charles Brooking (talk) 15:20, 5 September 2008 (UTC)

To subst or not to subst?

Are we supposed to subst this template or not? I wouldn't have thought so, but the documentation seems to suggest otherwise. PC78 (talk) 22:10, 11 January 2009 (UTC)

I see nothing that suggests that this template must be substed. This template is supposed to be (and heavily is) used as a meta template to construct other userboxes. EdokterTalk 22:56, 11 January 2009 (UTC)
The code in the "Examples" section. I get that this is a meta, but that was throwing me. PC78 (talk) 23:00, 11 January 2009 (UTC)
Ah, I see it. That really doesn't make sense; once substed, you can no longer edit parameters. I've removed those from the examples. EdokterTalk 00:39, 12 January 2009 (UTC)

border when enclosed in wikitable

When I list userboxes in a wikitable, I get a border even if border-s=0; for example:

 This is an example userbox.
standard table
 This is an example userbox.
 This is an example userbox.

--—— Gadget850 (Ed) talk - 14:31, 14 January 2009 (UTC)

border-s only controls the border width of the box itself, and the userbox has a default margin of 1px. You will need to set the table's cell padding to zero. EdokterTalk 15:02, 14 January 2009 (UTC)
It's actually an issue with the CSS: wikitable specifies that all TDs inside the table should have a border, even if those TDs are inside another table inside the wikitable as is the case here. The more correct rule (.wikitable > * > tr > td) doesn't work in IE6. I suppose someone could make an editprotected request for this template to specifically override that with inline styles, but I'd first ask "Why do you want a userbox in a wikitable, anyway?" Anomie 22:53, 14 January 2009 (UTC)
Not a big deal, just one of those things that drove me crazy for a bit. I'm trying to merge a few userboxes that have proliferated by using a switch for the info, and I was documenting the parameters in a wikitable. Might as well just note this in the documentation and let it go. --—— Gadget850 (Ed) talk - 01:33, 15 January 2009 (UTC)

Request left/right

Can we change




Where "side-lr" will be the parameter deciding whether the infobox will stick to the left or right margin.

I'm not sure this will work, since I am not a template builder, but I'm sure somebody else is. Debresser (talk) 02:05, 19 May 2009 (UTC)

Actually, the undocumented |float= does exactly what you want:
However, center does something odd:
---— Gadget850 (Ed) talk 02:17, 19 May 2009 (UTC)

Could somebody fix this, please? Afterwards, I would recommend updating the documentation page with the "float" parameter. Debresser (talk) 02:55, 19 May 2009 (UTC)

Fixed the doc. I don't know what style="float:5;" is supposed to do, but "float:5" won't do anything. Also, there is no "center" in float; it is not a valid value in CSS. EdokterTalk 22:03, 19 May 2009 (UTC)
So that is why. :) Thanks for the info, and for updating the doc. Debresser (talk) 22:20, 19 May 2009 (UTC)
D'oh! ---— Gadget850 (Ed) talk 23:01, 19 May 2009 (UTC)

Bug report: Undefined usercategory exception isn't caught

If the usercategory parameter isn't supplied, the template outputs [[Category:{{{usercategory}}}|...]]. Please add some exception handling, e.g.:


--Koveras  08:28, 10 June 2009 (UTC)


I've got a small problem. Even though the usage is defined, I seriously can't make heads or tails of it.--Launchballer (talk) 08:33, 2 August 2009 (UTC)

Copy and paste the usage given in this section, fill in any colours, the id and the info fields, and then delete any lines which don't have an assigned value. Chris Cunningham (not at work) - talk 12:37, 4 August 2009 (UTC)


{{editprotected}} Could the sandbox version be copied over to live. I've added some code to make the usercategory & usercategory2 parameters that were recently added also work on template pages. Thanks. -- WOSlinker (talk) 19:04, 29 August 2009 (UTC)

  DoneJake Wartenberg 20:31, 29 August 2009 (UTC)
Shouldn't the categories also be effective when the boxes are placed on user talk pages ? See confusion here: Wikipedia:Village_pump_(technical)#Something_wrong_with_Template:Babel. —TheDJ (talkcontribs) 20:59, 1 September 2009 (UTC)
Namespace detection is a good idea, but I should think that we only want user categories in User and User talk namespaces. ---— Gadget850 (Ed) talk 19:25, 2 September 2009 (UTC)

This seems like an odd request. The usercategory parameters should only be active on user pages, IMO. PC78 (talk) 16:39, 4 October 2009 (UTC)

No id?

Could someone make the ID cell optional via |noid= or similar? I'd look into it myself, but I'm feeling a bit out of it today and wouldn't trust myself to wade through such dense wikimarkup right now. =P ダイノガイ千?!? · Talk⇒Dinoguy1000 19:26, 11 September 2009 (UTC)

Code is in the sandbox; no need for a new switch, just omits itself if none is supplied. Chris Cunningham (not at work) - talk 13:43, 15 October 2009 (UTC)
Looks good; I'll sync it in a minute. ダイノガイ千?!? · Talk⇒Dinoguy1000 17:32, 16 October 2009 (UTC)

Userboxes in Tables

There seems to be an odd bug when using Userboxes in tables. I first noticed it on UESPWiki and have just confirmed that it's an issue here as well. Another editor there said it was a common problem with Userboxes in tables, but I figure somebody here must have some insight into it, or hopefully a solution to the problem. Please see the table below for the problem (Row 2), as well as a workaround (Row 3). Row 1 is there with a dummy template entry simply to show that the problem is not with having a template before the vertical bars.

{{Why}}||test [why?] test

Any thoughts? Or if this is a well-known problem, can someone please point me to the explanation? Thanks! —RobinHood70 (talkcontribs) 06:45, 18 October 2009 (UTC)

The userbox is a table wrapped in a div. The problem you are seeing occurs when a table is included inside another table:
included table
included table
---— Gadget850 (Ed) talk 09:43, 18 October 2009 (UTC)
I figured it might be something like that. So there's nothing that can be done to fix it, then? —RobinHood70 (talkcontribs) 19:31, 18 October 2009 (UTC)
Other than converting the table in userbox to a div. ---— Gadget850 (Ed) talk 19:37, 18 October 2009 (UTC)
(e/c) It's a bit messy, but you can do:

PC78 (talk) 19:40, 18 October 2009 (UTC)

Thanks for the responses. Guess we'll have to wait for a fix to the table parser itself, if that's even a viable option. —RobinHood70 (talkcontribs) 19:48, 18 October 2009 (UTC)
Ultimately, I did find a solution to this issue: convert the wiki table to an HTML table (similar to Gadget850's suggestion of converting it to a div) and remove all the unneeded CRs (e.g., the blank link between the <div> tag and the table start) from the entire template, and you can then use it in tables quite successfully. It's easy enough to implement it if we want to, but I don't know if there's any pressing need to do so. —RobinHood70 (talkcontribs) 04:17, 5 August 2010 (UTC)

Box is to High

I believe that the box is to high and should be back to its originale. --Mr. Unknown (talk) 21:10, 5 November 2009 (UTC)

Please characterize the issue. Is this pertaining to a specific userbox? ---— Gadget850 (Ed) talk 22:17, 5 November 2009 (UTC)



Can vertical-align: middle be removed from the template (see sandbox for version without) as it doesn't serve any purpose and it's also stopping me from converting {{User Signpost-subscription}} to use userbox. Thanks -- WOSlinker (talk) 19:33, 26 November 2009 (UTC)

Actually, it does serve a purpose; most userboxes are embedded in other templates, ie. {{Infobox user}}. These tend to align their content to the top, which {{Userbox}} would inherit. The vertical-align: middle resets that property. However, you can override it by using the id-op and info-op parameters to pass your own CSS. EdokterTalk 21:20, 26 November 2009 (UTC)
Update; I spotted an error that prevents overriding the vertical-align. I'll fix it in the sandbox. EdokterTalk 21:42, 26 November 2009 (UTC)
All right, have a look! I also fixed the vertical-align in the live template. EdokterTalk 21:53, 26 November 2009 (UTC)
Thanks, that works. Why don't {{userbox-2}} and {{userbox-r}} use vertical-align: middle then? -- WOSlinker (talk) 22:03, 26 November 2009 (UTC)
Never knew they were there :) Just an oversight; they are used a lot less the this one. EdokterTalk 22:11, 26 November 2009 (UTC)

Shorter box

How can I get a shorter box. I see no fields that would allow me to change the width of the total box. thankx GloverEpp (talk) 21:04, 2 December 2009 (UTC)

Category opt-out

{{editprotected}} Many of the userboxes have code like this:

 <includeonly>{{#ifeq:{{{categories}}}|no||[[Category:Wikipedians who whatever|{{PAGENAME}}]]}}</includeonly>

So that people can add userboxes but opt-out of the categories by using "categories=no" Can this logic be added to this template?—Chowbok 09:54, 30 December 2009 (UTC)

The template was using {{cat handler}}, so i added the nocat option that it has. —TheDJ (talkcontribs) 11:29, 30 December 2009 (UTC)
Hmm, doesn't seem to be working. How do I invoke it?—Chowbok 12:31, 30 December 2009 (UTC)
nocat=true and the userbox that you are using needs to pass this option to {{userbox}} of course. —TheDJ (talkcontribs) 12:36, 30 December 2009 (UTC)


Is there any way of having a default documentation that cascades down to individual userboxes that explains how to use nocat=true? It isn't particularly newbie-friendly. —Tom Morris 13:08, 14 January 2011 (UTC)

add usercategory3

{{editprotected}} Can the sandbox version be copied over which adds a usercategory3 option. Thanks -- WOSlinker (talk) 16:39, 13 February 2010 (UTC)

Has been done now. -- WOSlinker (talk) 19:05, 13 February 2010 (UTC)


{{editprotected}} Could all case of {{PAGENAME}} be replaces with {{BASEPAGENAME}} so that the categories list users rather than user subpages? Thanks. Set Sail For The Seven Seas 214° 4' 0" NET 14:16, 13 March 2010 (UTC)

  DoneTheDJ (talkcontribs) 16:25, 13 March 2010 (UTC)

Recommended size

Why is the recommended size 45px? The default size is bigger that. Most userboxes use the default size, including the language ones.

foo logoWe have specified values to lessen the distance in between text lines & padding space in between cell content and its border.
enThis user is a native speaker of the English language.
frCet utilisateur a pour langue maternelle le français.
 This user enjoys ska.
 This user enjoys punk rock.

The first is the example used on the template page with a recommended height of 45px. The others are a random assortment of userboxes with a standard default height of bigger than 45px. McLerristarr (Mclay1) (talk) 14:47, 20 May 2010 (UTC)




Please change:



class="wikipediauserbox {{{bodyclass|}}}"

to facilitate the use of a class on the whole template, like on {{Infobox}} and {{Navbox}}. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 11:01, 8 June 2010 (UTC)

Could I ask you to explain exactly where? Or, better still, copy the code into a subpage and make your correction there so i or another admin can just copy it over. Thanks, HJ Mitchell | Penny for your thoughts? 22:01, 8 June 2010 (UTC)
Thank you; it's the last item inside the first (<div />) tag. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 10:02, 9 June 2010 (UTC)
  Done [1]? HJ Mitchell | Penny for your thoughts? 17:44, 9 June 2010 (UTC)
Thank you again. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 12:05, 10 June 2010 (UTC)

One more, please: On reflection, I've added |info-class=, to add a similar class attribute to the |info= field, in this sandbox edit. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 15:12, 10 June 2010 (UTC)

If I were to copy the content of the sandbox from that oldid into the live template, would that work without breaking anything? HJ Mitchell | Penny for your thoughts? 15:30, 10 June 2010 (UTC)
From oldid=367218434? No - that would be fine; you can select all then cut & paste. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 15:36, 10 June 2010 (UTC)
That work? HJ Mitchell | Penny for your thoughts? 15:40, 10 June 2010 (UTC)
My apologies: no - I missed out a {, now added and tested (as I should have done first time) in the /testcases page. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 15:55, 10 June 2010 (UTC)
Trout! Is that better? HJ Mitchell | Penny for your thoughts? 16:23, 10 June 2010 (UTC)
Yes, please, with almonds. Thank you. Andy Mabbett (User:Pigsonthewing); Andy's talk; Andy's edits 16:37, 10 June 2010 (UTC)

Possible redundancy

{{editprotected}} In the template, there exists the construct {{{info|{{{4|{{{info|''info''}}}}}}}}}. Is there some use I'm unaware of for the info parameter being used both before and after the unnamed parameter there, or should that be simplified to just {{{info|{{{4|''info''}}}}}}? —RobinHood70 (talkcontribs) 19:01, 2 August 2010 (UTC)

Discussion with several knowledgeable template writers has confirmed that this is redundant. Please change:
Thanks! —RobinHood70 (talkcontribs) 19:09, 2 August 2010 (UTC)
  Done —  Tivedshambo  (t/c) 20:22, 2 August 2010 (UTC)

Windows Internet Explorer v. Mozilla Firefox

As one might expect, Internet Explorer 8.0 and Firefox 3.6.8 have different interpretations of the default settings for Template:Userbox. If id-p is set to 0 and border-s, id-h, and info-p default to 1, 45, 4px and respectively, Firefox will create a userbox 47 pixels in height unless id or info require more height. With the same settings, Internet Explorer creates a userbox 55 pixels high. Internet Explorer adds vertical space for twice the value of info-p whether info requires this height or not. This can be overcome by setting info-p to 0, but this defeats the purpose of padding. Comments? Yours aye, Buaidh (talk) 19:58, 4 August 2010 (UTC)

Just as a point of reference, on a PC with XP SP3, Opera and Firefox both create userboxes 47 pixels in height, while Safari, IE, and Chrome all create userboxes 55 pixels in height, so it's not just an IE issue. Clearly there's a different interpretation of how to pad things between browsers, as you mentioned.
On further research, the "height" CSS parameter is also playing a part here. In the same sets of browsers as mentioned above, when I removed the height only for the info section, leaving it in for the id section (see below), the box shrank to 47 pixels across all browsers. So, if I'm interpreting this correctly, Chrome/IE/Safari are adding height and padding together; Firefox/Opera take padding to be a part of the height (which, if I understand the CSS spec correctly, they shouldn't). Removing the height from the info side is really only a kludge, though, since the padding difference between browsers remains and would manifest on the id if the padding were non-zero there. I'm not sure if there's a good solution to this problem, but I'm tired...there might be something staring me in the face that I'm just not seeing.
In some browsers, this box is 55px tall.
id This box is 47px across all browsers.
RobinHood70 (talkcontribs) 04:08, 5 August 2010 (UTC)

I have yet to find a way to make all these browsers create similar userboxes other than setting both id-p and info-p to zero. --Buaidh (talk) 16:09, 10 August 2010 (UTC)

Default padding values

{{editprotected}} Whereas, popular web browsers currently in use (Windows Internet Explorer 8.0, Google Chrome 5, Safari 5, Mozilla Firefox 3.6.8, and Opera 10.61) interpret CSS padding quite differently, and

Whereas, the default padding values (1px and 4px) for Template:Userbox may cause userboxes to appear quite differently in the various browsers (as shown above), and

Whereas, it is highly desirable to have userboxes of uniform external dimensions, therefore

I request that the default values for id-p and info-p be set to 0 in Template:Userbox Yours aye, Buaidh ([[User --Buaidh (talk) 20:33, 19 August 2010 (UTC)talk:Buaidh|talk]]) 20:02, 13 August 2010 (UTC)

This seems logical, but I'd like to see some comments from others before implementing this. — Martin (MSGJ · talk) 08:47, 14 August 2010 (UTC)
If this change is made, something similar wil need doing to {{Userbox-r}} and {{Userbox-2}}. -- WOSlinker (talk) 10:20, 14 August 2010 (UTC)
I have no issues with the change being made, though a number of other userboxes might be affected as a result. Still, I tend to think that it's up to the designers/users of a UB to make sure it looks correct after any changes to this template, so I support the move. —RobinHood70 (talkcontribs) 23:44, 14 August 2010 (UTC)
If we default info-p to 0, we should also switch info from text-align:left to text-align:center. --Buaidh (talk) 20:07, 16 August 2010 (UTC)
That would be a rather big change to alter the text alignment. I would be against such a move. -- WOSlinker (talk) 20:23, 16 August 2010 (UTC)

Centering info is just a suggestion. See below:

This is how Template:Userbox looks now on Internet Explorer.
This is how Template:Userbox looks now on Mozilla Firefox.
This is how Template:Userbox looks with id-p=0 and info-p=0 on all browsers.
This is how Template:Userbox looks with id-p=0 and info-p=0 on all browsers.
This is how Template:Userbox looks with id-p=0, info-p=0, and text-align:center on all browsers.
This is how Template:Userbox looks with id-p=0, info-p=0, and text-align:center on all browsers.

Alternatively, a user can easily center text with either info-op=text-align:center or <center></center>. (Two new parameters: id-a and info-a =left/center/right would make it even simpler.) Yours aye, Buaidh (talk) 16:28, 17 August 2010 (UTC)

Just to confirm, here: what exactly is being asked for? The only problem at the moment appears to be that IE messes up the id padding. Can that be fixed without changing the info padding? If so then that should be an uncontroversial and easy gain. Chris Cunningham (user:thumperward: not at work) - talk 10:06, 18 August 2010 (UTC)

As best as we can determine, Windows Internet Explorer 8.0, Google Chrome 5, and Safari 5 set the height of Template:Userbox to:

Height(Template:Userbox) = Maximum(Maximum(Height(id),id-h)+(2*id-p),Height(info)+(2*info-p))+(2*border-s)

While Mozilla Firefox 3.6.8 and Opera 10.61 set the height of Template:Userbox to:

Height(Template:Userbox) = Maximum(Height(id)+(2*id-p),Height(info)+(2*info-p),id-h+(2*id-p))+(2*border-s)

This means that the default settings for Template:Userbox produce a box 55 pixels high on IE, Chrome, and Safari, but 47 pixels high on Firefox and Opera. We have yet to find a direct solution for this problem.

The following work-around has been proposed. Change the default value of id-p from 1px to 0 and the default value of info-p from 4px to 0. This will eliminate default padding of id and info, but will make the default height of Template:Userbox 47 pixels on all browsers (see above.) Yours aye, Buaidh (talk) 14:08, 18 August 2010 (UTC)

Can't the horizontal padding value be specified separately from the vertical, if the only problem is the vertical padding? Chris Cunningham (user:thumperward: not at work) - talk 14:37, 18 August 2010 (UTC)
That's an excellent suggestion. We could set the default for id-p to 0 1px 0 0 and the default for info-p to 0 4px 0 4px. That would provide text padding for info and keep the default height 47 pixels for all browsers.
A default userbox with text stands 55 pixels high on Internet Explorer.
 A default userbox with a 45px high image also stands 55 pixels high on Internet Explorer.
A default userbox with text stands 47 pixels high on Mozilla Firefox.
 A default userbox with 45px high image stands 49 pixels high on Mozilla Firefox.
With id-p=0 1px 0 0 and info-p=0 4px 0 4px, proposed userbox with text stands 47 pixels high on all browsers.
 Proposed userbox with a 45px high image also stands 47 pixels high on all browsers.
Proposed userbox with text and id-c=black and id-fc=white.
 Proposed userbox with a 45px high image and id-c=black.
Yours aye, Buaidh (talk) 17:45, 18 August 2010 (UTC)
Excellence. If we're good to go here then I'll be happy to sync it in 24 hours or so, to leave some time for any bugs or objections to be raised. Chris Cunningham (user:thumperward: not at work) - talk 19:25, 18 August 2010 (UTC)
Yup, great idea, Chris. That should resolve the problem. Oh and going back a couple of contributions, it's not IE/Chrome/Safari "messing up" as far as I can tell, it's Firefox/Opera. But I'm just being pedantic; the larger issue is that all the userboxes appear the same regardless of browser, which it seems they now will.
Oh and as for the centering, given that that would affect almost every userbox on the site in a semi-significant way, I don't think Template:Userbox is the place to discuss it since almost nobody (comparatively) would be reading a template talk page. —RobinHood70 (talkcontribs) 05:44, 19 August 2010 (UTC)
The centering issue is off the table. --Buaidh (talk) 13:14, 19 August 2010 (UTC)

ERROR NOTICE: The userbox height calculation shown above for IE, Chrome, and Safari is in error. I am continuing to research this anomaly. This should not affect the decision to update {{{id-p|0 1px 0 0}}} and {{{info-p|0 4px 0 4px}}}. --Buaidh (talk) 17:52, 19 August 2010 (UTC)

After some further investigation, I've determined that the height of Template:Userbox on Internet Explorer is:

Height(Template:Userbox) = Maximum(Height(id)+(2*id-p),Height(info)+(2*info-p),id-h+(2*id-p),id-h+(2*info-p))+(2*border-s)

The height of Template:Userbox on Mozilla Firefox is:

Height(Template:Userbox) = Maximum(Height(id)+(2*id-p),Height(info)+(2*info-p),id-h+(2*id-p))+(2*border-s)

We should proceed with the update to {{{id-p|0 1px 0 0}}} and {{{info-p|0 4px 0 4px}}}. --Buaidh (talk) 20:33, 19 August 2010 (UTC)

I'm going to hold off for a bit just to make sure, but I'm still keeping track here. If you find any further problems please let me know. Chris Cunningham (user:thumperward: not at work) - talk 20:48, 19 August 2010 (UTC)
I've encountered no problems with this proposed update. Has anyone else? --Buaidh (talk) 14:11, 25 August 2010 (UTC)
  Done. If there are any problems please ping me ASAP. Chris Cunningham (user:thumperward: not at work) - talk 09:52, 27 August 2010 (UTC)
  • These changes make the userboxes look awful. –xenotalk 12:28, 2 September 2010 (UTC)
I'd bet Firefox and Opera users would disagree, since they're used to seeing them the way everybody sees them now. Personally, I much prefer the consistent borders (or lack thereof) around the image in the current version (right) rather than the too-tall previous version (left).
 This user is owned by one or more cats.
 This user is owned by one or more cats.
RobinHood70 (talkcontribs) 07:58, 5 September 2010 (UTC)

Edit request from Buaidh, 30 August 2010

{{Edit protected}} I request that two horizontal text alignment parameters, id-a and info-a, be added to Template:Userbox. The four allowable values for id-a and info-a shall be left, center, right, and justify. The only code changes required are:

  1. Change text-align:center; to text-align:{{{id-a|center}}};
  2. Change text-align:left; to text-align:{{{info-a|left}}};

Rationale: This update will not change any functionality of this template, but it will allow novice users to align text and images more intuitively. Users can currently align text with the id-op and info-op parameters or a <center></center> markup. Parameters id-op and info-op do require familiarity with CSS and an examination of the template code. The proposed parameters id-a and info-a will only require a declaration of left/center/right/justify to horizontally align id and info. Parameters id-op and info-op can continue to be used for more complex CSS properties. --Buaidh (talk) 19:18, 30 August 2010 (UTC)

Done.--Commander Keane (talk) 04:50, 31 August 2010 (UTC)

moving {{pp-template|small=yes}}

{{editprotected}} hi, please move {{pp-template|small=yes}} to documentation. (same Navbox, Infobox), thanks.--ebraminiotalk 11:29, 1 October 2010 (UTC)

  Done WOSlinker (talk) 11:50, 1 October 2010 (UTC)

Wikilink in userbox on non-userpage

This thread is specific to the userbox listed on Wikipedia:CAMPUS#Getting_involved. I am confused as to why the userbox isn't linking to the Campus Ambassador wikilink. It displays normally on userpages. Is this part of the userbox code to not display wikilinks in a userbox on a non-userpage? Thanks. Basket of Puppies 19:15, 18 January 2011 (UTC)

When you are on the page that the link points to, the link is not shown and the text is shown in bold instead. For example the following text is bold rather than a link: Template talk:Userbox. That is just a standard feature of all wikilinks. -- WOSlinker (talk) 19:49, 18 January 2011 (UTC)

Edit request from Rafy, 14 February 2011

{{edit protected}}

please add ar:قالب:مستخدم

Rafy talk 16:57, 14 February 2011 (UTC)

Please do this yourself by adding it to the bottom of Template:Userbox/doc. — Martin (MSGJ · talk) 18:17, 14 February 2011 (UTC)
Done that, thanks. Rafy talk 18:28, 14 February 2011 (UTC)

Extra </div>

Is it possible that there is an extra </div> tag. Different UBXs keep closing some divs i have used in the past so I had to remove them (good example can be found at this revision of WormTT's talk page the extra </div> closes the background.) Thanks,  Adwiii  Talk  21:18, 28 April 2011 (UTC)

No, it just that with including the userbox with some indented text, the HTML Tidy program that is used on the wikimedia servers ends up adding an extra closing div tag to the HTML. -- WOSlinker (talk) 22:13, 28 April 2011 (UTC)

font size - why pt?

Would it be possible for id-s and info-s to recognize CSS keyword sizes and not append "pt" to the (supposed) number if it is one of them? Or only append "pt" if the value is, in fact, a number? For that matter, could we assign id-s=x-large and info-s=small default values? Setting font sizes on the web in terms of absolute units is widely considered bad practice. I don't understand why it's being done here. ⇔ ChristTrekker 20:16, 28 June 2011 (UTC)

Quite simply, because the userbox is sized in px. Edokter (talk) — 00:20, 13 November 2011 (UTC)

Flat userbox support

I've added support for the flat userbox style to the sandbox by passing in small=yes. If people think this is useful then I'll merge that template here; it's not used much, but the few editors who use it seem to find it attractive, and it's a great deal more compact than the default userbox style (much closer to those little Silkscreen buttons which were so popular on the Web about ten years ago). Support itself is trivial. Chris Cunningham (user:thumperward) - talk 07:35, 6 September 2011 (UTC)

If you do add it then {{userbox-r}} & {{userbox-2}} should be done as well. -- WOSlinker (talk) 07:50, 6 September 2011 (UTC)
It's high time both of them were merged here to be honest: the additional baggage from the extra code paths should be worth the wins in maintainability from keeping all the relevant logic in one code base. That also applies to {{flat userbox right}}. I'll have a poke about with this: I seem to recall hacking on it for a while and then giving up on it in the past, but it can't be too troublesome. Chris Cunningham (user:thumperward) - talk 09:14, 6 September 2011 (UTC)


What are the dimensions of the default userbox?
by Xsanda (visit my talk page) 17:47, 16 September 2011 (UTC)

The default width of userboxes seems to be 238px. If the border is greater than 1px this causes the userbox to widen. Is it possible, using wikimarkup, to make the width (240-(2*border)px? nagualdesign (talk) 23:59, 12 November 2011 (UTC)

Waray Waray

Please add the link to winaray wikipedia. Thanks, --Agantacroxi (talk) 18:05, 27 September 2011 (UTC)

Done. Edokter (talk) — 00:21, 13 November 2011 (UTC)


The "tweaking" of userbox dimensions has altered a number of userbox templates that invoke Template:Userbox. Please let us know explicitly what is going on.

In a related matter, userboxes that use the default height and width and default border width of 1 pixel can be neatly stacked. The inclusion of a single userbox with a broader border disrupts this stacking. Perhaps we should adjust the internal box dimensions to compensate for border width and keep the external dimensions constant. See below.

 This user is a native of Afghanistan.
 This user is a native of Albania.
 This user is a native of Algeria.
 This user is a native of American Samoa.
 This user is a native of Andorra.
 This user is a native of Angola.
 This user is a native of Anguilla.
 This user is a native of Antigua and Barbuda.
 This user is a native of Argentina.
 This user is a native of Armenia.
 This user is a native of Australia.
 This user is a native of Austria.
 This user is a native of Azerbaijan.
 This user is a native of the Bahamas.
 This user is a native of Bahrain.
 This user is a native of Bangladesh.
 This user is a native of Barbados
 This user is a native of Belarus.
 This user is a native of Belgium.
 This user is a native of Belize.
 This user is a native of Benin.
 This user is a native of Bermuda.
 This user is a native of Bhutan.
 This user is a native of Bolivia.
 This user is a native of Bosnia and Herzegovina.
 This user is a native of Botswana.
 This user is a native of Brazil.
 This user is a native of the British Indian Ocean Territory.
 This user is a native of the British Virgin Islands.
 This user is a native of Brunei.
 This user is a native of Burkina Faso.
 This user is a native of Myanmar.
 This user is a native of Burundi.
 This user is a native of Cambodia.
 This user is a native of Cameroon.
 This user is a native of Canada.
 This user is a native of Cape Verde.
 This user is a native of the Cayman Islands.
 This user is a native of the Central African Republic.
 This user is a native of Chad.
 This user is a native of Chile.
 This user is a native of China.
 This user is a native of Christmas Island.
 This user is a native of the Cocos (Keeling) Islands.
 This user is a native of Colombia.
 This user is a native of the Comoros.
 This user is a native of the Cook Islands.
 This user is a native of Costa Rica.

Yours aye,  Buaidh  18:50, 23 January 2012 (UTC)


I updated{{Userbox/sandbox}} to use CSS instead of the now-obsolete cellspacing attribute. If someone want to check me... ---— Gadget850 (Ed) talk 22:27, 22 September 2012 (UTC)

Looks good. Removed the zero padding as it was duplicate/overridden. Edokter (talk) — 09:33, 23 September 2012 (UTC)
  Done. Updated {{userbox-2}} and {{userbox-r}} as well. Edokter (talk) — 10:51, 23 September 2012 (UTC)
Thanks! ---— Gadget850 (Ed) talk 13:27, 23 September 2012 (UTC)


Tweaking the userbox dimensions has again screwed up hundreds of userboxes. I hope we are about done.  Buaidh  15:35, 17 April 2013 (UTC)

Edit request on 18 April 2013

Please modify:

<div style="float:{{{float|left}}}; border:{{{border-width|{{{border-s|1}}}}}}px solid {{{border-color|{{{1|{{{border-c|{{{id-c|#999}}}}}}}}}}}}; margin:1px; width:238px;" class="wikipediauserbox {{{bodyclass|}}}">


<div style="float:{{{float|left}}}; border:{{{border-width|{{{border-s|1}}}}}}px solid {{{border-color|{{{1|{{{border-c|{{{id-c|#999}}}}}}}}}}}}; margin:1px; width:{{#expr:239-{{{border-width|{{{border-s|1}}}}}}}}px;" class="wikipediauserbox {{{bodyclass|}}}">

This modification will standardize the width of the infoboxes so that they will uniformly fit inside of table columns.

Technical 13 (talk) 13:21, 18 April 2013 (UTC)

  • I believe this should properly be changed to:
<div style="float:{{{float|left}}}; border:{{{border-width|{{{border-s|1}}}}}}px solid {{{border-color|{{{1|{{{border-c|{{{id-c|#999}}}}}}}}}}}}; margin:1px; width:{{#expr:240-2*{{{border-width|{{{border-s|1}}}}}}}}px;" class="wikipediauserbox {{{bodyclass|}}}">
The result of all three lines is the same for border-s=1, but only the line immediately above maintains a default total width of 240px for all reasonable values of border-s. We really need to get this default userbox width nailed down once and for all. Yours aye,  Buaidh  14:31, 22 April 2013 (UTC)
  •   Not done:. This proposed change needs to be tested properly, as the template has more than 100,000 transclusions. Please add the code to the sandbox and create some test cases, per WP:TESTCASES. Once you can prove that everything is working as it should be, you can reactivate the edit request template. Best — Mr. Stradivarius ♪ talk ♪ 16:24, 22 April 2013 (UTC)
    • Neither of these proposed changes work as intended.  Buaidh  20:47, 22 April 2013 (UTC)
    • I will set it up in the sandbox with testcases. Sorry it took so long for me to get back and read this, forgot to watch the page. Technical 13 (talk) 15:02, 4 May 2013 (UTC)

Edit request on 22 April 2013

In conjunction with the (hopefully corrected) edit request by User:Technical 13 above, I request the following two changes:

style="border:0; width:{{{logo-width|{{{id-w|45}}}}}}px; height:{{{logo-height|{{{id-h|45}}}}}}px; background:{{{logo-background|{{{1|{{{id-c|#DDD}}}}}}}}}; text-align:{{{id-a|center}}}; font-size:{{{logo-size|{{{5|{{{id-s|14}}}}}}}}}pt; color:{{{logo-color|{{{id-fc|black}}}}}}; padding:{{{logo-padding|{{{id-p|0 1px 0 0}}}}}}; line-height:{{{logo-line-height|{{{id-lh|1.25em}}}}}}; vertical-align: middle; {{{logo-other-param|{{{id-op|}}}}}}"


style="border:0; width:{{{logo-width|{{{id-w|{{#expr:47-2*{{{border-width|{{{border-s|1}}}}}}}}}}}}}}px; height:{{{logo-height|{{{id-h|{{#expr:47-2*{{{border-width|{{{border-s|1}}}}}}}}}}}}}}px; background:{{{logo-background|{{{1|{{{id-c|#DDD}}}}}}}}}; text-align:{{{id-a|center}}}; font-size:{{{logo-size|{{{5|{{{id-s|14}}}}}}}}}pt; color:{{{logo-color|{{{id-fc|black}}}}}}; padding:{{{logo-padding|{{{id-p|0 1px 0 0}}}}}}; line-height:{{{logo-line-height|{{{id-lh|1.25em}}}}}}; vertical-align: middle; {{{logo-other-param|{{{id-op|}}}}}}"

and replace:

style="border:0; text-align:{{{info-a|left}}}; font-size:{{{info-size|{{{info-s|8}}}}}}pt; padding:{{{info-padding|{{{info-p|0 4px 0 4px}}}}}}; height:{{{logo-height|{{{id-h|45}}}}}}px; line-height:{{{info-line-height|{{{info-lh|1.25em}}}}}}; color:{{{info-color|{{{info-fc|black}}}}}}; vertical-align: middle; {{{info-other-param|{{{info-op|}}}}}}"


style="border:0; text-align:{{{info-a|left}}}; font-size:{{{info-size|{{{info-s|8}}}}}}pt; padding:{{{info-padding|{{{info-p|0 4px 0 4px}}}}}}; height:{{{logo-height|{{{id-h|{{#expr:47-2*{{{border-width|{{{border-s|1}}}}}}}}}}}}}}px; line-height:{{{info-line-height|{{{info-lh|1.25em}}}}}}; color:{{{info-color|{{{info-fc|black}}}}}}; vertical-align: middle; {{{info-other-param|{{{info-op|}}}}}}"

This request creates a default userbox total height of 47px for all reasonable values of border-s. The current default userbox total height of 47px is a result of a default id-h=45 and a default border-s=1. This request, together with the corrected User:Technical 13 request, will permit default size userboxes to be neatly stacked without the need for an arrangement table.  Buaidh  15:58, 22 April 2013 (UTC)

  •   Not done: This needs to be tested first - see my comment for the section above. Best — Mr. Stradivarius ♪ talk ♪ 16:24, 22 April 2013 (UTC)
    • I am a well-intended idiot. Back to the drawing table.  Buaidh  20:51, 22 April 2013 (UTC)

Edit request on 4 May 2013

Hello friendly administrator responding to this request! I request that:

<div style="float:{{{float|left}}}; border:{{{border-width|{{{border-s|1}}}}}}px solid {{{border-color|{{{1|{{{border-c|{{{id-c|#999}}}}}}}}}}}}; margin:1px; width:238px;" class="wikipediauserbox {{{bodyclass|}}}">
{| style="border-collapse:collapse; width:238px; margin-bottom:0; background:{{{info-background|{{{2|{{{info-c|#EEE}}}}}}}}}"

Be changed to:

<div style="float: {{{float|left}}}; border: {{#iferror:{{#ifexpr:{{{border-width|{{{border-s|1}}}}}}<0|1|{{{border-width|{{{border-s|1}}}}}}}}|1}}px solid {{{border-color|{{{1|{{{border-c|{{{id-c|#999}}}}}}}}}}}}; margin: 1px; width: {{#iferror:{{#ifexpr:{{{border-width|{{{border-s|1}}}}}}<0|238|{{#expr:240-(2*{{{border-width|{{{border-s|1}}}}}})}}}}|238}}px;" class="wikipediauserbox {{{bodyclass|}}}">
{| style="border-collapse: collapse; width: {{#iferror:{{#ifexpr:{{{border-width|{{{border-s|1}}}}}}<0|238|{{#expr:240-(2*{{{border-width|{{{border-s|1}}}}}})}}}}|238}}px; margin-bottom: 0; background: {{{info-background|{{{2|{{{info-c|#EEE}}}}}}}}}"

As reflected in the sandbox testing done with this comparison, which will make the majority of the userboxes uniform in width as is represented in the Box width section of the testcases page. Thank you. Technical 13 (talk) 16:03, 4 May 2013 (UTC)

  • My original intent was to hold the userbox outside dimensions to 240px by 47px for values of border-s from 0 to 12 px. I can't see what this code change accomplishes (at least in Firefox.)  Buaidh  19:24, 4 May 2013 (UTC)
    This change maintains an outside width of 240px. I've seen some userboxes that are intentionally much taller, and I've got no problem with that. Technical 13 (talk) 19:38, 4 May 2013 (UTC)
    I suppose, if it was an issue to other people, I could rework the template to maintain a height as well. If I was to do this, I would want to add some categorization so that people could still make really tall boxes but they would get categorized as "Over-sized userboxes" or something of that sort. Technical 13 (talk) 19:41, 4 May 2013 (UTC)
    Oh, and the "Box width" section of the testcases page clearly shows the improvement on FireFox 20 for me... Technical 13 (talk) 19:47, 4 May 2013 (UTC)
    • You're correct. Only the userbox height increases. This works for me.  Buaidh  20:13, 4 May 2013 (UTC)

  implemented — Martin (MSGJ · talk) 12:08, 9 May 2013 (UTC)

Edit request on 17 May 2013

I'm requesting that:

|}</div>{{#if:{{{usercategory|}}}{{{usercategory2|}}}{{{usercategory3|}}}|{{category handler
 |nocat = {{{nocat|}}}
 |subpage = {{#if:{{{nocatsubpages|}}}|no}}
 |user = {{#if:{{{usercategory|}}}|[[Category:{{{usercategory}}}]]}}{{#if:{{{usercategory2|}}}|[[Category:{{{usercategory2}}}]]}}{{#if:{{{usercategory3|}}}|[[Category:{{{usercategory3}}}]]}}
 |template = {{#if:{{{usercategory|}}}|[[Category:{{{usercategory}}}| {{BASEPAGENAME}}]]}}{{#if:{{{usercategory2|}}}|[[Category:{{{usercategory2}}}| {{BASEPAGENAME}}]]}}{{#if:{{{usercategory3|}}}|[[Category:{{{usercategory3}}}| {{BASEPAGENAME}}]]}}

Be modified to include:

|}</div>{{#if:{{{usercategory|}}}{{{usercategory2|}}}{{{usercategory3|}}}{{{usercategory_raw|}}}|{{category handler
 |nocat = {{{nocat|}}}
 |subpage = {{#if:{{{nocatsubpages|}}}|no}}
 |user = {{#if:{{{usercategory|}}}|[[Category:{{{usercategory}}}]]}}{{#if:{{{usercategory2|}}}|[[Category:{{{usercategory2}}}]]}}{{#if:{{{usercategory3|}}}|[[Category:{{{usercategory3}}}]]}}{{#if:{{{usercategory_raw|}}}|{{{usercategory_raw}}}}}
 |template = {{#if:{{{usercategory|}}}|[[Category:{{{usercategory}}}| {{BASEPAGENAME}}]]}}{{#if:{{{usercategory2|}}}|[[Category:{{{usercategory2}}}|  {{BASEPAGENAME}}]]}}{{#if:{{{usercategory3|}}}|[[Category:{{{usercategory3}}}| {{BASEPAGENAME}}]]}}{{#if:{{{usercategory_raw|}}}|{{{usercategory_raw}}}|}}

So that categories can be added as defined in the userbox. See Template:Userbox/sandbox (diff just in case) and purpose can be seen by editing Template:User alternative account name (edit | talk | history | links | watch | logs). Technical 13 (talk) 14:07, 17 May 2013 (UTC)

  Not done: Your code seems to not do what you intend, the name of your proposed parameter is poorly chosen, and your justification is lacking. Anomie 10:31, 18 May 2013 (UTC)
The purpose of my code is to add an argument that allows the userbox maker to define categorization using parserFunctions and easily use piped sorting. It would allow: {{#switch:{{{1}}}|orange=[[Category:Orange fruit|{{{1}}}]]|banana=[[Category:Yellow fruit|{{{1}}}|#default=[[Category:Red fruit|{{{1}}}]]}} to work as-well-as allow [[Category:Three]][[Category:Four]][[Category:Five]][[Category:Six]][[Category:Seven]][[Category:...]] to work and not limit people to three categories. If you have a better parameter name, that is fine. I only picked usercategoryx because it followed the same scheme for the prefix (usercategory) and indicated that the category number was a variable and that multiple could be used (x). I also chose that because it is shorter than the alternatives I came up with and shorter is easier to remember. Technical 13 (talk) 11:09, 18 May 2013 (UTC)
Personally, I'm still not convinced of the reasoning (why does a userbox need to be adding dozens of categories to a userpage?), and something like "usercategory raw" would be more descriptive. And I note that you haven't commented on the part where your proposed change does the wrong thing when {{userbox}} gets transcluded on a template page with one of the existing usercategory parameters set but not yours. Anomie 17:03, 19 May 2013 (UTC)
It it useful for more than just injecting multiple categories. It allows for parserFunctions to easily be used to select an appropriate category with defaultsort. As far as what would happen when {{userbox}} gets transcluded on a template page with one of the existing usercategory parameters set but not mine is that it doesn't apply any category at all for that parameter. Technical 13 (talk) 17:25, 19 May 2013 (UTC)
Looks fine to me with usercategory_raw now but I'll leave it for Anomie to reply. -- WOSlinker (talk) 19:18, 19 May 2013 (UTC)
@Technical 13:: You mean "it doesn't apply any category at all anymore", considering that you just fixed it.
@Anomie: Yes, that is exactly what I meant. Technical 13 (talk) 21:14, 19 May 2013 (UTC)
@WOSlinker:: Meh. I still don't see the point of a userbox applying dozens of categories, but if someone else wants to apply it I have no technical objection to the currently-posted code. Anomie 21:04, 19 May 2013 (UTC)

I can't see the point of this new parameter either. There seems to be little benefit over just manually adding a category. Technical 13, perhaps you could demonstrate a consensus for this change before reactivating this request? Regards — Martin (MSGJ · talk) 19:50, 21 May 2013 (UTC)

id-class request

Please add id-class parameter, analogous to info-class. ⇔ ChristTrekker 18:18, 23 May 2013 (UTC)

It's already there. -- WOSlinker (talk) 18:37, 23 May 2013 (UTC)
Guess I should look in the source. It's not mentioned in the doco. ⇔ ChristTrekker 18:57, 23 May 2013 (UTC)

Id images

When using an image in the id parameter, is it possible to make it smaller so the userbox has the correct height? George8211 (talk | contribs) 12:09, 22 August 2013 (UTC)

Edit request, 17 December 2013

I've made an edit in the sandbox (here) that should allow for an increased border size to automatically be allowed for in the userbox height (per CSS box model) — OwenBlacker (Talk) 15:45, 17 December 2013 (UTC)

  •   Not done for now: Owen, I'm going to have to request some testcases showing what your change does and that it doesn't break existing userboxes before I can apply this request. When I added the code to standardize the width, I also looked at standardizing the height, and decided that it wasn't feasible for all boxes. So, if you can show that it is in the sandbox/testcases page, I'd be happy to apply it. Thanks. Technical 13 (talk) 00:43, 18 December 2013 (UTC)


I've created a Lua version of this template at Module:Userbox. You can test it out using {{userbox/sandbox}}. I'd like to hear people's opinions of the code before putting it live. In particular, the module treats blank parameters differently from the template. The template's treatment of blank parameters led to some strange behaviour, like the border style being set to "border: px;" if either {{{border-width}}} or {{{border-s}}} were present but blank. I've demonstrated a few of these behaviours at Template:Userbox/testcases#Blank parameters, although that is not a complete list. It is possible that changing this behaviour may break some existing userboxes, although the number is probably quite small. Do people think it would be worth adding a tracking category so that we can identify them? — Mr. Stradivarius ♪ talk ♪ 07:59, 6 January 2014 (UTC)

Are you going to also support {{userbox-2}} and {{userbox-r}} ? -- WOSlinker (talk) 10:06, 6 January 2014 (UTC)
That's a good question! I wasn't even aware of them until now - I guess that goes to show I should read all the way to the bottom of the documentation before I start writing code. It doesn't look like it will be too hard to do, but I will need to add in another layer of abstraction so that the parameters don't interfere with each other. Let me have a think of how best to do it. — Mr. Stradivarius ♪ talk ♪ 10:37, 6 January 2014 (UTC)
Noting that empty parameters are easily fixed, what are the benefits of lua above template code in this case? Edokter (talk) — 11:27, 6 January 2014 (UTC)
I admit that I am guilty of looking at the number of parameters in the template code and just assuming that a Lua version would give us better performance. To see whether I was right, I just went and did some testing in my sandbox with 1000 userbox instances (current template, Lua version). I found a modest performance increase from the Lua module, which processed the userboxes in 9.659 seconds compared to the current template's 13.886 seconds.
Example NewPP limit reports
Current template
NewPP limit report
Parsed by mw1071
CPU time usage: 12.133 seconds
Real time usage: 12.308 seconds
Preprocessor visited node count: 100002/1000000
Preprocessor generated node count: 106937/1500000
Post‐expand include size: 753000/2048000 bytes
Template argument size: 50000/2048000 bytes
Highest expansion depth: 5/40
Expensive parser function count: 0/500

Served by mw1071 in 13.886 secs.
Lua version
NewPP limit report
Parsed by mw1175
CPU time usage: 8.257 seconds
Real time usage: 8.339 seconds
Preprocessor visited node count: 24001/1000000
Preprocessor generated node count: 112017/1500000
Post‐expand include size: 1084000/2048000 bytes
Template argument size: 0/2048000 bytes
Highest expansion depth: 2/40
Expensive parser function count: 0/500
Lua time usage: 2.830s
Lua memory usage: 1.15 MB
Lua Profile:
    Scribunto_LuaSandboxCallback::getExpandedArgument               2840 ms     77.2%
    recursiveClone <mw.lua:109>                                      300 ms      8.2%
    getExpandedArgument <mw.lua:261>                                 100 ms      2.7%
    format                                                            60 ms      1.6%
    <Module:Arguments:132>                                            60 ms      1.6%
    type                                                              60 ms      1.6%
    concat                                                            40 ms      1.1%
    insert                                                            40 ms      1.1%
    tostring                                                          40 ms      1.1%
    Scribunto_LuaSandboxCallback::frameExists                         20 ms      0.5%
    [others]                                                         120 ms      3.3%

Served by mw1175 in 9.659 secs.
That is less of a difference than I thought it would be, though, and probably won't be noticed on pages with less than, say, 100 userboxes. We do also get the benefits of shared code between this template, {{userbox-2}} and {{userbox-r}}, which will be available after I finish writing their respective functions. (I've already added in the abstraction layer to make it possible.) Other than that, there isn't much - I would add ease of maintenance to that list, but I gather not everyone agrees with me on that. :) — Mr. Stradivarius ♪ talk ♪ 13:47, 6 January 2014 (UTC)
To give some more reliable stats, I did an average over five page parses for both of my example pages. For the current template I got:
  • CPU time usage: 12.955s
  • Real time usage: 13.080s
  • Served in: 13.320s
And for the Lua version, I got:
  • CPU time usage: 7.205s
  • Real time usage: 7.295s
  • Served in: 8.486s
I make that an average 43% increase in speed. — Mr. Stradivarius ♪ talk ♪ 14:31, 6 January 2014 (UTC)
That's fair. Just asking because I have seen instances of two-line templates being converted to multi-page lua modules. They were generally not a succes. Edokter (talk) — 18:05, 6 January 2014 (UTC)


How come there doesn't show up any category for the userbox when I save it, even if I have set a parameter for usercategory? The userbox User:UBX/SAIK does not show up in the usercategory Category:Wikipedian Sandvikens AIK fans. Bandy boy (talk) 17:33, 19 March 2014 (UTC)

That's because Template:Category handler purposefully doesn't categorise subpages of User:UBX. The category will work just fine if you use your userbox on other pages. — Mr. Stradivarius ♪ talk ♪ 22:00, 19 March 2014 (UTC)
Thank you, that explains it. Bandy boy (talk) 00:19, 20 March 2014 (UTC)

Should usercategory values be applied to templates?

Was there a change in the way the usercategory params work? I was under the impression that categories specified in those params would only be applied to the user page where the template was ultimately transcluded, since the categories are often named "Wikipedians who...". Based on the name alone, these should include the user pages only, and not the userbox template(s), but it doesn't seem to work this way.

For example, {{User WP Foodie}} has |usercategory=WikiProject Food and drink members and then after the {{Userbox}} transclusion, wrapped in noinclude tags, there is:

[[Category:WikiProject Food and drink templates|{{PAGENAME}}]]
[[Category:WikiProject user templates|Food and drink]]
[[Category:Food u0ser templates|WP Food and drink]]
[[Category:Drink user templates|WP Food and drink]]

This makes sense to me. The template itself should show up in the *templates categories and the users (user pages) that transclude it should show up at Category:WikiProject Food and drink members. Currently, it doesn't work that way, though. The template also appears in Category:WikiProject Food and drink members, even though it's not a "member".

Did it always work the way it does now? It seems you can get around it by wrapping |usercategory=WikiProject Food and drink members in includeonly tags, keeping the category from applying to the template page. —[AlanM1(talk)]— 23:36, 12 July 2014 (UTC)

@AlanM1: Yes, it appears that it did always work this way. If you look at the last version of the template before it was converted to Lua, the user categories are explicitly output in the template namespace by {{category handler}}. I imagine that there was probably a reason for doing it this way, but I'd have to do some more digging to find out exactly what.
Ok, found it. Categorisation of the template namespace was added in this edit, from the request here by WOSlinker. WOSlinker never gave a reason as such, though. (WOSlinker, perhaps you still remember?) — Mr. Stradivarius ♪ talk ♪ 03:01, 13 July 2014 (UTC)
At the time a lot of the userboxes used to have:
<includeonly>[[Category:User who do something|{{PAGENAME}}]]</includeonly>
<noinclude>[[Category:User who do something|*]]</noinclude>
So adding both the categorisation on user pages and templates meant that the code as above could be replaced with a single parameter passed to the userbox template. -- WOSlinker (talk) 05:28, 13 July 2014 (UTC)
Just to add, here's a couple of examples: User Yabasic and User WikiProject South America. Not all userboxes added the template category though and the change to the userbox template, did make more userboxes add themselves to the user categories. If it's felt that it would be better to not inclufde the userboxes in the categories then I wounldn't object. -- WOSlinker (talk) 05:38, 13 July 2014 (UTC)
Thanks for running that down. When I saw some examples like those, I, too, thought that it might have worked differently in the past because some implementers put the same category in both places.
Just to clarify, though, my suggested criterion is to not apply the usercategory* categories on template pages, regardless of which namespace they are in. This came up because I had my own custom userbox templates (that transclude {{Userbox}}) under my userspace (e.g. User:AlanM1/Template/User OSM), usually to make a custom change that I didn't want to force on others. I see the note above that the categories are not applied to pages under User:UBX – perhaps add similar exceptions for pages in the Template namespace and any under User:*/Template*
Alternatively, if this behavior is to remain, I'd like to document it, along with the suggestion that if the implementer of a template that transcludes {{Userbox}} wants to prevent their template from being in the usercategory* categories, they need to wrap those parameters in includeonly tags (and give an example). —[AlanM1(talk)]— 08:35, 13 July 2014 (UTC)
Another suggestion might be to only categorise if the userbox is on the users homepage, and not on any subpages at all. -- WOSlinker (talk) 11:48, 13 July 2014 (UTC)
That's not going to work: see for example User:Mr. Stradivarius/Userboxes. — Mr. Stradivarius ♪ talk ♪ 15:38, 13 July 2014 (UTC)
It wouldn't make so much sense to blacklist User:*/Template*, because different users use different naming schemes. I put my userboxes in User:Mr. Stradivarius/UBX/*, for example. Others just put them on immediate subpages. — Mr. Stradivarius ♪ talk ♪ 15:42, 13 July 2014 (UTC)
I just came here to ask about the same issue; can we reach a resolution? I'd prefer that the category not to be added to template pages. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 13:52, 13 November 2014 (UTC)

User sub-pages

[The above] discussion appears to be related to a problem I just noticed with a MediaWiki message delivery. A message was sent to Category:WikiProject Medicine members, but that category has several editors with their user page and a subpage in the category—for example, both User:Benlisquare and User:Benlisquare/Userboxes, and the messaging system sent the newsletter to the talk page of both pages. The category comes from {{User WPMed}} on the Userboxes subpage which is transcluded on the user page. As I've never thought about issues like this, I can't offer a suggestion, but IMHO a userbox should add the category only to the user page, and not to any subpage, without requiring any extra input from the user. If a category is sometimes wanted elsewhere, there should be an "opt in" parameter to specify that the category is wanted. Johnuniq (talk) 06:36, 17 July 2014 (UTC)

The problem with that idea is that we already have a lot of userboxes that have intentionally been put on subpages, and the users that put them there most likely want them to be added to the relevant categories. Rather than having to edit (tens of?) thousands of userbox pages, it would probably be better to just put the categories inside <noinclude>...</noinclude> tags on the userbox template pages. As for the MediaWiki message delivery, it shouldn't be too hard to filter out duplicate users from a category list. Perhaps there's already an option for this? — Mr. Stradivarius ♪ talk ♪ 06:44, 17 July 2014 (UTC)
Possibly, but is there an example where someone would want a userbox to add a category to a subpage? Johnuniq (talk) 06:52, 17 July 2014 (UTC)
Well, there are quite a few at User:Mr. Stradivarius/Userboxes for a start. :) All of those would be unwieldy on my main user page, so I don't want to keep them there. I also found User:Captain Assassin!/Userboxes, User:Visium/Userboxes and User:CRRaysHead90/Userboxes after a few minutes' search, and that's not including users who are inactive. I get 58,985 results for the search "/userboxes" in userspace, and a fair percentage of those are likely to be pages that were intended to be categorised. — Mr. Stradivarius ♪ talk ♪ 07:05, 17 July 2014 (UTC)
Oh, I had not noticed that kind of usage before. To spell it out, you have some userboxes on your user page, but your user page does not transclude your userboxes page. Instead, your talk page has a link to the userboxes subpage which is intended as a target page for people to view. The userboxes subpage has a bunch of categories which are intended for that page. Well I guess a new parameter is needed. If it were added to a userbox call (and if the userbox template were edited to pass that parameter to the module), the category would not be added to a subpage (details to be decided!). Then people could add the magic parameter when they discover a problem, such as with message delivery as I mentioned above. I don't see how using includeonly would offer a solution. Johnuniq (talk) 10:07, 17 July 2014 (UTC)

Detection of existence of user categories

I've been working on red-linked categories and come across a number which are populated by templates like {{User cu-N}} that wants to live in Category:User cu-N. Except that category has been deleted three times because it's meaningless to have a current native speaker of a long-dead language. Would it be possible for the noinclude code (in {{user lang}} at least) to test for the existence of a user category before placing the template in it? It would relieve some tension between those who hate to see red-linked categories left unmade, and those who nuke template-only categories on sight.... <g> Le Deluge (talk) 04:10, 22 March 2016 (UTC)

"Sandbox reminder" section

In this section, the "FROM" and "TO" URIs are exactly the same, so that can't be right. Also, it would be easier to compare them if they were aligned. —Ringbang (talk) 00:56, 24 April 2016 (UTC)

If a relatively new wiki is born and I`m the first to create a user box, do I need to do something extra?

I used to create user boxes in other wikis but here its a first: http://rimworldwiki.com/wiki/User:Yoshida_Keiji/Userboxes/Civilization Yoshida Keiji (talk) 09:18, 1 May 2017 (UTC)

Return to "Userbox/Archive 1" page.