Template talk:Userbox

From Wikipedia, the free encyclopedia

Protected Template:Userbox has been protected indefinitely. Use {{editprotected}} on this page to request an edit.

Contents

[edit] Documentation

[edit] Purpose

{{Userbox}} — make an userbox, for information about a user on their user page


[edit] Usage

{{subst:Userbox
  |id       = id text or image
  |id-c     = id background color
  |id-fc    = id font color
  |id-s     = id text size
  |id-p     = id cell padding space
  |id-lh    = id line height 
  |id-op    = id other parameter (CSS)
  |info     = info text
  |info-c   = info background color
  |info-fc  = info font color
  |info-s   = info text size
  |info-p   = info padding (distance between cell contents & cell border)
  |info-lh  = info line height (or distance in between text lines)
  |info-op  = info other (CSS) parameter(s)
  |border-c = box color
  |border-s = border width in pixels
}}
  • If border-c is not specified, id-c will be used
  • All parameters are optional

Deprecated Old syntax, for compability.

{{subst:Userbox
|color 1
|color 2
|id
|info
|id size
}}


[edit] Example

Code Result
{{subst:userbox}}
id info
 {{subst:userbox
  |id=foo
  |id-s=20
  |id-c=#ffffee
  |info=''foo bar''
  |info-c=#ffeeff
  |info-s=12
  |border-c=#aaffaa
  |border-s=2
}} 
foo foo bar
Below example showing the default appearance of a userbox. Which is (much) higher than the 45px. Compare the height of the below one with the above userbox.
 {{subst:userbox
  |id=foo logo
  |id-c=#ffffee
  |info=''We are trying to see 
default distance in between text 
lines, and, see the distance in 
between cell content and its border 
and also see total height.''
  |info-c=#ffeeff
  |border-c=#aaffaa
  |border-s=2
}} 
foo logo We are trying to see default distance in between text lines, and, see the distance in between cell content and its border and also see total height.
Below example showing, how we can change that userbox and specify further parameters to bring down the overall height of the userbox, to the recommended height of 45px, even with four text lines. Cell padding parameter "info-p" can also be set at "1pt 1pt 1pt 2pt" or, "1pt 2pt" for better appearance, when there are 4 text lines.
 {{subst:userbox
  |id=foo logo
  |id-s=14
  |id-c=#ffffee
  |id-lh=1.1em
  |info=''We have specified values 
to lessen the distance in between 
text lines & padding space in between 
cell content and its border.''
  |info-c=#ffeeff
  |info-s=8
  |info-p=1pt
  |info-lh=1.05em
  |border-c=#aaffaa
  |border-s=1
}} 
foo logo We have specified values to lessen the distance in between text lines & padding space in between cell content and its border.
Below example is for advanced users, showing, how we can specify other CSS properties, for example, "font-family", to change the font, which are not existing inside the template already. At below, right side shows two userboxes, top one is displayed without the "font-family" parameter, but the bottom userbox is displayed by using the below codes, with the help of "info-op" parameter.
 {{subst:userbox
  |id=foo logo
  |id-s=14
  |id-c=#ffe
  |id-lh=1.1em
  |info=foo bar
  |info-c=#fef
  |info-s=14
  |info-op=font-family:'Courier New';
  |border-c=#afa
  |border-s=2
}} 
foo logo foo bar

 
foo logo foo bar


[edit] See also


[edit] History

Created 
AzaToth 01:15, 7 December 2005 (UTC)

[edit] Colours

[edit] Discussion

[edit] Parameters

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)

[edit] 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] 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)

[edit] 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:

{{subst:Userbox
  |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:

{{Userbox
  | 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'.
{{Userbox
  | 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).

[edit] 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).

[edit] Recategorization

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)

[edit] 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)

[edit] 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)

[edit] Usage

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)

[edit] 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)

[edit] UNprotection

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)

[edit] 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)

[edit] 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)

[edit] 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. --12.207.48.223 10:37, 13 March 2007 (UTC)

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

[edit] Link colours?

{{editprotected}}

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>]]
id 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)