Template:Userbox: Difference between revisions
From PWI Wiki
Jump to navigationJump to search
PWpedia>Sangodoc Created Userbox template |
PWpedia>Sangodoc Updated colors to match new style |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<div style="float:{{{float|left}}}; border:{{{border-width|{{{border-s|1}}}}}}px solid {{{border-color|{{{1|{{{border-c|{{{id-c|# | <div style="float:{{{float|left}}}; border:{{{border-width|{{{border-s|1}}}}}}px solid {{{border-color|{{{1|{{{border-c|{{{id-c|#6A5D44}}}}}}}}}}}}; margin:1px;" class="wikipediauserbox"> | ||
{| cellspacing="0" style="width:238px; background:{{{info-background|{{{2|{{{info-c|# | {| cellspacing="0" style="width:238px; background:{{{info-background|{{{2|{{{info-c|#171513}}}}}}}}};" | ||
{{#if:{{{logo|{{{3|{{{id|id}}}}}}}}}| | {{#if:{{{logo|{{{3|{{{id|id}}}}}}}}}| | ||
! style="width:{{{logo-width|{{{id-w|45}}}}}}px; height:{{{logo-height|{{{id-h|45}}}}}}px; background:{{{logo-background|{{{1|{{{id-c|# | ! style="width:{{{logo-width|{{{id-w|45}}}}}}px; height:{{{logo-height|{{{id-h|45}}}}}}px; background:{{{logo-background|{{{1|{{{id-c|#332f2b}}}}}}}}}; text-align:{{{id-a|center}}}; font-size:{{{logo-size|{{{5|{{{id-s|14}}}}}}}}}pt; color:{{{logo-color|{{{id-fc|#ffcd72}}}}}}; 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|}}}}}}" {{!}} {{{logo|{{{3|{{{id|id}}}}}}}}} | ||
}} | }} | ||
| style="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|# | | style="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|#b2b2b2}}}}}}; vertical-align: middle; {{{info-other-param|{{{info-op|}}}}}}" | {{{info|{{{4|''info''}}}}}} | ||
|}</div><noinclude><br> | |}</div><noinclude><br clear=both> | ||
---- | |||
== Documentation == | == Documentation == | ||
This template can be used to quickly create a userbox for display on a user's user page without having to know HTML or Wikitable syntax. | This template can be used to quickly create a userbox for display on a user's user page without having to know HTML or Wikitable syntax. | ||
| Line 15: | Line 15: | ||
<!-- Abstract usage of the template, one variable per row. --> | <!-- Abstract usage of the template, one variable per row. --> | ||
<pre style="overflow: auto"> | <pre style="overflow: auto"> | ||
{{ | {{Userbox | ||
| float = <!--left|right|none (default = left)--> | | float = <!--left|right|none (default = left)--> | ||
| border-c = <!--border color (default = # | | border-c = <!--border color (default = #6a5d44)--> | ||
| border-s = <!--border width in pixels (default = 1)--> | | border-s = <!--border width in pixels (default = 1)--> | ||
| id = <!--id image and/or text--> | | id = <!--id image and/or text--> | ||
| id-a = <!--id horizontal alignment left/center/right/justify (default = center)--> | | id-a = <!--id horizontal alignment left/center/right/justify (default = center)--> | ||
| id-c = <!--id background color (default = # | | id-c = <!--id background color (default = #332f2b)--> | ||
| id-fc = <!--id font color (default = # | | id-fc = <!--id font color (default = #ffcd72)--> | ||
| id-s = <!--id text size in points (default = 14)--> | | id-s = <!--id text size in points (default = 14)--> | ||
| id-p = <!--id cell padding (default = 0 1px 0 0)--> | | id-p = <!--id cell padding (default = 0 1px 0 0)--> | ||
| Line 31: | Line 31: | ||
| info = <!--info text and/or image--> | | info = <!--info text and/or image--> | ||
| info-a = <!--info horizontal alignment left/center/right/justify (default = left)--> | | info-a = <!--info horizontal alignment left/center/right/justify (default = left)--> | ||
| info-c = <!--info background color (default = # | | info-c = <!--info background color (default = #171513)--> | ||
| info-fc = <!--info font color (default = # | | info-fc = <!--info font color (default = #b2b2b2)--> | ||
| info-s = <!--info text size in points (default = 8)--> | | info-s = <!--info text size in points (default = 8)--> | ||
| info-p = <!--info padding (default = 0 4px 0 4px)--> | | info-p = <!--info padding (default = 0 4px 0 4px)--> | ||
| Line 46: | Line 46: | ||
<pre> | <pre> | ||
{{ | {{Userbox | ||
| border-c = <!--your border color--> | | border-c = <!--your border color--> | ||
| id = <!--your icon or short text ID--> | | id = <!--your icon or short text ID--> | ||
| Line 66: | Line 66: | ||
== Examples == | == Examples == | ||
{| style="background: | {| style="background:transparent" | ||
!style="width: 300px;"| Code | !style="width: 300px;"| Code | ||
!Result | !Result | ||
|- | |- | ||
| <pre>{{ | | <pre>{{Userbox}}</pre> || {{Userbox}} | ||
|- | |- | ||
| <pre>{{ | | colspan="2"| Below example shows how an image may be substituted for text. The Image parameter takes the filename, display size, and alt-text (seen when you hover your mouse over the image). | ||
| id = | |- | ||
| | | <pre>{{Userbox | ||
| | | id = [[Image:TigerSmileySet.png| | ||
45px|Tiger Smiley]] | |||
| info = ''foo bar'' | | info = ''foo bar'' | ||
| info-s = 12 | | info-s = 12 | ||
| border-s = 2 | | border-s = 2 | ||
}}</pre> || {{ | }}</pre> || {{Userbox|id=[[Image:TigerSmileySet.png|45px|Tiger Smiley]]|id-s=20|info=''foo bar''|info-s=12|border-s=2}} | ||
|- | |- | ||
| colspan="2"| Below example shows the default appearance of a userbox, which is (much) higher than the 45px. Compare the height of the one below with the above userbox. | | colspan="2"| Below example shows the default appearance of a userbox, which is (much) higher than the 45px. Compare the height of the one below with the above userbox. | ||
|- | |- | ||
| <pre>{{ | | <pre>{{Userbox | ||
| id = foo logo | | id = foo logo | ||
| info = ''We are trying to see | | info = ''We are trying to see | ||
default distance in between text | default distance in between text | ||
| Line 93: | Line 91: | ||
between cell content and its border | between cell content and its border | ||
and also see total height.'' | and also see total height.'' | ||
| border-s = 2 | | border-s = 2 | ||
}}</pre> || {{ | }}</pre> || {{Userbox|id=foo logo|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.''|border-s=2}} | ||
|- | |- | ||
| colspan="2"| Below example shows how we can change that userbox and further specify 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. | | colspan="2"| Below example shows how we can change that userbox and further specify 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. | ||
|- | |- | ||
| <pre>{{ | | <pre>{{Userbox | ||
| id = foo logo | | id = foo logo | ||
| id-s = 14 | | id-s = 14 | ||
| id-lh = 1.1em | | id-lh = 1.1em | ||
| info = ''We have specified values | | info = ''We have specified values | ||
| Line 109: | Line 104: | ||
text lines & padding space in between | text lines & padding space in between | ||
cell content and its border.'' | cell content and its border.'' | ||
| info-s = 8 | | info-s = 8 | ||
| info-p = 1pt | | info-p = 1pt | ||
| info-lh = 1.05em | | info-lh = 1.05em | ||
| border-s = 1 | | border-s = 1 | ||
}}</pre> || {{ | }}</pre> || {{Userbox|id=foo logo|id-s=14|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-s=8|info-p=1pt|info-lh=1.05em|border-s=1}} | ||
|} | |||
</noinclude> | </noinclude> | ||
Latest revision as of 01:17, 7 October 2012
| id | info |
|---|
Documentation[edit]
This template can be used to quickly create a userbox for display on a user's user page without having to know HTML or Wikitable syntax.
This is a slightly simplified and modified version of the Wikipedia Userbox template.
Usage[edit]
{{Userbox
| float = <!--left|right|none (default = left)-->
| border-c = <!--border color (default = #6a5d44)-->
| border-s = <!--border width in pixels (default = 1)-->
| id = <!--id image and/or text-->
| id-a = <!--id horizontal alignment left/center/right/justify (default = center)-->
| id-c = <!--id background color (default = #332f2b)-->
| id-fc = <!--id font color (default = #ffcd72)-->
| id-s = <!--id text size in points (default = 14)-->
| id-p = <!--id cell padding (default = 0 1px 0 0)-->
| id-lh = <!--id line height (default = 1.25em)-->
| id-op = <!--id other CSS parameters-->
| id-w = <!--id box width in pixels (default = 45)-->
| id-h = <!--id box height in pixels (default = 45)-->
| info = <!--info text and/or image-->
| info-a = <!--info horizontal alignment left/center/right/justify (default = left)-->
| info-c = <!--info background color (default = #171513)-->
| info-fc = <!--info font color (default = #b2b2b2)-->
| info-s = <!--info text size in points (default = 8)-->
| info-p = <!--info padding (default = 0 4px 0 4px)-->
| info-lh = <!--info line height (default = 1.25em)-->
| info-op = <!--info other CSS parameters-->
}}
- All parameters are optional
- Images should normally be scaled to x45px or less.
Most HTML-based tables use only a handful of these attributes. The following subset can be used to quickly convert an HTML userbox into the format used here:
{{Userbox
| border-c = <!--your border color-->
| id = <!--your icon or short text ID-->
| id-c = <!--background color for ID-->
| id-fc = <!--font color for ID-->
| info = <!--your text-->
| info-c = <!--background color for text-->
| info-fc = <!--font color for text-->
}}
Standard colors:
- Blue: #1e90ff
- Red: #b22222
- Orange: #f28500
- Yellow: #f4c430
- Purple: #9932cc
- Gold: #b49b50
Examples[edit]
| Code | Result | ||
|---|---|---|---|
{{Userbox}} |
| ||
| Below example shows how an image may be substituted for text. The Image parameter takes the filename, display size, and alt-text (seen when you hover your mouse over the image). | |||
{{Userbox
| id = [[Image:TigerSmileySet.png|
45px|Tiger Smiley]]
| info = ''foo bar''
| info-s = 12
| border-s = 2
}} |
| ||
| Below example shows the default appearance of a userbox, which is (much) higher than the 45px. Compare the height of the one below with the above userbox. | |||
{{Userbox
| id = foo logo
| 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.''
| border-s = 2
}} |
| ||
| Below example shows how we can change that userbox and further specify 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. | |||
{{Userbox
| id = foo logo
| id-s = 14
| 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-s = 8
| info-p = 1pt
| info-lh = 1.05em
| border-s = 1
}} |
| ||