Template:Infobox/doc: Difference between revisions

From Vintage Story Wiki
mNo edit summary
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
This template serves as the base for any infobox templates, providing a customizable layout to build off of. Each infobox can currently contain up to 10 lines of information.  
{{Lua|Infobox}}
This template serves as the base for any infobox templates, providing a customizable layout to build off of. Each row is created using [[Template:Infobox row]].


== Usage ==
== Usage ==
While the parameters up to only group2 are listed here, it is possible to have up to 10 different groups <code>group1-10</code>. The content of <code>bodyN</code> can contain a child navbox which has <code>child=true</code>, allowing for up to 10 subgroups per group.
<pre style="display: table">
<pre style="display: table">
{{Infobox
{{Infobox
Line 10: Line 9:
|image = An image to display beneath the title
|image = An image to display beneath the title
|align = Whether or not to align this infobox to the left
|align = Whether or not to align this infobox to the left
|group1 = First line title
|rows = Rows of content, use {{Infobox row}}
|body1 = First line body content
|group2 = Second line title
|body2 = Second line body content
|groupN = N line title
|bodyN = N line body content
|titlestyle = Optional title bar CSS
|titlestyle = Optional title bar CSS
|css = Optional main infobox CSS
|css = Optional main infobox CSS
Line 32: Line 26:
| align || Override to align this infobox differently || CSS || no
| align || Override to align this infobox differently || CSS || no
|-
|-
| group1 || The title for the first group || Content || suggested
| rows || Rows of content || Content || yes
|-
| body1 || The content to feature in the first groups' body || Content || suggested
|-
| group2 || The title for the second group || Content || no
|-
| body2 || The content to feature in the second groups' body || Content || no
|-
| groupN || The title for the N group || Content || no
|-
| bodyN || The content to feature in the N groups' body || Content || no
|-
|-
| titlestyle || Optional CSS to be added to the title bar's style || CSS || no
| titlestyle || Optional CSS to be added to the title bar's style || CSS || no
Line 56: Line 40:
| style="width: 30%"|<pre>{{Infobox
| style="width: 30%"|<pre>{{Infobox
|title = Infobox
|title = Infobox
|subtitle = Subtitle
|image = Move_arrows
|image = File:move_arrow.png
|rows = {{Infobox row | Label | Field}}
|group1 = Line 1
|body1 = Line 1 content
|group2 = Line 2
|body2 = Line 2 content
|group3 = Line 3
|body3 = Line 3 content
}}</pre>
}}</pre>
||
||
{{Infobox
{{Infobox
|title = Infobox
|title = Infobox
|subtitle = Subtitle
|image = Move_arrows
|align=align:none
|rows = {{Infobox row | Label | Field}}
|image = Move_arrows.png
|group1 = Line 1
|body1 = Line 1 content
|group2 = Line 2
|body2 = Line 2 content
|group3 = Line 3
|body3 = Line 3 content
}}
}}
|}
|}
<includeonly>[[Category:Infobox templates]]</includeonly>
<includeonly>[[Category:Infobox templates]]</includeonly>

Latest revision as of 00:21, 18 August 2022

Lua-Logo.png

This template uses Module:Infobox, a script written in Lua.


This template serves as the base for any infobox templates, providing a customizable layout to build off of. Each row is created using Template:Infobox row.

Usage

{{Infobox
|title = Infobox title
|subtitle = Optional subtitle
|image = An image to display beneath the title
|align = Whether or not to align this infobox to the left
|rows = Rows of content, use {{Infobox row}}
|titlestyle = Optional title bar CSS
|css = Optional main infobox CSS
}}
Parameter Description Type Required
title The title shown at the top of the infobox String yes
subtitle A smaller subtitle shown below the title box String no
image An image to be displayed beneath the title bar File no
align Override to align this infobox differently CSS no
rows Rows of content Content yes
titlestyle Optional CSS to be added to the title bar's style CSS no
css Optional CSS to be applied to the entire infobox's style CSS no

Example

Code Result
{{Infobox
|title = Infobox
|image = Move_arrows
|rows = {{Infobox row | Label | Field}}
}}
Infobox
Move arrows.png
Label Field