Template:Infobox: Difference between revisions

From Vintage Story Wiki
m (...and random infobox test)
mNo edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div style="margin: auto; padding: 4px;  border-color: #382b1e; border-width: 3px; border-style: solid; {{#if: {{{left|}}}|float:left|float:right}}; margin: auto; width: 250px; border-radius: 4px; background-color: #e0cfbb; {{{css|}}}">
<includeonly>{{#invoke:Infobox|infobox
<table style="border-spacing: 2px; width: 100%;">
|title={{{title|}}}
<tr>
|subtitle={{{subtitle|}}}
  <th colspan="2" style="{{#if: {{{titlestyle|}}}|{{{titlestyle}}}|
|width={{{width|}}}
    background: rgb(91,76,62);
|image={{{image|}}}
    background: linear-gradient(to bottom, rgba(91,76,62,1) 0px, rgba(91,76,62,0) 5px, rgba(56,43,30,0) calc(100% - 5px), rgba(56,43,30,1) 100%),
|images={{{images|}}}
                linear-gradient(to right, rgba(91,76,62,1) 0px, rgba(69,52,36,1) 5px, rgba(69,52,36,1) 50%, rgba(69,52,36,1) calc(100% - 5px), rgba(56,43,30,1) 100%);}}">
|imagesize={{{imagesize|}}}
    <big>'''<span style="color: #e0cfbb">{{{title}}}</span>'''</big></th>
|rows={{{rows|}}}}}</includeonly>
</tr>
{{#if: {{{subtitle|}}}|<tr>
  <td colspan="2" style="margin:auto; text-align:center;"><big>{{{subtitle}}}</td>
</tr>}}
{{#if: {{{image|}}}|<tr>
  <td colspan="2" style="margin:auto; text-align:center;">[[File:{{{image|}}}|180px|center]]</td>
</tr>}}
{{#if: {{{group1|}}}|<tr>
  <td>'''{{{group1}}}'''</td>
  <td>{{{body1|}}}</td>
</tr>}}
{{#if: {{{group2|}}}|<tr style="background: #ccbcab">
  <td>'''{{{group2}}}'''</td>
  <td>{{{body2|}}}</td>
</tr>}}
{{#if: {{{group3|}}}|<tr>
  <td>'''{{{group3}}}'''</td>
  <td>{{{body3|}}}</td>
</tr>}}
{{#if: {{{group4|}}}|<tr style="background: #ccbcab">
  <td>'''{{{group4}}}'''</td>
  <td>{{{body4|}}}</td>
</tr>}}
{{#if: {{{group5|}}}|<tr>
  <td>'''{{{group5}}}'''</td>
  <td>{{{body5|}}}</td>
</tr>}}
{{#if: {{{group6|}}}|<tr style="background: #ccbcab">
  <td>'''{{{group6}}}'''</td>
  <td>{{{body6|}}}</td>
</tr>}}
{{#if: {{{group7|}}}|<tr>
  <td>'''{{{group7}}}'''</td>
  <td>{{{body7|}}}</td>
</tr>}}
{{#if: {{{group8|}}}|<tr style="background: #ccbcab">
  <td>'''{{{group8}}}'''</td>
  <td>{{{body8|}}}</td>
</tr>}}
{{#if: {{{group9|}}}|<tr>
  <td>'''{{{group9}}}'''</td>
  <td>{{{body9|}}}</td>
</tr>}}
{{#if: {{{group10|}}}|<tr style="background: #ccbcab">
  <td>'''{{{group10}}}'''</td>
  <td>{{{body10|}}}</td>
</tr>}}
</table>
</div></includeonly>
 
<noinclude>{{doc}}</noinclude>
<noinclude>{{doc}}</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.