This is a documentation for Board Game Arena: play board games online !

Template:InfoBox: Difference between revisions

From Board Game Arena
Jump to navigation Jump to search
(maxWidth variable, parameters documentation)
m (<onlyinclude>)
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div style="max-width:{{{maxWidth|600}}}px;display:flex;flex-flow:column wrap;margin:0.5rem;border-radius:{{{corner|0.5}}}rem;background:{{{colour|linear-gradient(to bottom right,{{{topLeftColour|#c30}}},{{{middleColour|#707}}},{{{bottomRightColour|#70c}}})}}};"><div style="padding:1rem;color:{{{titleColour|#fff}}};text-align:{{{titleAlign|center}}};font-weight:bold;">{{{title}}}</div><div style="margin:0.25rem;border-radius:calc({{{corner|0.5}}}rem / 2);padding:0.25rem;background:{{{bodyBackgroundColour|#fffc}}};">
<onlyinclude><div style="float:{{{float|none}}};clear:both;display:flex;margin:8px;"><div class="mw-collapsible mw-{{{state|}}}"style="display:flex;flex-direction:column;min-width:{{{minWidth|}}};max-width:{{{maxWidth|600}}}px;border-radius:{{{corner|0.5}}}rem;background:{{{background|linear-gradient(135deg,{{{gradientA|#c00}}},{{{gradientB|#703}}},{{{gradientC|#307}}})}}};"><div class="mw-collapsible-toggle"style="padding:0.5rem;text-align:{{{titleAlign|center}}};color:{{{titleColor|#fff}}};font-weight:bold;overflow-wrap:break-word;hyphens:auto;">{{{title|Title}}}</div><div class="mw-collapsible-content"style="margin:0 0.25rem 0.25rem;padding:0.25rem;border-radius:calc({{{corner|0.5}}}rem - 0.25rem);background:{{{bodyBackground|#fffc}}};color:{{{bodyColor|#202122}}};overflow-wrap:break-word;hyphens:auto;">{{{body|Body}}}</div></div></div></onlyinclude>
{{{body}}}
 
</div></div>
To use this infoBox template, type:
<noinclude>
:{{code|<nowiki>{{infoBox</nowiki>}}
To insert this info box template into a BGA wiki page, simply type <code><nowiki>{{infoBox}}</nowiki></code> ''(or <code><nowiki>{{infoBoxes}}</nowiki></code> for a pair of info boxes)'' when editing the page.
:{{code|<nowiki>|title=YourTitle</nowiki>}}
:{{code|<nowiki>|body=YourBody</nowiki>}}
:{{code|<nowiki>}}</nowiki>}}
Replace {{code|YourTitle}} and {{code|YourBody}} when editing the page.
 
== Parameters ==
 
