Difference between revisions of "Template:Infobox/doc"

From BESA® Wiki
Jump to: navigation, search
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. Various examples have been given, but only experimentation can surely determine success.
+
{{documentation header}}
 +
{{lua}}
 +
This is a skeleton for infoboxes, for use in other infobox templates or standalone.
  
==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
+
<pre>
+
{{Infobox|title=My Title}}
+
</pre>
+
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
+
<pre>
+
{{Infobox|title=My Title|image=Myimage.jpg}}
+
</pre>
+
and again, replacing ''Myimage.jpg'' with your own picture name.
+
  
===Parameters===
+
{<nowiki/>{infobox
{| class="wikitable grid"
+
| title = box title, defaults to page's name
|-
+
| image''n'' = Images displayed below the title. Supports [[Template:Animate|animation]]. First image defaults to {{{title}}}.png. Set to "none" to remove.
!Name
+
| defaultimagesize = Set the default size used by the above images. Defaults to 150px.
!Requirement
+
| image''n''size = Sets the size of the corresponding image, overriding {{{defaultimagesize}}}.
!Options
+
| invimage''n'' = Invimages displayed under the images, using {{tl|grid}}. Set to "----" to add a line break. First invimage defaults to {{{title}}}, set to "none" to remove.
|-
+
| imagearea = Completely replaces the functionality of the above 4 parameters, leaving a blank canvas below the title to put whatever
|title
+
| rows = all rows go here using {{tl|infobox row}}
|required
+
| footer = optional centered footer that goes across both columns
|
+
}}
|-
+
|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===
+
<div style="background-color:white;border:solid navy 1px">
+
{{Infobox|title=My Title|contents=This is a brief description.}}
+
{|
+
|
+
<pre>
+
<nowiki>
+
{{Infobox
+
|title=My Title
+
|contents=This is a brief description.
+
}}
+
</nowiki>
+
</pre>
+
|}
+
</div>
+
<br style="clear:both" />
+
 
+
<div style="background-color:white;border:solid navy 1px">
+
{{Infobox
+
|title=Soldier
+
|align=left
+
|image=Soldier.png
+
|contents=This is a brief description for the [[Soldier]].
+
}}
+
{|
+
|
+
<pre>
+
<nowiki>
+
{{Infobox
+
|title=Soldier
+
|align=left
+
|image=Soldier.png
+
|contents=This is a brief description for the [[Soldier]].
+
}}
+
</nowiki>
+
</pre>
+
|}
+
<br/><br/><br/><br/><br/><br/><br/><br/><br/>
+
</div>
+
 
+
<br style="clear:both" />
+
 
+
<div style="background-color:white;border:solid navy 1px">
+
{{Infobox
+
|title=Soldier
+
|align=right
+
|width=100px
+
|image=Soldier.png
+
|imagewidth=50px
+
|contents=This is a brief description for the [[Soldier]].
+
}}
+
{|
+
|
+
<pre>
+
<nowiki>
+
{{Infobox
+
|title=Soldier
+
|align=right
+
|width=90px
+
|image=Soldier.png
+
|imagewidth=60px
+
|contents=This is a brief description for the [[Soldier]].
+
}}
+
</nowiki>
+
</pre>
+
|}
+
</div>
+
<br style="clear:both" />
+
 
+
<div style="background-color:white;border:solid navy 1px">
+
{{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>
+
}}
+
''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.''
+
{|
+
|
+
<pre>
+
<nowiki>
+
{{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>
+
}}
+
</nowiki>
+
</pre>
+
|}
+
</div>
+
 
+
==See also==
+
*[[Template:Infobox class]]
+
*[[Template:Infobox map]]
+
  
 +
<includeonly>
 +
<!-- Template categories/interwiki -->
 +
[[Category:Infobox templates|*]]
 +
[[de:Vorlage:Infobox]]
 +
[[es:Plantilla:Infobox]]
 +
[[fr:Modèle:Infobox common]]
 +
</includeonly>
 
<noinclude>
 
<noinclude>
[[Category:Template documentation|{{PAGENAME}}]]
+
<!-- Documentation categories/interwiki -->
 +
[[fr:Modèle:Infobox common/doc]]
 
</noinclude>
 
</noinclude>

Revision as of 13:05, 24 July 2015

Script error Script error This is a skeleton for infoboxes, for use in other infobox templates or standalone.

Usage

{{infobox
| title = box title, defaults to page's name
| imagen = Images displayed below the title. Supports animation. First image defaults to {{{title}}}.png. Set to "none" to remove.
| defaultimagesize = Set the default size used by the above images. Defaults to 150px.
| imagensize = Sets the size of the corresponding image, overriding {{{defaultimagesize}}}.
| invimagen = Invimages displayed under the images, using {{grid}}. Set to "----" to add a line break. First invimage defaults to {{{title}}}, set to "none" to remove.
| imagearea = Completely replaces the functionality of the above 4 parameters, leaving a blank canvas below the title to put whatever
| rows = all rows go here using {{infobox row}}
| footer = optional centered footer that goes across both columns
}}


fr:Modèle:Infobox common/doc