Template:Infobox: Difference between revisions

From Vintage Story Wiki
m (fixed to work with modified Template:Infobox/Image)
mNo edit summary
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>
<includeonly>{{#invoke:Infobox|infobox
{|border="1" cellpadding="2" cellspacing="0" style="position:relative; border-radius:7px; font-size:90%; width:200px; float:{{#if:{{{FloatLeft|}}}|left|right}}; margin:{{#if:{{{Margin|}}}|1em|0}};"
|title={{{title|}}}
|-
|subtitle={{{subtitle|}}}
|bgcolor="#000000" colspan="2" style="border-top-right-radius:7px; border-top-left-radius:7px; text-align:center; font-size:13.5px;"|<font color="white">'''{{{Name}}}'''</font>
|width={{{width|}}}
{{#if: {{{Image|}}} |
|image={{{image|}}}
{{Infobox/Image
|images={{{images|}}}
|{{{Image}}}
|imagesize={{{imagesize|}}}
}} }}
|rows={{{rows|}}}}}</includeonly>
|-
<noinclude>{{doc}}</noinclude>
|bgcolor="#000000" colspan="2" class="Bloba" style="text-align:center; font-size:13.5px; border-bottom-right-radius:7px; border-bottom-left-radius:7px;"|[[{{{Type|}}}|<font color="white">'''{{{Type}}}'''</font>]]
|}{{#if:{{{NoBreak|}}}||{{-}} }}
[[Category:Infoboxes]]
</includeonly>
<noinclude>
{{Infobox
|Name=Text
|Image=File:Grid Copper hammer.png
|Type=Test
}}
</noinclude>

Latest revision as of 02:41, 28 August 2022


[view | edit | history | purge this page]Documentation
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
[view | edit | history | purge this page]The above documentation is transcluded from Template:Infobox/doc.