Template:Userbox/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Doc/subpage}}
{{Doc/subpage}}
This is a meta template used to aid in the creation of userbox templates.
For the list of predefined userbox templates which uses this template, see [[:Category:Userbox Templates]].


This is a meta template used to aid in the creation of userbox templates.
== Copy and Paste ==
{{CodeBlock|<nowiki>{{Userbox
| info  =
| info-s =
| id    =
| id-s  =
}}</nowiki>}}


== Usage, Parameters and Examples ==
== Usage, Parameters and Examples ==
Line 7: Line 16:
{|class="standard-table" | style="width:100%; text-align:center;"
{|class="standard-table" | style="width:100%; text-align:center;"
|-
|-
! style="width:15%" | Parameter
! style="width:15%" | {{Dictionary/common|Param}}
! style="width:15%" | Description
! {{Dictionary/common|Desc}}
! Example
! {{Dictionary/common|Example}}
! style="width:20%" | Preview
! style="width:20%" | {{Dictionary/common|Preview}}
|-
| No parameters
| Template will revert to the default valves specified within the {{code|<nowiki>{{#switch}}</nowiki>}} parser functions.
| {{CodeBlock|margin=5px|<nowiki>{{Userbox}}</nowiki>}}
| {{Userbox}}
|-
|-
| {{Code|{{param|border-c}}}}
| {{Code|{{param|border-c}}}}
| Userbox border color
| Userbox border color
| {{CodeBlock|{{((}}Userbox&#124;{{Tint|color=yellow|border-c}}{{=}}{{Tint|color=green|red}}{{))}}}}
| {{CodeBlock|margin=5px|<nowiki>| border-c = red</nowiki>}}
| {{Userbox|border-c=red}}
| {{Userbox|border-c=red}}
|-
|-
| {{Code|{{param|border-w}}}}
| {{Code|{{param|border-w}}}}
| Userbox border width <br>{{ModernNote}} Unit must be specified
| Userbox border width <br>{{Note|Unit must be specified}}
| {{CodeBlock|{{((}}Userbox&#124;{{Tint|color=yellow|border-w}}{{=}}{{Tint|color=green|3px}}{{))}}}}
| {{CodeBlock|margin=5px|<nowiki>| border-w = 3px</nowiki>}}
| {{Userbox|border-w=3px}}
| {{Userbox|border-w=3px}}
|-
|-
| {{Code|{{param|info}}}}
| {{Code|{{param|info}}}}
| Infobox content
| Infobox content
| {{CodeBlock|{{((}}Userbox&#124;{{Tint|color=yellow|info}}{{=}}{{Tint|color=green|Hello, World!}}{{))}}}}
| {{CodeBlock|margin=5px|<nowiki>| info = Hello, World!</nowiki>}}
| {{Userbox|info=Hello, World!}}
| {{Userbox|info=Hello, World!}}
|-
|-
| {{Code|{{param|info-s}}}}
| {{Code|{{param|info-s}}}}
| Infobox styling
| Infobox styling
| {{CodeBlock|{{((}}Userbox&#124;{{Tint|color=yellow|info-s}}{{=}}{{Tint|color=green|background:#222;}}{{))}}}}
| {{CodeBlock|margin=5px|<nowiki>| info-s = background:#222;</nowiki>}}
| {{Userbox|info-s=background:#222;}}
| {{Userbox|info-s=background:#222;}}
|-
|-
| {{Code|{{param|id}}}}
| {{Code|{{param|id}}}}
| Idbox content
| Idbox content
| {{CodeBlock|{{((}}Userbox&#124;{{Tint|color=yellow|id}}{{=}}{{Tint|color=green|<nowiki>[[File:Earth.gif|24px|link=]]</nowiki>}}{{))}}}}
| {{CodeBlock|margin=5px|<nowiki>| id = [[File:Earth.gif|link=]]</nowiki>}}
| {{Userbox|id=[[File:Earth.gif|link=]]}}
| {{Userbox|id=[[File:Earth.gif|link=]]}}
|-
|-
| {{Code|{{param|id-s}}}}
| {{Code|{{param|id-s}}}}
| Idbox styling
| Idbox styling
| {{CodeBlock|{{((}}Userbox&#124;{{Tint|color=yellow|id-s}}{{=}}{{Tint|color=green|background:indigo;}}{{))}}}}
| {{CodeBlock|margin=5px|<nowiki>| id-s = background:indigo;</nowiki>}}
| {{Userbox|id-s=background:indigo;}}
| {{Userbox|id-s=background:indigo;}}
|-
|-
| {{Code|{{param|type}}}}
| {{Code|{{param|type}}}}
| Predefined styling for the entire userbox
| Predefined styling for the entire userbox
| {{CodeBlock|{{((}}Userbox&#124;{{Tint|color=yellow|type}}{{=}}{{Tint|color=green|deepdark}}{{))}}}}
| {{CodeBlock|margin=5px|<nowiki>| type = black</nowiki>}}
| {{Userbox|type=deepdark}}
| {{Userbox|type=black}}
|}
|}


== Available Types ==
== Available Types ==
{{CodeBlock|<nowiki>{{Userbox|type=black}}</nowiki>}}
{{CodeBlock|<nowiki>{{Userbox|type=black}} {{Userbox|type=pink}} {{Userbox|type=ClearBlack}}</nowiki>}}
{{Capsule|{{userbox|type=black}}}}
{{Capsule|{{userbox|type=black}} {{Userbox|type=pink}}{{Userbox|type=ClearBlack}}}}</div>
[[Category:Templates]]
<includeonly>[[Category:Templates]][[Category:Metatemplates]][[Category:Userbox Templates]]</includeonly>

Latest revision as of 13:30, 17 November 2023

Edit-copy.png
This is a documentation subpage for Template:Userbox.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This is a meta template used to aid in the creation of userbox templates.

For the list of predefined userbox templates which uses this template, see Category:Userbox Templates.

Copy and Paste

{{Userbox | info = | info-s = | id = | id-s = }}

Usage, Parameters and Examples

{{Userbox}}
Parameter Description Example Preview
No parameters Template will revert to the default valves specified within the {{#switch}} parser functions.
{{Userbox}}
id

info

{{{border-c}}} Userbox border color
| border-c = red
id

info

{{{border-w}}} Userbox border width
Note.pngNote:Unit must be specified
| border-w = 3px
id

info

{{{info}}} Infobox content
| info = Hello, World!
id

Hello, World!

{{{info-s}}} Infobox styling
| info-s = background:#222;
id

info

{{{id}}} Idbox content
| id = [[File:Earth.gif|link=]]
Earth.gif

info

{{{id-s}}} Idbox styling
| id-s = background:indigo;
id

info

{{{type}}} Predefined styling for the entire userbox
| type = black
id

info

Available Types

{{Userbox|type=black}} {{Userbox|type=pink}} {{Userbox|type=ClearBlack}}
id

info

id

info

id

info