Template:Userbox/doc: Difference between revisions

From DnD with Extra Tongues
Jump to navigation Jump to search
dnd5efandom>Foxwells
No edit summary
 
m (1 revision imported)
 
(No difference)

Latest revision as of 20:49, 9 June 2019

Description
This template is used to create user boxes.
Description Left Inset Main Box Right Inset
Content Content wiki code lcontent= content= rcontent=
Background color lbg= mainbg= rbg=
Text color color lcolor= color= rcolor=
Width with units lwidth= width=
(with insets)
rwidth=
Font size with units lsize= size= rsize=
  • Italic parameters above default to sane values and should generally not be touched.
  • Sane defaults are provided for everything, only content has to be specified to display an infobox.
  • |bcolor= and |bwidth= specify the box border color and width respectively (both with units).


Syntax
Type {{ #if: | }}{{{{ #if: | {{{prefix}}}: }}[[{{ #ifeq: {{ #sub: userbox | 0 | 1 }} | : || {{ #if: || Template }} }}:userbox|{{ #ifeq: {{ #sub: userbox | 0 | 1 }} | : | : }}{{ #ifeq: | Template | Userbox | userbox }}]]{{ #if: p1
 | |p1 }}{{ #if: p2
 | |p2 }}{{ #if: p3
 | |p3 }}{{ #if: etc
 | |etc }}{{ #if: 
 | |{{{6}}} }}{{ #if: 
 | |{{{7}}} }}{{ #if: 
 | |{{{8}}} }}{{ #if: 
 | |{{{9}}} }}{{ #if: 
 | |{{{10}}} }}{{ #if: 
 | |{{{11}}} }}{{ #if: 
 | |{{{12}}} }}{{ #if: 
 | |{{{13}}} }}{{ #if: 
 | |{{{14}}} }}{{ #if: 
 | |{{{15}}} }}{{ #if: 
 | |{{{16}}} }}{{ #if: 
 | |{{{17}}} }}{{ #if: 
 | |{{{18}}} }}{{ #if: 
 | |{{{19}}} }}{{ #if: 
 | |{{{20}}} }}{{ #if: 
 | |{{{21}}} }}}}{{ #if:  |  }} on user page.
The box is formatted with the help of MediaWiki:Wikia.css (see below) - allowing the template to be used both with and without additional formatting information.
The box consists of three parts - left and right inserts as well as the main (text) cell; the cells are rendered if the relevant content parameters are provided.
The available parameters are listed in the box to the right.


CSS code (add to MediaWiki:Wikia.css)
/* === USERBOXES  === */
 
table.userbox { float:left; margin:0.2em; padding:0; border-width:1px; border-style:solid; }
table.userbox td.left, table.userbox td.right { text-align:center; vertical-align:middle; font-size:1.6em; padding:0; }
table.userbox td.main { padding:0 4px; vertical-align:middle; line-height:125%; font-size:0.9em; }

table.userbox { border-color:#aaa; background:#f8f8f8; }
table.userbox td.left, table.userbox td.right { background:#d8d8d8; }


Sample output
{{userbox}} gives...
{{ {{#if:|Userbox/Section|Blank}} |class=left |style=height: 50px; width: 50px; {{#if:|background: {{{id-c}}};}} {{#if:|font-size: {{{lsize}}};}} {{#if:|color: ;}} |content= }} {{ {{#if:|Userbox/Section|Blank}} |class=main |style=height: 50px; {{#if:|font-size: {{#if:|{{{info-s}}}pt|{{{size}}}}}}}; {{#if:|color: {{{color}}};}} |content= }} {{ {{#if:|Userbox/Section|Blank}} |class=right |style=height: 50px; width: 50px; {{#if:|background: {{{id-c}}};}} {{#if:|font-size: {{{rsize}}};}} {{#if:|color: {{{rcolor}}};}} |content= }}


{{userbox|rcontent=R|content=Box with one inset and no provided styling.}} gives...
{{ {{#if:|Userbox/Section|Blank}} |class=left |style=height: 50px; width: 50px; {{#if:|background: {{{id-c}}};}} {{#if:|font-size: {{{lsize}}};}} {{#if:|color: ;}} |content= }} {{ {{#if:Box with one inset and no provided styling.|Userbox/Section|Blank}} |class=main |style=height: 50px; {{#if:|font-size: {{#if:|{{{info-s}}}pt|{{{size}}}}}}}; {{#if:|color: {{{color}}};}} |content=Box with one inset and no provided styling. }} {{ {{#if:R|Userbox/Section|Blank}} |class=right |style=height: 50px; width: 50px; {{#if:|background: {{{id-c}}};}} {{#if:|font-size: {{{rsize}}};}} {{#if:|color: {{{rcolor}}};}} |content=R }}


{{userbox|lcontent=L|rcontent=R|content=Box with both insets and no provided styling.}} gives...
{{ {{#if:L|Userbox/Section|Blank}} |class=left |style=height: 50px; width: 50px; {{#if:|background: {{{id-c}}};}} {{#if:|font-size: {{{lsize}}};}} {{#if:|color: ;}} |content=L }} {{ {{#if:Box with both insets and no provided styling.|Userbox/Section|Blank}} |class=main |style=height: 50px; {{#if:|font-size: {{#if:|{{{info-s}}}pt|{{{size}}}}}}}; {{#if:|color: {{{color}}};}} |content=Box with both insets and no provided styling. }} {{ {{#if:R|Userbox/Section|Blank}} |class=right |style=height: 50px; width: 50px; {{#if:|background: {{{id-c}}};}} {{#if:|font-size: {{{rsize}}};}} {{#if:|color: {{{rcolor}}};}} |content=R }}


{{userbox|rcontent=[[File:Red Prompt button up-1-.svg]]|content=Box with one inset with a photo and no provided styling.}} gives...
{{ {{#if:|Userbox/Section|Blank}} |class=left |style=height: 50px; width: 50px; {{#if:|background: {{{id-c}}};}} {{#if:|font-size: {{{lsize}}};}} {{#if:|color: ;}} |content= }} {{ {{#if:Box with one inset with a photo and no provided styling.|Userbox/Section|Blank}} |class=main |style=height: 50px; {{#if:|font-size: {{#if:|{{{info-s}}}pt|{{{size}}}}}}}; {{#if:|color: {{{color}}};}} |content=Box with one inset with a photo and no provided styling. }} {{ {{#if:File:Red Prompt button up-1-.svg|Userbox/Section|Blank}} |class=right |style=height: 50px; width: 50px; {{#if:|background: {{{id-c}}};}} {{#if:|font-size: {{{rsize}}};}} {{#if:|color: {{{rcolor}}};}} |content=File:Red Prompt button up-1-.svg }}


{{userbox|rcontent=BLU|content=Right inset, custom colors|mainbg=steelblue|rbg=lightsteelblue|rcolor=midnightblue|rsize=2em|color=#BBDDFF|bcolor=skyblue}} gives...
{{ {{#if:|Userbox/Section|Blank}} |class=left |style=height: 50px; width: 50px; {{#if:|background: {{{id-c}}};}} {{#if:|font-size: {{{lsize}}};}} {{#if:|color: ;}} |content= }} {{ {{#if:Right inset, custom colors|Userbox/Section|Blank}} |class=main |style=height: 50px; {{#if:|font-size: {{#if:|{{{info-s}}}pt|{{{size}}}}}}}; {{#if:#BBDDFF|color: #BBDDFF;}} |content=Right inset, custom colors }} {{ {{#if:BLU|Userbox/Section|Blank}} |class=right |style=height: 50px; width: 50px; {{#if:lightsteelblue|background: lightsteelblue;}} {{#if:2em|font-size: 2em;}} {{#if:midnightblue|color: midnightblue;}} |content=BLU }}


Dependencies
See also
Template:User edits on Templates Wiki, a userbox using this template.
Template:Userbox on WoWWiki, upon which this template was based.