Difference between revisions of "Help:Userboxes"

From Team Fortress Wiki
Jump to: navigation, search
(Adding some cell padding to the lone boxes; makes the text look nicer.)
m (Cleaned up a bit.)
Line 2: Line 2:
 
User info boxes, or user boxes, are small tags that can be placed on your user page to denote affiliations, hobbies, achievements, etc.  They can be either ''public'' (in the Template namespace), or ''private'' (in the User namespace).
 
User info boxes, or user boxes, are small tags that can be placed on your user page to denote affiliations, hobbies, achievements, etc.  They can be either ''public'' (in the Template namespace), or ''private'' (in the User namespace).
  
'''Existing User Boxes''': [[User_info_boxes|User Info Boxes]]
+
{{See also|User Info Boxes}}
  
 
'''''It's not polite to use unlisted user boxes without permission!'''''
 
'''''It's not polite to use unlisted user boxes without permission!'''''
  
'''Note:''' When at all possible, please use user info boxes that have '''already''' been created.
+
'''Note:''' When possible, please use user info boxes that have '''already''' been created.
  
 
==Using a User Info Box==
 
==Using a User Info Box==
Line 15: Line 15:
  
 
The above example produces the following userbox:
 
The above example produces the following userbox:
{|
+
{{User TF2 junky}}
| {{User TF2 junky}}
+
{{clr}}
|}
 
 
 
 
==Displaying several User Info Boxes==
 
==Displaying several User Info Boxes==
Userboxes cannot be simply piled onto a user page, as this causes them to stack diagonally. The simplest way to display them is to use a grid pattern. This can be done with relatively little extra coding:
+
Userboxes cannot be simply piled onto a user page, as this causes them to stack diagonally. The simplest way to display them is to use a table, which will arrange them into a grid.
  
<pre style="margin-left:50px">
+
<pre>
{| cellpadding = 5 align=center
+
{| align="center"
|{{User Wiki editor}}
+
| {{User Wiki editor}}
|{{User Wiki translator}}
+
| {{User Wiki translator}}
|{{User TF2 100}}
+
| {{User TF2 100}}
|{{User RED Employee}}
+
| {{User RED Employee}}
 
|}
 
|}
 
</pre>
 
</pre>
 
The above example produces the following:
 
The above example produces the following:
{| cellpadding = 5 align=center
+
{| align="center"
|{{User Wiki editor}}
+
| {{User Wiki editor}}
|{{User Wiki translator}}
+
| {{User Wiki translator}}
|{{User TF2 100}}
+
| {{User TF2 100}}
|{{User RED Employee}}
+
| {{User RED Employee}}
 
|}
 
|}
  
 +
This code can be used to display between 1 and 4 columns of userboxes. More rows can be added by inserting <code>|-</code> into the table:
  
This code can be used to display between 1 and 4 columns of userboxes. More rows can be added without repeating the ''cellpadding'' command; the split between rows is indicated by <code>|-</code> in the appropriate line of code:
+
<pre>
 
+
{| align="center"
<pre style="margin-left:50px">
+
| {{User Wiki editor}}
{| cellpadding = 5 align=center
+
| {{User Wiki translator}}
|{{User Wiki editor}}
+
| {{User TF2 100}}
|{{User Wiki translator}}
 
|{{User TF2 100}}
 
 
|-
 
|-
|{{User RED Employee}}
+
| {{User RED Employee}}
|{{User BLU Employee}}
+
| {{User BLU Employee}}
|{{User page size}}
+
| {{User page size}}
 
|}
 
|}
 
</pre>
 
</pre>
 
The above example produces the following:
 
The above example produces the following:
{| cellpadding = 5 align=center
+
{| align="center"
|{{User Wiki editor}}
+
| {{User Wiki editor}}
|{{User Wiki translator}}
+
| {{User Wiki translator}}
|{{User TF2 100}}
+
| {{User TF2 100}}
 
|-
 
|-
|{{User RED Employee}}
+
| {{User RED Employee}}
|{{User BLU Employee}}
+
| {{User BLU Employee}}
|{{User page size}}
+
| {{User page size}}
 
|}
 
|}
  
 
==Parameters==
 
==Parameters==
 
Some userboxes require additional parameters to work properly. A parameter is added to the template with a | symbol separating it from the template title:
 
Some userboxes require additional parameters to work properly. A parameter is added to the template with a | symbol separating it from the template title:
:<pre>{{User edits|50}}</pre>
+
<pre>{{User edits|50}}</pre>
 
+
will generate:
The above example produces the following:
+
{{User edits|50}}
{|
+
{{clr}}
| {{User edits|50}}
 
|}
 
 
 
 
 
 
To add a private user box, you must use the full path to the template, as follows:
 
