Editing Template:Infobox/doc

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 +
{{distinguish|Template:Userbox}}
 
<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1|2}}|old | |{{Lua|Module:Infobox}}}}</includeonly>
 
<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1|2}}|old | |{{Lua|Module:Infobox}}}}</includeonly>
 +
{{Generic template demo
 +
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
 +
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
 +
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
 +
|label2={{{label1}}} |data2={{{data1}}}
 +
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
 +
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
 +
|label6={{{label2}}} |data6={{{data2}}}
 +
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
 +
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
 +
|below
 +
}}
  
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes. See [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
+
This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
  
 
=== Usage ===
 
=== Usage ===
Line 59: Line 72:
  
 
==== Illustration images ====
 
==== Illustration images ====
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default.  
+
; image(n) : images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default. See [[WP:ALT]] for more on alt text.
 
; caption(n) : Text to put underneath the images.
 
; caption(n) : Text to put underneath the images.
  
Line 89: Line 102:
 
</pre>{{clear}}
 
</pre>{{clear}}
  
 +
It is also possible to automatically renumber parameter names by using [[User:Frietjes/infoboxgap.js]] or [[Module:IncrementParams]].
  
 
===== Making data fields optional =====
 
===== Making data fields optional =====
Line 165: Line 179:
  
 
==== Italic titles ====
 
==== Italic titles ====
Titles of articles with infoboxes may be made italic by passing the <code>italic title</code> parameter.
+
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
  
 
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
 
* Turn on italic titles by passing {{para|italic title|<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
Line 183: Line 197:
 
; belowstyle : Applies only to the below cell
 
; belowstyle : Applies only to the below cell
  
==== HTML classes ====
+
==== HTML classes and microformats ====
 
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
 
; bodyclass : This parameter is inserted into the <code>class</code> attribute for the infobox as a whole.
 
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
 
; titleclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''title''' caption.
Line 200: Line 214:
 
-->
 
-->
 
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
 
; belowclass : This parameter is inserted into the <code>class</code> attribute for the infobox's '''below''' cell.
 +
 +
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. Multiple class names may be specified, separated by spaces, some of them being used as selectors for custom styling according to a project policy or to the skin selected in user preferences, others beig used for microformats.
 +
 +
To flag an infobox as containing [[hCard]] information, for example, add the following parameter:
 +
 +
<pre style="overflow:auto">
 +
| bodyclass = vcard
 +
</pre>{{clear}}
 +
 +
And for each row containing a data cell that's part of the vcard, add a corresponding class parameter:
 +
 +
<pre style="overflow:auto">
 +
| class1 = fn
 +
| class2 = org
 +
| class3 = tel
 +
</pre>{{clear}}
 +
 +
...and so forth. "above" and "title" can also be given classes, since these are usually used to display the name of the subject of the infobox.
 +
 +
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
  
 
=== Examples ===
 
=== Examples ===
Line 649: Line 683:
  
 
===See also===
 
===See also===
* [[Module:Infobox]], the Lua module on which this template is based
+
* [[Module:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
 
* [[Special:Permalink/558855956|Template:Infobox/old]], the previous ParserFunctions implementation
 
* [[Special:Permalink/558855956|Template:Infobox/old]], the previous ParserFunctions implementation
 +
* {{tl|Infobox3cols}}
 
* {{tl|Navbox}} and {{tl|Sidebar}}
 
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[:Category:Infobox templates]]
+
* [[Wikipedia:List of infoboxes|List of infoboxes]]
 
* Maintenance categories:
 
* Maintenance categories:
 
** [[:Category:Articles which use infobox templates with no data rows]]
 
** [[:Category:Articles which use infobox templates with no data rows]]

Please note that all contributions to Guild of Archivists may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see GoArch:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)