Difference between revisions of "Template:Infobox/doc"

From Team Fortress Wiki
Jump to: navigation, search
m (See also)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
An '''Infobox''' can be added to give a visual lift to pages by displaying a box at the top right or left of any article. They have been designed to be a flexible and easy to use way of incorporating a picture and brief description of anything you are writing an article about.
+
An '''infobox''' can be added to give a visual lift to pages by displaying a box at the top right or left of any article. They have been designed to be a flexible and easy to use way of incorporating a picture and brief description of anything you are writing an article about. Various examples have been given, but only experimentation can surely determine success.
  
 
==Usage==
 
==Usage==
 
 
The default infobox will display at the top right of an page and have the text wrapped round it to the left. To include a default infobox type
 
The default infobox will display at the top right of an page and have the text wrapped round it to the left. To include a default infobox type
 
<pre>
 
<pre>
Line 15: Line 14:
  
 
===Parameters===
 
===Parameters===
 
 
{| class="wikitable grid"
 
{| class="wikitable grid"
 
|-
 
|-
Line 53: Line 51:
  
 
===Examples===
 
===Examples===
 
 
<div style="background-color:white;border:solid navy 1px">
 
<div style="background-color:white;border:solid navy 1px">
 
{{Infobox|title=My Title|contents=This is a brief description.}}
 
{{Infobox|title=My Title|contents=This is a brief description.}}
Line 74: Line 71:
 
|title=Soldier
 
|title=Soldier
 
|align=left
 
|align=left
|image=Soldier.jpg
+
|image=Soldier.png
 
|contents=This is a brief description for the [[Soldier]].
 
|contents=This is a brief description for the [[Soldier]].
 
}}
 
}}
Line 84: Line 81:
 
|title=Soldier
 
|title=Soldier
 
|align=left
 
|align=left
|image=Soldier.jpg
+
|image=Soldier.png
 
|contents=This is a brief description for the [[Soldier]].
 
|contents=This is a brief description for the [[Soldier]].
 
}}
 
}}
Line 100: Line 97:
 
|align=right
 
|align=right
 
|width=100px
 
|width=100px
|image=Soldier.jpg
+
|image=Soldier.png
 
|imagewidth=50px
 
|imagewidth=50px
 
|contents=This is a brief description for the [[Soldier]].
 
|contents=This is a brief description for the [[Soldier]].
Line 112: Line 109:
 
|align=right
 
|align=right
 
|width=90px
 
|width=90px
|image=Soldier.jpg
+
|image=Soldier.png
 
|imagewidth=60px
 
|imagewidth=60px
 
|contents=This is a brief description for the [[Soldier]].
 
|contents=This is a brief description for the [[Soldier]].
Line 127: Line 124:
 
|align=left
 
|align=left
 
|width=100px
 
|width=100px
|image=Soldier.jpg
+
|image=Soldier.png
 
|imagewidth=100px
 
|imagewidth=100px
 
|style=text-align:left;padding:1em;text-transform:capitalize;
 
|style=text-align:left;padding:1em;text-transform:capitalize;
Line 148: Line 145:
 
|align=left
 
|align=left
 
|width=100px
 
|width=100px
|image=Soldier.jpg
+
|image=Soldier.png
 
|imagewidth=100px
 
|imagewidth=100px
 
|style=text-align:left;padding:1em;text-transform:capitalize;
 
|style=text-align:left;padding:1em;text-transform:capitalize;
Line 166: Line 163:
  
 
==See also==
 
==See also==
 
 
*[[Template:Infobox class]]
 
*[[Template:Infobox class]]
 
*[[Template:Infobox map]]
 
*[[Template:Infobox map]]
Line 172: Line 168:
 
<noinclude>
 
<noinclude>
 
[[Category:Template documentation|{{PAGENAME}}]]
 
[[Category:Template documentation|{{PAGENAME}}]]
 
+
</noinclude>
[[Category:Every page]]</noinclude>
 

Revision as of 16:25, 31 March 2014

An infobox can be added to give a visual lift to pages by displaying a box at the top right or left of any article. They have been designed to be a flexible and easy to use way of incorporating a picture and brief description of anything you are writing an article about. Various examples have been given, but only experimentation can surely determine success.

Usage

The default infobox will display at the top right of an page and have the text wrapped round it to the left. To include a default infobox type

{{Infobox|title=My Title}}

and replace the My Title with your own title. It is also possible (and highly recommended) to include a picture of the item you are describing by adding an image property by typing

{{Infobox|title=My Title|image=Myimage.jpg}}

and again, replacing Myimage.jpg with your own picture name.

Parameters

Name Requirement Options
title required
image optional
imagewidth optional [Default:150px]
align optional left or right [Default:right]
width optional [Default:18em]
contents optional
style optional (takes any valid css style)


Examples

My Title
This is a brief description.

{{Infobox
|title=My Title
|contents=This is a brief description.
}}


Soldier
Soldier.png
This is a brief description for the Soldier.

{{Infobox
|title=Soldier
|align=left
|image=Soldier.png
|contents=This is a brief description for the [[Soldier]].
}}











Soldier
Soldier.png
This is a brief description for the Soldier.

{{Infobox
|title=Soldier
|align=right
|width=90px
|image=Soldier.png
|imagewidth=60px
|contents=This is a brief description for the [[Soldier]].
}}


Soldier
Soldier.png
Info
class:soldier
type:offensive
health:200
speed:80%

Note: It isn't recommended that you change the styling or use a standard infobox for something as complicated as this, it is only an example of how it is possible to mix css styles and html contents within an infobox. Creating a new template specifically for complex content would be better.


{{Infobox
|title=Soldier
|align=left
|width=100px
|image=Soldier.png
|imagewidth=100px
|style=text-align:left;padding:1em;text-transform:capitalize;
|contents=
<table class="transparent" width="100%" style="border-collapse:collapse">
<th colspan="2" class="header">Info</th>
<tr><td class="bold">class:</td><td>soldier</td></tr>
<tr><td class="bold">type:</td><td>offensive</td></tr>
<tr><td class="bold">health:</td><td>200</td></tr>
<tr><td class="bold">speed:</td><td>80%</td></tr>
</table>
}}

See also