User:Willscrlt/UBX/Userbox-2/doc


PurposeEdit

{{User:Willscrlt/UBX/Userbox-2/doc}} — makes a userbox for users to provide information about themselves on their user page. This version has two ID boxes, one on each side of the main Info area.

This template was forked from the Userbox template on the English Wikipedia, which has different usage examples and has changed since. Additionally, this template has been enhanced to be more compatible and functional across multiple wikis. Most userboxes developed for one wiki should continue to work as-is (or with just a few tweaks) on other wikis if this template is used.

One big difference is that this template uses parser functions to combine three templates (Userbox, Userbox-r, and Userbox-2) into a single template. It does this by adding one additional attribute: layout=. The possible values are 'l' (the default) for a userbox with the smaller ID box (usually for logos) on the left (standard Userbox layout), 'r' for the reverse (Userbox-r layout), and '2' for a userbox an ID box on both ends (Userbox-2 layout). If this doesn't make sense, don't worry about it. I've created my own versions of each of these templates, so you can just use them and ignore the layout= attribute if you prefer.

This is version 2.1.0 (Userbox-2) of my custom template. The most current version is available from my English Wikipedia account.

UsageEdit

Compact formEdit

For simple userboxes, the compact form is simple, fast, and easy to understand. The numerical labels shown below ('1=', '2=', etc.) are optional unless your data includes any equal signs ('='). If you do not use labels, you must enter the values in the proper order. All attributes are optional, but you may not skip any attributes prior to the one you want to specify. It is the order of the attributes that is important when omitting labels, and skipping attributes messes up the order and breaks the template. To avoid all those limitations, simply include the numerical labels or the extended labels from the Extended form below.

This form is convenient, but considered deprecated on many Wiki projects. The standard Userbox template here may not support this form in the future, and the order of the attributes may change.

{{User:Willscrlt/UBX/Userbox-2/doc
|1= id1 background color (defaults to '#DDD', a light gray)
|2= info background color (defaults to '#EEE', a lighter gray)
|3= id1 text or image (defaults to 'id1')
|4= info text (defaults to 'info')
|5= id2 text or image (defaults to 'id2')
|6= border color (defaults to id1 bg color if set or '#999', med gray)
|7= id2 background color (defaults to id1 bg color)
}}

Extended formEdit

Using the extended form gives you much more control, but you must spell and capitalize the labels exactly as shown. All attributes are optional and may appear in any order. You may mix numerical and extended labels, but extended labels take precedence over numerical ones.

This form uses the labels found on many Wiki projects. The default values may be significantly different from project to project, and not all projects offer all of these attributes.

{{User:Willscrlt/UBX/Userbox-2/doc
|id1      = id1 (left side box) text or image (defaults to {{3}})
|id1-c    = id1 background color (defaults to {{1}})
|id1-fc   = id1 font color (defaults to '#000', black)
|id1-a    = 'center' (default), 'left', or 'right' alignment
|id1-va   = 'middle' (default), 'top' or 'bottom' vertical alignment
|id1-s    = id1 text size (defaults to '14', 14pts)
|id1-p    = id1 cell padding space (defaults to '1pt')
|id1-lh   = id1 line height (defaults to '1.25em')
|id1-w    = id1 box width (defaults to '45', 45px)
|id1-h    = id1 box height (defaults to '45', 45px)
|id1-op   = id1 other parameter (CSS) (unused by default)
|info     = info (main box) text (defaults to {{4}})
|info-c   = info background color (defaults to {{2}})
|info-fc  = info font color (defaults to '#000', black)
|info-a   = 'left' (default), 'center', or 'right' alignment
|info-va  = 'middle' (default), 'top' or 'bottom' vertical alignment
|info-s   = info text size (defaults to '8', 8pts)
|info-p   = info cell padding space (defaults to '4pt')
|info-lh  = info line height (defaults to '1.25em')
|info-op  = info other (CSS) parameter(s) (unused by default)
|id2      = id2 (right side box) text or image (defaults to {{5}})
|id2-c    = id2 background color (defaults to same as for id1)
|id2-fc   = id2 font color (defaults to same as for id1)
|id2-a    = 'center' (default), 'left', or 'right' alignment
|id2-va   = 'middle' (default), 'top' or 'bottom' vertical alignment
|id2-s    = id2 text size (defaults to same as for id1)
|id2-p    = id2 cell padding space (defaults to same as for id1)
|id2-lh   = id2 line height (defaults to same as for id1)
|id2-w    = id2 box width (defaults to same as for id1)
|id2-h    = id2 box height (defaults to same as for id1)
|id2-op   = id2 other parameter (CSS) (defaults to same as for id1)
|border-c = border color (defaults to {{6}})
|border-s = border width in pixels (defaults to '1', 1px)
|float    = 'left' (default) or 'right' alignment
}}

NotesEdit

  • Pipes ("|") characters probably will break the template. You may be able to use the {{!}} template or a related template in place of the pipe.

Related templatesEdit

My versions of the templates available here at the English Wikimedia Commons
Local versions (if any) of the templates available here at the English Wikimedia Commons
Original versions available on the English Wikipedia which include more examples
Last modified on 17 December 2008, at 15:09