<div style="display:grid;grid-template-columns:repeat(3,max-content) 6rem 1fr;gap:0.5rem;overflow:auto;text-overflow:ellipsis;">
  <div>{{text|w=bold|Id}}</div>
  <div>{{text|w=bold|Default}}</div>
  <div>{{text|w=bold|Example}}</div>
  <div>{{text|w=bold|Result}}</div>
  <div>{{text|w=bold|Description}}</div>
  <div>{{code|title}}</div>
  <div>{{code|Title}}</div>
  <div>{{code|<nowiki>{{infoBox |title=Example}}</nowiki>}}</div>
  <div>{{infoBox |title=Example}}</div>
  <div>Title</div>
  <div>{{code|body}}</div>
  <div>{{code|Body}}</div>
  <div>{{code|<nowiki>{{infoBox |body=Content}}</nowiki>}}</div>
  <div>{{infoBox |body=Content}}</div>
  <div>Text, images, other templates..</div>
  <div>{{code|state}}</div>
  <div>expanded</div>
  <div>{{code|<nowiki>{{infoBox |state=collapsed}}</nowiki>}}</div>
  <div>{{infoBox |state=collapsed}}</div>
  <div>Collapse into a button (wiki only).</div>
  <div>{{code|float}}</div>
  <div>{{code|none}}</div>
  <div>{{code|<nowiki>{{infoBox |float=right}}</nowiki>}}</div>
  <div>{{infoBox |float=right}}</div>
  <div>Place on the {{code|left}} or {{code|right}} side of its container, allowing text to wrap around it.</div>
  <div>{{code|minWidth}}</div>
  <div>none</div>
  <div>{{code|<nowiki>{{infoBox |minWidth=100%}}</nowiki>}}</div>
  <div>{{infoBox |minWidth=100%}}</div>
  <div>Minimum width as a [https://developer.mozilla.org/en-US/docs/Web/CSS/length CSS length] e.g. {{code|500px}}.</div>
  <div>{{code|maxWidth}}</div>
  <div>{{code|600}}</div>
  <div>{{code|<nowiki>{{infoBox |maxWidth=80}}</nowiki>}}</div>
  <div>{{infoBox |maxWidth=80}}</div>
  <div>Maximum width in px units.
 
'''''Tip:''''' {{code|<nowiki>{{infoBox |maxWidth=}}</nowiki>}} removes the maxWidth limit.</div>
  <div>{{code|background}}</div>
  <div>gradient</div>
  <div>{{code|<nowiki>{{infoBox |background=green}}</nowiki>}}</div>
  <div>{{infoBox |background=green}}</div>
  <div>A solid color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}}.</div>
  <div>{{code|gradientA}}</div>
  <div>{{code|#c00}} (red)</div>
  <div>{{code|<nowiki>{{infoBox |gradientA=lightgreen}}</nowiki>}}</div>
  <div>{{infoBox |gradientA=lightgreen}}</div>
  <div>Top left color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}}.</div>
  <div>{{code|gradientB}}</div>
  <div>{{code|#703}} (dark pink)</div>
  <div>{{code|<nowiki>{{infoBox |gradientB=lightgreen}}</nowiki>}}</div>
  <div>{{infoBox |gradientB=lightgreen}}</div>
  <div>Middle color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}}.</div>
  <div>{{code|gradientC}}</div>
  <div>{{code|#307}} (dark blue)</div>
  <div>{{code|<nowiki>{{infoBox |gradientC=lightgreen}}</nowiki>}}</div>
  <div>{{infoBox |gradientC=lightgreen}}</div>
  <div>Bottom right color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}}.</div>
  <div>{{code|bodyBackground}}</div>
  <div>{{code|#fffc}} (translucent white)</div>
  <div>{{code|<nowiki>{{infoBox |bodyBackground=lightgreen}}</nowiki>}}</div>
  <div>{{infoBox |bodyBackground=lightgreen}}</div>
  <div>Body background color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}}.</div>
  <div>{{code|titleColor}}</div>
  <div>white</div>
  <div>{{code|<nowiki>{{infoBox |titleColor=lightgreen}}</nowiki>}}</div>
  <div>{{infoBox |titleColor=lightgreen}}</div>
  <div>Title text color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}}.</div>
  <div>{{code|bodyColor}}</div>
  <div>{{code|#202122}} (black)</div>
  <div>{{code|<nowiki>{{infoBox |bodyColor=green}}</nowiki>}}</div>
  <div>{{infoBox |bodyColor=green}}</div>
  <div>Body color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}}.</div>
  <div>{{code|titleAlign}}</div>
  <div>{{code|center}}</div>
  <div>{{code|<nowiki>{{infoBox |titleAlign=left}}</nowiki>}}</div>
  <div>{{infoBox |titleAlign=left}}</div>
  <div>Title alignment ({{code|left}} or {{code|right}}).</div>
  <div>{{code|corner}}</div>
  <div>{{code|0.5}}</div>
  <div>{{code|<nowiki>{{infoBox |corner=1}}</nowiki>}}</div>
  <div>{{infoBox |corner=1}}</div>
  <div>Corner radius in [https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/length#rem rem units].</div>
</div>
----
{{infoBoxes}}
 
Double infoBox:
:{{code|<nowiki>{{</nowiki>infoBox'''es'''}}
:{{code|<nowiki>|</nowiki>title'''1'''<nowiki>=</nowiki>}}
:{{code|<nowiki>|</nowiki>body'''1'''<nowiki>=</nowiki>}}
:{{code|<nowiki>|</nowiki>title'''2'''<nowiki>=</nowiki>}}
:{{code|<nowiki>|</nowiki>body'''2'''<nowiki>=</nowiki>}}
:{{code|<nowiki>}}</nowiki>}}
 
== Additional parameters ==
 
<div style="display:grid;grid-template-columns:repeat(3,max-content) 1fr;gap:1rem;overflow:auto;text-overflow:ellipsis;">
  <div>{{text|w=bold|Id}}</div>
  <div>{{text|w=bold|Default}}</div>
  <div>{{text|w=bold|Example}}</div>
  <div>{{text|w=bold|Description}}</div>
  <div>{{code|title'''#'''}}</div>
  <div>{{code|Title'''#'''}}</div>
  <div>{{code|<nowiki>{{infoBoxes |title2=Example}}</nowiki>}}</div>
  <div>Title where {{code|'''#'''}} is the InfoBox index.</div>
  <div>{{code|body'''#'''}}</div>
  <div>{{code|Body'''#'''}}</div>
  <div>{{code|<nowiki>{{infoBoxes |body2=Content}}</nowiki>}}</div>
  <div>Body where {{code|'''#'''}} is the InfoBox index.</div>
  <div>{{code|background'''#'''}}</div>
  <div>gradient</div>
  <div>{{code|<nowiki>{{infoBoxes |background2=green}}</nowiki>}}</div>
  <div>Solid color of each infoBox as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}} where {{code|'''#'''}} is the InfoBox index.</div>
  <div>{{code|gradientD}}</div>
  <div>{{code|#00c}} (blue)</div>
  <div>{{code|<nowiki>{{infoBoxes |gradientD=green}}</nowiki>}}</div>
  <div>Bottom right color of the last InfoBox as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}}.</div>
  <div>{{code|title'''#'''color}}</div>
  <div>white</div>
  <div>{{code|<nowiki>{{infoBoxes |title2Color=black}}</nowiki>}}</div>
  <div>Title text color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}} where {{code|'''#'''}} is the InfoBox index.</div>
