Difference between revisions of "Template:Infobox"

From Twinsuniverse
Jump to: navigation, search
m (debugging)
m (debugging)
Line 3: Line 3:
 
}}<table class="infobox {{#if:{{{float|}}}|side}} {{lc:{{{class|}}}}}" border="0" cellpadding="0" cellspacing="0" style="{{{mainstyle|}}}">
 
}}<table class="infobox {{#if:{{{float|}}}|side}} {{lc:{{{class|}}}}}" border="0" cellpadding="0" cellspacing="0" style="{{{mainstyle|}}}">
 
{{Infobox/row | header={{#if: {{{title|}}} | {{{title}}} | {{PAGENAME}} }} | class=title
 
{{Infobox/row | header={{#if: {{{title|}}} | {{{title}}} | {{PAGENAME}} }} | class=title
    | titleclass={{{titleclass|}}} | titlestyle={{{headstyle|}}}
+
  | titleclass={{{titleclass|}}} | titlestyle={{{headstyle|}}}
 
}}{{
 
}}{{
    #ifeq: {{{noimage|false}}} | false
+
  #ifeq: {{{noimage|false}}} | false
    |{{Infobox/row
+
  |{{Infobox/row
        |data={{articleimage|{{{image|}}}|{{{imagecaption|Image for article: {{PAGENAME}}}}}|nocat={{{nocat|false}}}}}|class=image
+
    |data={{articleimage|{{{image|}}}|{{{imagecaption|Image for article: {{PAGENAME}}}}}|nocat={{{nocat|false}}}}}|class=image
        |datastyle={{{datastyle|}}}}}
+
    |datastyle={{{datastyle|}}}}}
}}
+
}}{{
{{#vardefine: row|1}}{{#while: |{{{ {{#var:row}}|}}}
+
#vardefine: row|1}}{{
 +
#while: |{{{ {{#var:row}}|}}}
 
   |{{Infobox/row
 
   |{{Infobox/row
 
     |header={{{header{{#var:row}}|}}}
 
     |header={{{header{{#var:row}}|}}}
Line 18: Line 19:
 
     |datastyle={{{datastyle|}}}
 
     |datastyle={{{datastyle|}}}
 
     |headstyle={{#ifeq:{{{header{{#var:row}}|a}}}{{{class{{#var:row}}|}}}|{{{header{{#var:row}}|b}}}heading|{{{leadstyle|}}}|{{{headstyle|}}}}}
 
     |headstyle={{#ifeq:{{{header{{#var:row}}|a}}}{{{class{{#var:row}}|}}}|{{{header{{#var:row}}|b}}}heading|{{{leadstyle|}}}|{{{headstyle|}}}}}
   }}{{#vardefineecho: row|{{#expr: {{#var: row}} + 1 }}}}
+
   }}{{#vardefine: row|{{#expr: {{#var: row}} + 1 }}}}
 
}}</table>{{#vardefine:infobox_messages
 
}}</table>{{#vardefine:infobox_messages
    |{{#var:infobox_messages|}}{{maintenance|doclink={{{infoboxname|}}}|tasks={{#var:maintenance_message}}}}
+
  |{{#var:infobox_messages|}}{{maintenance|doclink={{{infoboxname|}}}|tasks={{#var:maintenance_message}}}}
 
}}</includeonly><noinclude>{{Infobox Template
 
}}</includeonly><noinclude>{{Infobox Template
 
  |purpose=infobox
 
  |purpose=infobox
Line 30: Line 31:
 
  |cat1=
 
  |cat1=
 
  |var1=infobox_messages!!active
 
  |var1=infobox_messages!!active
  |var2=row
+
  |var2=maintenance_message!!active
 +
|var3=row
 
}}
 
}}
  

Revision as of 22:25, 4 June 2014

Infobox
Purpose

Infobox [list all]

Single tag

No [list all]

Multi-line

Yes [list all]

Protected

No [list all]

Game related

No [list all]

Categorization
Categories

none [list all]

Variables
Names

Multiple: [list all]

  • infobox_messages  (active)
  • maintenance_message  (active)
  • row  (free for reuse)
Subpages

This template is used to show an infobox for a page. It should be the first of the page, before the general description. This template also uses the {{Infobox/row}} template for rendering a title, an optional {{articleimage}}, and 30 optional rows of custom data headings.


Note: This template provides the main functionality of the {{Infobox}}, whereas the latter further automates the theme selection. These may be merged later.

Parameters

  • infoboxname: The name of the infobox calling this template, for the link to documentation (case sensitive, defaults to no documentation link displayed)
  • title: The title to use in the top heading of the infobox (optional, defaults to {{PAGENAME}})
  • float: Whether the infobox should float to the right (any value will do, defaults to no float)
  • mainstyle: The CSS statements to use for the theme colours of the main infobox rectangle (optional, defaults to stylesheet colours)
  • headstyle: The CSS statements to use for the theme colours of the full-width headings (optional, defaults to stylesheet colours)
  • leadstyle: The CSS statements to use for the theme colours of the alternate full-width headings (optional, defaults to stylesheet colours)
  • datastyle: The CSS statements to use for the theme colours of the data cells (optional, defaults to stylesheet colours)
  • class: One of the theme titles on the themes subpage, or a custom class (lowercase, multiple values are space-delimited, defaults to no class)
  • image: The filename of the image to use as the infobox's article image (case sensitive, defaults to a default image)
  • imagecaption: The text to show in the tooltip when the article image is hovered (case sensitive, defaults to 'Image for article: {{PAGENAME}}')
  • noimage: Whether the article image should be absent altogether (any value will do, defaults to false)
  • nocat: Whether or not to suppress categorization by the {{articleimage}} template (defaults to false, which means auto categorization).


Syntax

Copy and paste the following for quick use:

{{infobox
 |class=
 |image=
 |imagecaption=
}}

Example

... this template is still under documentation