Difference between revisions of "Template:Infobox"

From Maths
Jump to: navigation, search
m (Example)
m (Adding documentation for style in another place)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
=Usage=
+
__TOC__
 +
==Alec's guide==
 +
===Definitions===
 +
# {{C|title}}
 +
# {{C|above}}
 +
# {{C|subheader}}
 +
# {{C|image}} - unsure on syntax would have to test
 +
# {{C|caption}} - applies to image - '''ignored if no image'''
 +
# {{C|header''n''}} - header in ''n''<sup>th</sup> slot - optional.
 +
# {{C|label''n''}} - label of ''n''<sup>th</sup> slot, below header - '''Not shown without data'''
 +
# {{C|data''n''}} - data of ''n''<sup>th</sup> slot. Below header, right of label - '''label is optional, will be centred if label absent'''
 +
{{M|n}} ranges from {{M|1}} to {{M|80}} inclusive.
 +
===Stylistic===
 +
# {{C|style}} - Added by Alec to allow extra styling to be specified. Done after default styling so will override. {{c|bodystyle}} contains desirable defaults and was inherited from Wikipedia
 +
 
 +
=Usage & Notes=
 
==Parameters==
 
==Parameters==
 
There are some general 'styling' parameters, some 'title' and subtitle parameters, some 'image' parameters', and then parameters for each of the 80 possible 'rows'
 
There are some general 'styling' parameters, some 'title' and subtitle parameters, some 'image' parameters', and then parameters for each of the 80 possible 'rows'
Line 6: Line 21:
 
* bodyclass
 
* bodyclass
 
* bodystyle
 
* bodystyle
 +
* style - added by Alec, no quotes, inserted at end of style section of outermost div
 
===Title===
 
===Title===
 
* title
 
* title
Line 62: Line 78:
 
|}
 
|}
 
</noinclude><includeonly>
 
</noinclude><includeonly>
{{{!}} class="infobox {{{bodyclass|}}}" cellspacing="5" style="width: 22em; text-align: left; font-size: 88%; line-height: 1.5em; {{{bodystyle|background-color: #F9F9F9;border: 1px solid #DDD;margin: 0.5em 0px 0.5em 1em;padding: 0.2em;float: right;clear: right;}}}"<!--
+
{{{!}} class="infobox {{{bodyclass|}}}" cellspacing="5" style="width: 22em; text-align: left; font-size: 88%; line-height: 1.5em; {{{bodystyle|background-color: #F9F9F9;border: 1px solid #DDD;margin: 0.5em 0px 0.5em 1em;padding: 0.2em;float: right;clear: right;}}}{{{style|}}}"<!--
 
  Caption
 
  Caption
 
-->{{#if:{{{title|}}}|<nowiki/>
 
-->{{#if:{{{title|}}}|<nowiki/>
 
{{!}}+  
 
{{!}}+  
{{!}}class="{{{titleclass|}}}" style="font-size: 125%; font-weight: bold; {{{titlestyle|}}}"{{!}}{{{title}}} }}<!--
+
{{!}} colspan="2" class="{{{titleclass|}}}" style="font-size: 175%; border-bottom:1px solid #ddd;font-weight: bold; {{{titlestyle|}}}"{{!}}{{{title}}} }}<!--
 
  Header
 
  Header
 
-->{{#if:{{{above|}}}|<nowiki/>
 
-->{{#if:{{{above|}}}|<nowiki/>
 
{{!}}-
 
{{!}}-
{{!}}colspan="2" class="{{{aboveclass|}}}" style="text-align:center; font-size: 125%; font-weight: bold; {{{abovestyle|}}}"{{!}}{{{above}}} }}<!--
+
{{!}}colspan="2" class="{{{aboveclass|}}}" style="text-align:center; font-size: 125%; {{{abovestyle|}}}"{{!}}{{{above}}} }}<!--
 
  Subheader
 
  Subheader
 
-->{{#if:{{{subheader|}}}|<nowiki/>
 
-->{{#if:{{{subheader|}}}|<nowiki/>

Latest revision as of 23:49, 17 February 2017

Alec's guide

Definitions

  1. title
  2. above
  3. subheader
  4. image - unsure on syntax would have to test
  5. caption - applies to image - ignored if no image
  6. headern - header in nth slot - optional.
  7. labeln - label of nth slot, below header - Not shown without data
  8. datan - data of nth slot. Below header, right of label - label is optional, will be centred if label absent

[ilmath]n[/ilmath] ranges from [ilmath]1[/ilmath] to [ilmath]80[/ilmath] inclusive.

Stylistic

  1. style - Added by Alec to allow extra styling to be specified. Done after default styling so will override. bodystyle contains desirable defaults and was inherited from Wikipedia

Usage & Notes

Parameters

There are some general 'styling' parameters, some 'title' and subtitle parameters, some 'image' parameters', and then parameters for each of the 80 possible 'rows'

Style

  • bodyclass
  • bodystyle
  • style - added by Alec, no quotes, inserted at end of style section of outermost div

Title

  • title
  • titleclass
  • titlestyle
  • above
  • aboveclass
  • abovestyle
  • subheader
  • subheaderclass
  • subheaderstyle

Image

  • image
  • imageclass
  • imagestyle
  • caption
  • captionstyle

Rows

For all rows

  • headerstyle
  • labelstyle
  • datastyle

For specific rows

For each of the 80 possible rows, replace the 'N' below with the number (e.g. 'header3', 'header80')

  • headerN
  • labelN
  • dataN
  • classN

Example

Code Output
{{Infobox|title=TITLE
|above=ABOVE
|subheader=SUBHEADER
|image=[[Image:Some_image.jpg]]
|caption=IMAGE_CAPTION
|header1=HEADER_1
|label1=LABEL_1
|data1=DATA_1
}}
TITLE
ABOVE
SUBHEADER
File:Some image.jpg

IMAGE_CAPTION

HEADER_1
LABEL_1 DATA_1