</div>
 
----
{{infoBoxes3}}
 
Triple infoBox:
:{{code|<nowiki>{{</nowiki>infoBoxes'''3'''}}
:{{code|<nowiki>|</nowiki>title1<nowiki>=</nowiki>}}
:{{code|<nowiki>|</nowiki>body1<nowiki>=</nowiki>}}
:{{code|<nowiki>|</nowiki>title2<nowiki>=</nowiki>}}
:{{code|<nowiki>|</nowiki>body2<nowiki>=</nowiki>}}
:{{code|<nowiki>|</nowiki>title'''3'''<nowiki>=</nowiki>}}
:{{code|<nowiki>|</nowiki>body'''3'''<nowiki>=</nowiki>}}
:{{code|<nowiki>}}</nowiki>}}


== Available parameters ==
== Additional parameters ==


<div style="display:grid;grid-template-columns:repeat(4,max-content);gap:1rem;overflow:hidden;text-overflow:ellipsis;">
<div style="display:grid;grid-template-columns:repeat(3,max-content) 1fr;gap:1rem;overflow:auto;text-overflow:ellipsis;">
   <div style="font-weight:bold;width:8rem;">Parameter</div>
   <div>{{text|w=bold|Id}}</div>
  <div style="font-weight:bold;width:8rem;">Default value</div>
   <div>{{text|w=bold|Default}}</div>
  <div style="font-weight:bold;width:8rem;">Example</div>
   <div>{{text|w=bold|Example}}</div>
  <div style="font-weight:bold;width:8rem;">Description</div>
   <div>{{text|w=bold|Description}}</div>
  <div><code>title</code></div>
   <div>{{code|gradientE}}</div>
  <div><code>null</code></div>
   <div>{{code|#037}} (dark cyan)</div>
  <div><code><nowiki>{{quoridorboard |title=Your title text}}</nowiki></code></div>
   <div>{{code|<nowiki>{{infoBoxes3 |gradientE=green}}</nowiki>}}</div>
  <div><b><i>Optional:</i></b> specify a title for the infoBox.</div>
   <div>Bottom right color of the last InfoBox as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color] e.g. {{code|green}}.</div>
   <div><code>body</code></div>
  <div><code>null</code></div>
  <div><code><nowiki>{{quoridorboard |body=Your body content}}</nowiki></code>.</div>
  <div><b><i>Optional:</i></b> specify any body content.</div>
  <div><code>maxWidth</code></div>
  <div><code>600</code></div>
   <div><code><nowiki>{{quoridorboard |maxWidth=400}}</nowiki></code></div>
  <div><b><i>Optional:</i></b> specify the maximum width of the infoBox.</div>
   <div><code>topLeftColour</code></div>
  <div><code>#c30</code></div>
  <div><code><nowiki>{{quoridorboard |topLeftColour=red}}</nowiki></code></div>
   <div><b><i>Optional:</i></b> specify the top left corner colour gradient of the infoBox as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour] e.g. <code>blue</code>.</div>
  <div><code>middleColour</code></div>
  <div><code>#707</code></div>
  <div><code><nowiki>{{quoridorboard |middleColour=green}}</nowiki></code></div>
   <div><b><i>Optional:</i></b> specify the middle colour gradient of the infoBox as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour] e.g. <code>blue</code>.</div>
  <div><code>bottomRightColour</code></div>
  <div><code>#70c</code></div>
   <div><code><nowiki>{{quoridorboard |bottomRightColour=blue}}</nowiki></code></div>
   <div><b><i>Optional:</i></b> specify the bottom right corner colour gradient of the infoBox as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour] e.g. <code>blue</code>.</div>
  <div><code>titleColour</code></div>
  <div><code>#fff</code></div>
  <div><code><nowiki>{{quoridorboard |titleColour=black}}</nowiki></code></div>
  <div><b><i>Optional:</i></b> specify the title text colour as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour] e.g. <code>blue</code>.</div>
  <div><code>corner</code></div>
  <div><code>0.5</code></div>
  <div><code><nowiki>{{quoridorboard |corner=1}}</nowiki></code></div>
  <div><b><i>Optional:</i></b> specify the corner radius of the infoBox  in rem units.</div>