To add a private user box, you must use the full path to the template, as follows:
:<pre>{{User:CountDOODOO/Template:Recent Changes Patroller}}</pre>
+
<pre>{{User:Firestorm/Template:User_Bright}}</pre>
 
+
will generate:
The above example produces the following user box:
+
{{User:Firestorm/Template:User_Bright}}
{|
+
{{clr}}
|{{Template:User Recent Changes Patroller}}
 
|}
 
 
 
  
 
'''Note:''' Note that when including a user box from the User namespace, you '''MUST''' include the Template prefix.
 
'''Note:''' Note that when including a user box from the User namespace, you '''MUST''' include the Template prefix.

Revision as of 10:14, 20 May 2016

Instructions

User info boxes, or user boxes, are small tags that can be placed on your user page to denote affiliations, hobbies, achievements, etc. They can be either public (in the Template namespace), or private (in the User namespace).

See also: User Info Boxes

It's not polite to use unlisted user boxes without permission!

Note: When possible, please use user info boxes that have already been created.

Using a User Info Box

Using a user box is as simple as adding the template to your user page. For example, the TF2 Junky userbox can be found at Template:User TF2 junky.

To add a public user box to your page, you include the template like so:

{{User TF2 junky}}

The above example produces the following userbox:

TF2 crosshair.png This user is a Team Fortress 2 junky!

Displaying several User Info Boxes

Userboxes cannot be simply piled onto a user page, as this causes them to stack diagonally. The simplest way to display them is to use a table, which will arrange them into a grid.

{| align="center"
| {{User Wiki editor}}
| {{User Wiki translator}}
| {{User TF2 100}}
| {{User RED Employee}}
|}

The above example produces the following:

Edit icon.png This user is a Team Fortress Wiki editor.
TF2 crosshair.png This user is a Team Fortress Wiki translator!
Tf2 100.png This user has logged 100 hours total in Team Fortress 2.
REDicon.gif This user is an employee of RED.

This code can be used to display between 1 and 4 columns of userboxes. More rows can be added by inserting |- into the table:

{| align="center"
| {{User Wiki editor}}
| {{User Wiki translator}}
| {{User TF2 100}}
|-
| {{User RED Employee}}
| {{User BLU Employee}}
| {{User page size}}
|}

The above example produces the following:

Edit icon.png This user is a Team Fortress Wiki editor.
TF2 crosshair.png This user is a Team Fortress Wiki translator!
Tf2 100.png This user has logged 100 hours total in Team Fortress 2.
REDicon.gif This user is an employee of RED.
BLUicon.gif This user is an employee of BLU.
Kollectivization.png This user page is 4,033 bytes large.

Parameters

Some userboxes require additional parameters to work properly. A parameter is added to the template with a | symbol separating it from the template title:

{{User edits|50}}

will generate:

Tf medic heal under fire.png This user has made over 50 edits to the Team Fortress Wiki!

To add a private user box, you must use the full path to the template, as follows:

{{User:Firestorm/Template:User_Bright}}

will generate:

Sunglasses.jpg This user's future is so bright they have got to wear shades.

Note: Note that when including a user box from the User namespace, you MUST include the Template prefix.

Creating a User Info Box

Very widely used user boxes (such as Template:User TF2 junky) should be created in the Template namespace. All other user boxes should be in the User namespace (such as User:Firestorm/Template:User Example).

1. Navigate to the page you wish to use for your userbox.
The naming convention for user boxes is:
Template:User Name of user box
ALL user boxes should be prefixed with "User" to avoid any conflicts with articles.
2. Copy the code below. Do NOT edit the global user box template.
{{Userbox
  |border-c = Border Color (Hex)
  |border-s = Border Size (Pixels, Use 1 to match others)
  |id-c     = ID field bgcolor (Hex)
  |id-s     = ID field Font size (Pixels, Use 14 to match others)
  |id-fc    = ID field Color (Hex)
  |info-c   = Info text bgcolor (Hex)
  |info-s   = Info Font size (Pixels, use 7 to match others)
  |info-fc  = Info text color (foreground)
  |id       = ID field text (Small Section.  40px image OR Two 14pt Characters ONLY)
  |info     = Info field Text (Large Section, Text ONLY)
}}
3. Edit everything to the right of the = sign as desired.
Note: The maximum text size for the id is 24! Do not exceed this value, or the box will stretch.
4. (Optional) If you want your user box to be listed as public, go to User Info Boxes and add the following (Replace USERBOX NAME with the name of your user box):
{{Userbox_preview|UIB=USERBOX NAME}}