Template:Messagebox/doc: Difference between revisions

From Vintage Story Wiki
m (VeryGoodDog moved page Template:Msgbox/doc to Template:Messagebox/doc: Improve clarity)
m (Update to use Template:Messagebox)
Line 5: Line 5:
== Usage ==
== Usage ==
<pre style="display: table">
<pre style="display: table">
{{Msgbox
{{Messagebox
|bgcol= The background color
|bgcol= The background color
|linecol= The border line color
|linecol= The border line color
Line 49: Line 49:
|-
|-
| <pre>
| <pre>
{{msgbox
{{Messagebox
|image= Grid_Copper_anvil.png
|image= Grid_Copper_anvil.png
|title= This is a message box!
|title= This is a message box!
Line 55: Line 55:
|discuss= true
|discuss= true
}}</pre>  
}}</pre>  
|| {{msgbox
|| {{Messagebox
|image= Grid_Copper_anvil.png
|image= Grid_Copper_anvil.png
|title= This is a message box!
|title= This is a message box!
Line 63: Line 63:
|-
|-
| <pre>
| <pre>
{{msgbox
{{Messagebox
|bgcol= rgba(120,90,60,0.4)
|bgcol= rgba(120,90,60,0.4)
|title=This page is a stub.
|title=This page is a stub.
Line 70: Line 70:
|image=Icon Sign.png
|image=Icon Sign.png
|imagesize=64px}}</pre>
|imagesize=64px}}</pre>
|| {{msgbox
|| {{Messagebox
|bgcol= rgba(120,90,60,0.4)
|bgcol= rgba(120,90,60,0.4)
|title=This page is a stub.
|title=This page is a stub.
Line 79: Line 79:
|-
|-
| <pre>
| <pre>
{{msgbox
{{Messagebox
|bgcol= #cccccc
|bgcol= #cccccc
|linecol= #88acf5
|linecol= #88acf5
Line 86: Line 86:
|css= box-shadow: 5px 5px 1px #787878;
|css= box-shadow: 5px 5px 1px #787878;
}}</pre>
}}</pre>
|| {{msgbox
|| {{Messagebox
|bgcol= #cccccc
|bgcol= #cccccc
|linecol= #88acf5
|linecol= #88acf5

Revision as of 16:14, 16 May 2023

This template produces a wide message box capable of displaying various amounts of information in both its' title and body text along with an optional image. Generally used as a top-of-page notification informing the reader of the pages' or subject of interests' condition.

This is the base template that all other message box templates should inherit from, as it allows for cascading style changes i.e. any CSS changes made here will affect all children templates, preventing excessive work when a change is needed. It should generally only be used for making new templates, unless a single article has an edge case use for it.

Usage

{{Messagebox
|bgcol= The background color
|linecol= The border line color
|mini= If the template is miniature
|width= The width of the template relative to the article
|image= An image to display on the left
|imagesize= The size of the image
|title= The title to display
|text= The text to display
|discuss= If a talk link should be appended to the title
|css= Any supplemental CSS to apply to the main div
}}
Parameters Description Type Required
bgcol The color for the background string no
line col The color of the border string no
mini If the template should switch to mini mode boolean no
width The width in % of the template relative to the article string no
image The image to show on the left side of the message box file no
imagesize The size of the image to display string no
title Text to display as a title, above the body text content suggested
text Text to display in the body text, below the title content suggested
discuss If Template:Discuss should be appended to the title boolean no
css Extra CSS to apply to the message box's main body string no

Examples

Code Result
{{Messagebox
|image= Grid_Copper_anvil.png
|title= This is a message box!
|text= With some descriptive text added as a subtitle
|discuss= true
}}
Grid Copper anvil.png

This is a message box![discuss]
With some descriptive text added as a subtitle

{{Messagebox
|bgcol= rgba(120,90,60,0.4)
|title=This page is a stub.
|text=This page does not contain as much information as we would like.
If you do wish to contribute, please request wiki edit access on the [https://www.vintagestory.at/forums/topic/267-wiki-discussion/ forum] or the [https://discord.gg/Tndr3w8 Discord].
|image=Icon Sign.png
|imagesize=64px}}
Icon Sign.png

This page is a stub.
This page does not contain as much information as we would like. If you do wish to contribute, please request wiki edit access on the forum or the Discord.

{{Messagebox
|bgcol= #cccccc
|linecol= #88acf5
|text= This is a mini message box, complete with some extra CSS.
|mini= true
|css= box-shadow: 5px 5px 1px #787878;
}}

This is a mini message box, complete with some extra CSS.