</div>
</div>
<noinclude>
== [[:Category:TextTemplates]] ==
{{Category:TextTemplates}}


== Pages using {{FULLPAGENAME}} ==
{{Special:WhatLinksHere/{{FULLPAGENAME}}}}
</noinclude>
</noinclude>
[[Category:TextTemplates]]

Latest revision as of 17:24, 8 July 2026

Title
Body

To use this infoBox template, type:

{{infoBox
|title=YourTitle
|body=YourBody
}}

Replace YourTitle and YourBody when editing the page.

Parameters

Id
Default
Example
Result
Description
title
Title
{{infoBox |title=Example}}
Example
Body
Title
body
Body
{{infoBox |body=Content}}
Title
Content
Text, images, other templates..
state
expanded
{{infoBox |state=collapsed}}
Title
Body
Collapse into a button (wiki only).
float
none
{{infoBox |float=right}}
Title
Body
Place on the left or right side of its container, allowing text to wrap around it.
minWidth
none
{{infoBox |minWidth=100%}}
Title
Body
Minimum width as a CSS length e.g. 500px.
maxWidth
600
{{infoBox |maxWidth=80}}
Title
Body
Maximum width in px units. Tip: {{infoBox |maxWidth=}} removes the maxWidth limit.
background
gradient
{{infoBox |background=green}}
Title
Body
A solid color as a CSS color e.g. green.
gradientA
#c00 (red)
{{infoBox |gradientA=lightgreen}}
Title
Body
Top left color as a CSS color e.g. green.
gradientB
#703 (dark pink)
{{infoBox |gradientB=lightgreen}}
Title
Body
Middle color as a CSS color e.g. green.
gradientC
#307 (dark blue)
{{infoBox |gradientC=lightgreen}}
Title
Body
Bottom right color as a CSS color e.g. green.
bodyBackground
#fffc (translucent white)
{{infoBox |bodyBackground=lightgreen}}
Title
Body
Body background color as a CSS color e.g. green.
titleColor
white
{{infoBox |titleColor=lightgreen}}
Title
Body
Title text color as a CSS color e.g. green.
bodyColor
#202122 (black)
{{infoBox |bodyColor=green}}
Title
Body
Body color as a CSS color e.g. green.
titleAlign
center
{{infoBox |titleAlign=left}}
Title
Body
Title alignment (left or right).
corner
0.5
{{infoBox |corner=1}}
Title
Body
Corner radius in rem units.

Title1
Body1
Title2
Body2

Double infoBox:

{{infoBoxes
|title1=
|body1=
|title2=
|body2=
}}

Additional parameters

Id
Default
Example
Description
title#
Title#
{{infoBoxes |title2=Example}}
Title where # is the InfoBox index.
body#
Body#
{{infoBoxes |body2=Content}}
Body where # is the InfoBox index.
background#
gradient
{{infoBoxes |background2=green}}
Solid color of each infoBox as a CSS color e.g. green where # is the InfoBox index.
gradientD
#00c (blue)
{{infoBoxes |gradientD=green}}
Bottom right color of the last InfoBox as a CSS color e.g. green.
title#color
white
{{infoBoxes |title2Color=black}}
Title text color as a CSS color e.g. green where # is the InfoBox index.

Title1
Body1
Title2
Body2
Title3
Body3

Triple infoBox:

{{infoBoxes3
|title1=
|body1=
|title2=
|body2=
|title3=
|body3=
}}

Additional parameters

Id
Default
Example
Description
gradientE
#037 (dark cyan)
{{infoBoxes3 |gradientE=green}}
Bottom right color of the last InfoBox as a CSS color e.g. green.

Category:TextTemplates

Text Templates

Pages using Template:InfoBox