Template:Userboxtop is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases.
This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects:
Template:Userboxtop is part of WikiProject Userboxes. This means that the WikiProject has identified it as part of the userboxes system. WikiProject Userboxes itself is an attempt to improve, grow, and standardize Wikipedia's articles and templates related to the userbox system, used on many users' pages. We need all your help, so join in today!UserboxesWikipedia:WikiProject UserboxesTemplate:WikiProject UserboxesUserboxes
CSS problem with floating
There is a problem with the CSS of the userboxes. If I have some userboxes on my page, they don't stay one under the other, but they have the typical css floating behaviour of staying on the side opposite of the allignement. What I say is that they aligne orizzontally, not vertically. Try it. The solution is to put a clear: attribute in the css of the box. See my User page for more info. - (Posted by User:Giandrea)
Missing parameter info
The "Usage" section should describe what the parameters can be. I have no idea what the valid alignments are for "align=", for instance... left, right, center, none? What are the defaults if you don't have a parameter, and what are the other defaults if you have a parameter but leave it blank after the equal sign? --Tifego00:23, 12 March 2006 (UTC)[reply]
Problems in XHTML validation (for multiple userboxes)
There's a problem where using multiple userboxes may cause the page to no longer a valid XHTML when validating by the W3C XHTML Validator. The reason is the table's id property "id=userboxes" is being redefined for each additional userboxes, and this is not allowed under XHTML 1.0 Specifications.
Perhaps removing that id property altogether would help?
I think the id should be made a class instead. In the XHTML spec, an id can only appear once, but a class can appear any number of times. However, making the change would require everyone taking advantage of custom CSS to hide userboxes to update their CSS. --Tim198818:09, 10 June 2006 (UTC)[reply]
So the obvious solution is the addition of the class attribute, broadcast an advance notification of the removal of the id attribute (say 3 months notice); removal of the id attribute at the time specified. Cain Mosni12:47, 11 September 2006 (UTC)[reply]
Userbox - Userboxes?
I changed the title at the top of the template from "Userbox" to "Userboxes". The way I see it, most users will be using this to "package" more than one userbox, so the plural is needed.
The last time I made this change, I was inexplicably reverted by User:Brendenhull. I see from his talk page however that this is not the first time he has reverted legitimate edits without explanation, and I see no reason why this shouldn't have a plural. Anyone agree? --Tim198818:05, 10 June 2006 (UTC)[reply]
P.S. I suppose there could be a way to programmatically have "Userbox" or "Userboxes" depending on how many userboxes there are.
Userboxbreak
Is there any way to give Userboxbreak the same parameters to set as Userboxtop? There are groups of templates that I would like to differentiate by color, and since using Userboxtop isn't an option, as one box slides right under another in IE (though they look fine in FireFox), Userboxbreak needs to be more customizable. I am still leaning how to make templates by practicing on userboxes, so I may be out of my depth on this one. - LA @ 12:09, 12 August 2006 (UTC)[reply]
Top text
After some of the recent changes to this template, having no text at the top (to replace "Userboxes") doesn't seem to work anymore. When I use the parameter toptext= (with nothing after the equal sign), an apostrophe shows up at the top. When I use toptext="", "" shows up, and when I use just toptext, toptext shows up at the top. Can't think of any other ways to do it, and I don't understand the way all the code works, so can anyone help me? Thanks! --Galaxiaad04:12, 11 September 2006 (UTC)[reply]
I've fixed it. The problem started when the toptext parameter was bolded with wiki markup. When the toptext parameter was blank, the three apostrophes from each side came together, forming <big>''''''</big>. The apostrophes are interpreted as (correct me if I'm wrong) bold, italics, then one apostrophe of text. I switched the bold and the big tags, so now when toptext is blank, the code reads '''<big></big>''' and renders correctly. You may need to purge the cache or make a null edit before it displays correctly. Pagrashtak15:26, 11 September 2006 (UTC)[reply]
It's nice that the box allows the user to select alignments, but it was clearly originally designed with right alignment in mind, and the margins are fixed at zero, except for the left, which looks all cock-eyed, when the box is left aligned. Whilst it is on my list of things to do when the case of circular tuits arrives I don't yet know template syntax, but I know what needs to be implemented:
If the alignment is not "left" there needs to be a style element of "margin-left: 1em"
If the alignment is not "right" there needs to be a style element of "margin-right: 1em"
Sorry if this sounds like I'm talking down to everyone, but I'd like to remind all editors that this template is widely used. A recent good-faith edit caused numerous problems around various users' pages; when I first noticed it, I thought it was related to a new userbox that I was adding. Then I ran across it on several other editor's pages. When I saw it screw up a page on my userpage that I hadn't modified in a while, I realized where the problem might lie.
Please, if you make any changes (even seemingly innocuous ones, like removing the center tag), use the "What links here" tag and check out a wide sampling of pages to ensure that you didn't accidently break a page. EVula15:15, 12 September 2006 (UTC)[reply]
I think somebody changed something in the template text so that text now wraps on the side of the box, whereas before it stayed beneath it. This is now a problem on my user page, in the section Edit History. Not sure how to fix it now, though… --Fbv65edel / ☑t / ☛c || 01:41, 14 September 2006 (UTC)[reply]
When did you first notice the problem? I just switched the "align" tag to a CSS float declaration, but it didn't change anything on your page (I also tried wrapping the list on your page with a div tag with a left margin, but that didn't help, either). EVula02:30, 14 September 2006 (UTC)[reply]
Could the margin-left be reduced when the box is a child of another user box?
Hmm... not sure about the best way to approach this. I'm kind've actually thinking that you might be able to make this happen with the current paramaters available -- see this example (permalink), which I'm guessing isn't quite what you're looking for, but it seems to be a step in the right direction. Luna Santin03:33, 29 January 2007 (UTC)[reply]
Better. (It helps that someone with better CSS skills than myself got involved. :D) Babel doesn't recognize the extra-css parameter. However, I have since been thinking about making my user box container collapsible with something like the class navframe. Can extra-css do that too? The outer container would be expanded by default with the inner ones collapsed. Will (Talk - contribs) 06:59, 29 January 2007 (UTC)[reply]
Hm... might be in over my head, here; haven't done too much with NavFrame, but I suspect that if you're planning to use it, it'll be easier to set it up yourself (instead of using a template) (in part, most of the templates invovled here weren't built with it in mind). Did some fiddling around, things aren't quite working -- permalink, I suspect there's some elaborate conflict between the CSS used in userboxes and the CSS/JS used in NavFrame. In the meantime, you may be able to get some use out of {{userboxbreak}}. Luna Santin09:12, 29 January 2007 (UTC)[reply]
The id="userboxes" code should be removed or the CSS id should be made configurable (defaulting to "userboxes"). This will allow a page with more than one of these boxes (or a {{Babel}} box) to validate. It may be worthwhile to make it a CSS class instead, as suggested above. The only repercussions I can see would be if there are users using the id to do styling in their personal CSS. This seems unlikely since they would be the only ones to see it, but I guess it could be used to suppress userboxes or something.
Also, the "name" attribute on the table doesn't really serve any purpose (and it's also not a valid attribute for the table tag). Mike Dillon03:31, 23 March 2007 (UTC)[reply]
It seems to have been added in this edit. The edit summary was "trying something". There are no references to "#userboxes" in any of the site-wide CSS. If it is removed, it will only have an effect on individual users who have used the id as a selector in CSS rules to either style or hide the userbox container. I went through the first 15 pages of this search and didn't see any references to the id in any user CSS files, so there will likely be no effect (except making it possible for the pages using multiple boxes to validate). Mike Dillon05:32, 23 March 2007 (UTC)[reply]
Thanks for the info. I want to wait for a couple days to give others a chance to comment. If nobody can name a reason why the id needs to stay then I'll remove it. I just want to be cautious. CMummert · talk05:55, 23 March 2007 (UTC)[reply]
I'm no CSS wizard by any stretch of the imagination, but from what I know the argument in favor of the change is sound, and I haven't figured any problems that would result (worst that happens is a few user CSS subpages need updating, and I haven't seen references to this, either). – Luna Santin (talk)22:01, 23 March 2007 (UTC)[reply]
The intent was to allow users to hide userboxes entirely by editing their user-specific CSS. I have no idea if it's actually in use or not, but I am annoyed that anyone would think this was a problem: the problem only occurs if people use this template incorrectly (that is, use it more than once on a page). The "proper" way to break apart userboxes would be to use {{userboxbreak}}. Having said that, using a CSS class would work as well, but would break the userbox hiding functionality for those that may be using it.
If such a change is made, please be certain to update the docs to reflect the change as well. As an aside, what is the significance of userspace pages being XHTML compliant? I could see the problem here if this were something used in article space, but this seems like nit-picking. :P —Locke Cole • t • c08:37, 24 March 2007 (UTC)[reply]
I guess there is no compelling reason for pages to be XHTML compliant. The one reason I can think of is that being able to validate the page is one method that can be used to ensure that the page will work right in multiple browsers.
I'm familiar with {{userboxbreak}} and I'm using it, but there are some people who put the userboxes into their own sections, in which case they need more than one container. A more significant issue is that {{Babel}} and {{Babel-N}} also use it, so pages that use both {{Userboxtop}} and a Babel template will have duplicate "userboxes" ids.
I guess I'll do a more exhaustive search for people that are actually using the functionality in their personal CSS before recommending that we change it to class="userboxes". Mike Dillon15:27, 24 March 2007 (UTC)[reply]
Removal without any other method of hiding userboxes is, to me, unacceptable. The class idea would be a reasonable compromise, however, those that are using the ID should be informed before the change. The "name" attribute was added as basically a copy-paste from some other CSS used in another template. At the time, I was more interested in making it possible to hide userboxes rather than making everything CSS/XHTML compliant (this was, I believe, right around the time userboxes were being deleted out of process). I simply assumed the "name" attribute may have been a compatibility inclusion for some broken/older browser that didn't support the "id" attribute. If there is no compatibility reason to include it, I would favor it's removal. —Locke Cole • t • c08:37, 24 March 2007 (UTC)[reply]
I set the page size on the search for "userboxes" in the user namespace to 1000 and went through all 9 pages of the search. The only user CSS file that showed up was User:Beetstra/userboxes.css, which doesn't refer to the selector. It should be safe to change this to use class="userboxes".
Thinking about this a little more, another side effect of having duplicate ids besides the lack of validation is that it isn't possible to write straightforward JavaScript that can toggle the display of userboxes (if anyone wanted to do that). Mike Dillon16:00, 24 March 2007 (UTC)[reply]
It was broken in this revision. A change was made from the deprecated "align" attribute to using a CSS float property, but float doesn't support "center", just "left", "right", and "none". The pure CSS way to center is using "auto" for the left and right margins. As a workaround, you can do extra-css=margin: 0 auto 0.5em auto. The bottom margin is 0.5em because that's what this template currently uses. Mike Dillon23:19, 11 April 2007 (UTC)[reply]
I just want to let you guys know that rendering under Firefox and Opera (Internet suite) does not work well with these set of templates as it partially covers the first box and other topmost boxes userboxes when using the hide/show feature. It seems the work for a solution on this problem has been neglected for sometime... like months. The template works fine under Internet Explorer. I really want to use this template but I cannot because of this. Getonyourfeet11:29, 4 April 2007 (UTC)[reply]
Nevermind I found a workaround and it is better... just instead of adding multiple 'div class="NavContent"' sections inside a single "Userboxtop Userboxbottom pair" resulting in multiple hide sections under one single "Userboxtop Userboxbottom pair"... the solution was just to create many multiple "Userboxtop Userboxbottom pairs" for each groupings of selected content... instead of many 'class="NavContent"' groups from the previous idea. One cool side feature I like is that you can also hide a Userboxtop Userboxbottom pair(s) within another one Userboxtop Userboxbottom pair... Really useful if you want to hide huge volumes of content. Getonyourfeet14:01, 6 April 2007 (UTC)[reply]
It needs to default to 0, not 1, to preserve the current behavior. Alternatively, you can just use extra-css=margin-right: 1em to get that effect. Mike Dillon00:03, 7 April 2007 (UTC)[reply]
In the interest of avoiding creeping featurism, I don't think this change is needed. There is a workaround that doesn't require a change to this template, and in most cases you could just write your own code instead of using this template. CMummert · talk01:45, 7 April 2007 (UTC)[reply]
Yes, the id was recently removed per the section XHTML validation redux above. You should be able to use the CSS class instead. CMummert · talk17:59, 19 April 2007 (UTC)[reply]
NNot done There's no point in changing a heavily used template just to bypass a redirect; it would create work for the servers for no good reason. --ais523 19:19, 20 February 2008 (UTC)
Fair enough... I'll have to keep that in mind in the future (and just surreptitiously update such redirects in tandem with other edits ;) ). —Dinoguy100019:04, 21 February 2008 (UTC)[reply]
Unbold header
Can an admin please modify font-weight: bold to be normal—I have a use for it where I don't want the header in bold, and if someone wants it in bold they can choose to do so when using the template. Thanks. --Eustress (talk) 04:48, 23 January 2009 (UTC)[reply]
Probably not... by now, this template has thousands of uses across Wikipedia that rely on the bolding, so just removing it would result in a lot of breakage. A switch allowing you to disable the bolding would be simple enough to add, though (something along the lines of {{#ifeq:{{{nobold|}}}|yes|<!-- no bolding -->|font-weight: bold;}}). 「ダイノガイ千?!」(Dinoguy1000)18:33, 23 January 2009 (UTC)[reply]
edit link for use in templates.
Could there be a named parameter introduced called edit to this template that, when used, will enable to display an [edit] link to the value of the parameter?
Example, which would be rendered as shown on right:
{{Userboxtop|toptext=Title|edit=Pagename of template eg: Wikipedia:Sandbox}}
{{User toomuchtime}}
{{User prog-N}}
{{Userboxbottom}}
This could benefit a lot of users, so they can make their userbox collection into a template, with collapsible categories(see mine), and transclude it where-ever they want, and have easy access to editing the template page itself.
Ofcourse it would be nice if you could also make the external-link icon disappear.
Template-protected edit request on 20 February 2020
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.
There is an extra semicolon at line 1: style="margin-left: {{{left|1}}}em;; that probably does not affect anything - still sending an edit request so it is recognized. --ネイ (talk) 05:32, 20 February 2020 (UTC)[reply]
This was raised once back in 2007 but I really think it'd be helpful to have this feature. I'd like to use it for my own userboxes and I don't know how to make one using the extra-css, and I really don't know how templates work but is this possible? Skarmory(talk •contribs)05:21, 9 February 2021 (UTC)[reply]
It does not appear possible with the current code. The way that |left= is implemented appears to prevent it. A workaround is to replace {{Userboxtop}} on your user page with a modified version of the basic output of this template:
I like your work. I added a few more testcases, just to test for more valid and invalid cases. It looks pretty good to me, but I do worry that with 56K transclusions, and the lack of scrutiny of User pages, there are going to be some really screwed up edge cases out there that are just barely working now and that get broken by this change. Maybe we implement it and then do a random sample of a few hundred pages to see if anything looks bad. – Jonesey95 (talk) 18:13, 9 August 2023 (UTC)[reply]
Thank you, it is based on your work. I added float=none on the test cases page. That one might be trouble. We can try this, and then do the sample and the usual, "they holler, we fix" thing. Interesting that "align=middle" also now works to center. P.I. Ellsworth , ed.put'er there18:35, 9 August 2023 (UTC)[reply]
|float=none is not relevant to this template; |float= is not a valid parameter, so if it is used, it is ignored and the default right alignment is applied. |align=middle is also you fooling yourself: it is invalid, analogous to |align=foobar, so it is ignored and margin:auto determines the placement. Let's try to roll it out and see if anyone screams. If they do, we copy the weird edge case to the testcases page and continue working on it. – Jonesey95 (talk) 19:30, 9 August 2023 (UTC)[reply]
I checked 50 pages and saw no problems. I don't know how they looked before, but none of them looked terribly broken, and some with complex layouts looked just fine. And, for future readers, what I should have said above is that |align=middle replaces the default value of "right" with "middle", but "float:middle" is not valid, so the "float:" style instruction is ignored, and margin:auto determines the positioning of the table (i.e. centered). – Jonesey95 (talk) 01:42, 10 August 2023 (UTC)[reply]