Template:Infobox: Difference between revisions

From Inkipedia, the Splatoon wiki
m (Removing extra new line)
(add optional gobbler title)
 
(17 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<includeonly>{{BubbleBox|open|border={{{color|}}}|background=rgba({{#if:{{{color|}}}|{{{color}}}|{{SiteColor|Generic}}}}, 0.15)|style=width: 350px; padding: 8px; float: right; {{{style|}}}}}
<includeonly>{{BubbleBox|tags=tagInfobox|open|border={{{color|}}}|background=rgba({{#if:{{{color|}}}|{{{color}}}|{{SiteColor|Generic}}}}, 0.15)
|style=width: 350px; padding: 8px; float: right; {{{style|}}}}}
<span class="tagTab" style="display: none; padding: 2px; margin-right: 2px; cursor: default; border-width: 1px 3px 1px 3px; border-style: solid; border-radius: 4px; font-size: 12px; border-color: rgba({{#if:{{{color|}}}|{{{color}}}|{{SiteColor|Generic}}}}, 0.5); background-color: rgba({{#if:{{{color|}}}|{{{color}}}|{{SiteColor|Generic}}}}, 0.2); outline-color: rgba({{#if:{{{color|}}}|{{{color}}}|{{SiteColor|Generic}}}}, 0.3); ">{{{gobbler title|{{{title|{{PAGENAME}}}}}}}}&#8203;</span>
{{InfoboxTitle|color={{{color|}}}|{{{title|{{PAGENAME}}}}}}}
{{InfoboxTitle|color={{{color|}}}|{{{title|{{PAGENAME}}}}}}}
<div style="text-align: center; margin: 8px; max-width: 334px;">{{#if:{{{logo|}}}|[[File:{{{logo|}}}|frameless|334x250px]]<br />}}[[File:{{{image|Example.png}}}|frameless|334x250px]]{{#if:{{{caption|}}}|<br />''{{{caption}}}''}}</div>
<div style="text-align: center; margin: 8px;">{{#if:{{{logo|}}}|[[File:{{{logo|}}}|frameless|334x250px]]<br />}}{{#if:{{{image|}}}|[[File:{{{image|Example.png}}}|frameless|334x250px]]}}{{#if:{{{caption|}}}|<br />''{{{caption}}}''}}</div><!--
{{#ifeq:{{{1|}}}|open||{{{1|}}}</div>}}
-->{{#ifeq:{{{1|}}}|open||{{{1|}}}</div>}}<!--
</includeonly><noinclude>__NOTOC__
--></includeonly><noinclude>__NOTOC__
Produces a basic infobox for a game.
Produces a basic infobox for a game.


Line 16: Line 18:
|- style="vertical-align: top;"
|- style="vertical-align: top;"
|<code>title</code>||Optional.||The title. If absent, the page name is used.
|<code>title</code>||Optional.||The title. If absent, the page name is used.
|- style="vertical-align: top;"
|<code>gobbler title</code>||Optional.||The title text used for the [[Template:InfoboxGobbler]] tab. If absent, <code>title</code> is used.
|- style="vertical-align: top;"
|- style="vertical-align: top;"
|<code>logo</code>||Optional.||The filename of the logo to display.
|<code>logo</code>||Optional.||The filename of the logo to display.
Line 30: Line 34:
|color    = {{SiteColor|Splatoon}}
|color    = {{SiteColor|Splatoon}}
|title    = Splatoon
|title    = Splatoon
|image    = Boxart.jpg
|image    = Splatoon NA Box Art.jpg
|caption  = North American box art
|caption  = North American box art
}}</nowiki>
}}</nowiki>
Line 38: Line 42:
|color    = {{SiteColor|Splatoon}}
|color    = {{SiteColor|Splatoon}}
|title    = Splatoon
|title    = Splatoon
|image    = Boxart.jpg
|image    = Splatoon NA Box Art.jpg
|caption  = North American box art
|caption  = North American box art
}}
}}
Line 60: Line 64:
|color    = {{SiteColor|Generic}}
|color    = {{SiteColor|Generic}}
|title    = Moray Towers
|title    = Moray Towers
|image    = Splatoon Stage Moray Towers.png
|image    = S Stage Moray Towers.png
|caption  = Horizontal image
|caption  = Horizontal image
}}</nowiki>
}}</nowiki>
Line 68: Line 72:
|color    = {{SiteColor|Generic}}
|color    = {{SiteColor|Generic}}
|title    = Moray Towers
|title    = Moray Towers
|image    = Splatoon Stage Moray Towers.png
|image    = S Stage Moray Towers.png
|caption  = Horizontal image
|caption  = Horizontal image
}}
}}
{{clr}}
<nowiki>{{Infobox|open|
|color    = {{SiteColor|Side Order}}
|title    = Side Order
|caption  = Example
}}
{| style="border-spacing: 4px;"
{{Infobox/Property|color={{SiteColor|Side Order}}|Field 1|Text 1}}
|}</div>
</nowiki>
==== Output ====
{{Infobox|open|
|color    = {{SiteColor|Side Order}}
|title    = Side Order
|caption  = Example
}}
{| style="border-spacing: 4px;"
{{Infobox/Property|color={{SiteColor|Side Order}}|Field 1|Text 1}}
|}</div>
{{clr}}
{{clr}}


  <nowiki>{{Infobox|open|color={{SiteColor|NIWA}}}}
  <nowiki>{{Infobox|open|color={{SiteColor|NIWA}}}}
{| style="border-spacing: 4px;"
{| style="border-spacing: 4px;"
{{InfoboxProperty|color={{SiteColor|NIWA}}|Field 1|Text 1}}
{{Infobox/Property|color={{SiteColor|NIWA}}|Field 1|Text 1}}
{{InfoboxProperty|color={{SiteColor|NIWA}}|Field 2|Text 2}}
{{Infobox/Property|color={{SiteColor|NIWA}}|Field 2|Text 2}}
|}</div></nowiki>
|}</div></nowiki>


Line 83: Line 108:


{| style="border-spacing: 4px;"
{| style="border-spacing: 4px;"
{{InfoboxProperty|color={{SiteColor|NIWA}}|Field 1|Text 1}}
{{Infobox/Property|color={{SiteColor|NIWA}}|Field 1|Text 1}}
{{Infobox/Property|color={{SiteColor|NIWA}}|Field 2|Text 2}}
|}</div>
 
{{clr}}
 
<nowiki>{{Infobox|open|color={{SiteColor|Salmon Run}}}}
{| style="border-spacing: 4px;"
{{Infobox/Property|color={{SiteColor|Salmon Run}}|Field 1|Text 1}}
{{Infobox/Property|color={{SiteColor|Salmon Run}}|Field 2|Text 2}}
|}</div></nowiki>
 
==== Output ====
{{Infobox|open|color={{SiteColor|Salmon Run}}}}
 
{| style="border-spacing: 4px;"
{{Infobox/Property|color={{SiteColor|Salmon Run}}|Field 1|Text 1}}
{{Infobox/Property|color={{SiteColor|Salmon Run}}|Field 2|Text 2}}
|}</div>
 
{{clr}}
 
<nowiki>{{Infobox|open|color={{SiteColor|default example}}}}
{| style="border-spacing: 4px;"
{{Infobox/Property|color={{SiteColor|default example}}|Field 1|Text 1}}
{{Infobox/Property|color={{SiteColor|default example}}|Field 2|Text 2}}
|}</div></nowiki>


{{InfoboxProperty|color={{SiteColor|NIWA}}|Field 2|Text 2}}
==== Output ====
{{Infobox|open|color={{SiteColor|default example}}}}
{| style="border-spacing: 4px;"
{{Infobox/Property|color={{SiteColor|default example}}|Field 1|Text 1}}
{{Infobox/Property|color={{SiteColor|default example}}|Field 2|Text 2}}
|}</div>
|}</div>


{{clr}}
{{clr}}
{{Documentation}}
</noinclude>
</noinclude>

Latest revision as of 22:03, 25 February 2024

Produces a basic infobox for a game.

Parameters

open Optional. Like with {{BubbleBox}}, the "open" parameter leaves the table open (unclosed div) for further customization.
color Optional. An RGB triplet to use as the base color for formatting. The default color is {{SiteColor|<Generic>}}.
style Optional. A CSS property list to apply to the top-level container.
title Optional. The title. If absent, the page name is used.
gobbler title Optional. The title text used for the Template:InfoboxGobbler tab. If absent, title is used.
logo Optional. The filename of the logo to display.
image Optional. The filename of the image to display.
caption Optional. Text displayed below the image.

Example

Markup

{{Infobox
|color     = {{SiteColor|Splatoon}}
|title     = Splatoon
|image     = Splatoon NA Box Art.jpg
|caption   = North American box art
}}

Output

Splatoon
Splatoon NA Box Art.jpg
North American box art
{{Infobox
|color     = {{SiteColor|Splatoon 2}}
|title     = Splatoon 2
|caption   = Example
}}

Output

Splatoon 2

Example
{{Infobox
|color     = {{SiteColor|Generic}}
|title     = Moray Towers
|image     = S Stage Moray Towers.png
|caption   = Horizontal image
}}

Output

Moray Towers
S Stage Moray Towers.png
Horizontal image
{{Infobox|open|
|color     = {{SiteColor|Side Order}}
|title     = Side Order
|caption   = Example
}}
{| style="border-spacing: 4px;"
{{Infobox/Property|color={{SiteColor|Side Order}}|Field 1|Text 1}}
|}</div>

Output

Side Order

Example
Field 1 Text 1
{{Infobox|open|color={{SiteColor|NIWA}}}}
{| style="border-spacing: 4px;"
{{Infobox/Property|color={{SiteColor|NIWA}}|Field 1|Text 1}}
{{Infobox/Property|color={{SiteColor|NIWA}}|Field 2|Text 2}}
|}</div>

Output

Infobox
Field 1 Text 1
Field 2 Text 2
{{Infobox|open|color={{SiteColor|Salmon Run}}}}
{| style="border-spacing: 4px;"
{{Infobox/Property|color={{SiteColor|Salmon Run}}|Field 1|Text 1}}
{{Infobox/Property|color={{SiteColor|Salmon Run}}|Field 2|Text 2}}
|}</div>

Output

Infobox
Field 1 Text 1
Field 2 Text 2
{{Infobox|open|color={{SiteColor|default example}}}}
{| style="border-spacing: 4px;"
{{Infobox/Property|color={{SiteColor|default example}}|Field 1|Text 1}}
{{Infobox/Property|color={{SiteColor|default example}}|Field 2|Text 2}}
|}</div>

Output

Infobox
Field 1 Text 1
Field 2 Text 2



Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit Template:Infobox/doc to edit this documentation. (How does this work?)

Description

This template is a sample infobox, to aid in the creation of new infoboxes.

Recommended usage: copy the template code to a new template page, and edit it there.

Infobox and template background

See Help:Templates, Help:Infobox and Help:Tables for some background on how templates and infoboxes work.

Building blocks

The infobox is made of the following basic building blocks:

  • Overall table class: class="wikia-infobox"
  • Table heading cell class: class="wikia-infobox-header"
  • Use row header marks ("!") for row title cells (and "|" for normal cells)
  • Section separator line: give the header below it a wrapping div with class="wikia-infobox-section-header"
  • Image cell class: class="wikia-infobox-image"
  • Image caption cell class: class="wikia-infobox-caption"

Other notes

  • The Title, First, Second, and Third rows show "Unknown" if their values are not specified.
  • The Image, Imagecaption, Fourth, Fifth, and Sixth rows won't show up if their values are not specified: they are each completely enclosed in an 'if' statement.

Syntax

{{infobox
 | title         = 
 | image         = [e.g. "Example.jpg"]
 | imagewidth    = [e.g. "150"] [default: 210 pixels]
 | imagecaption  = 
 | first         =
 | second        =
 | third         =
 | fourth        =
 | fifth         =
 | sixth         =
}}

Samples

{{infobox
 | title         = A pretty flower
 | image         = Example.jpg
 | imagewidth    = 100
 | imagecaption  = Floweris flowerum
 | first         = Pink and green
 | second        = Outdoors
 | fourth        = Annual
}}

Results in...

A pretty flower
Example.png