Template:Messagebox: Difference between revisions
No edit summary |
VeryGoodDog (talk | contribs) m (replace the messagebox category with notice templates) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
{{#if: {{{text|}}} | {{{text}}} }} | {{#if: {{{text|}}} | {{{text}}} }} | ||
</div></div></div></includeonly> | </div></div></div></includeonly> | ||
<noinclude>{{doc}}</noinclude> | <noinclude>{{doc}}[[Category:Notice_templates]]</noinclude> |
Latest revision as of 16:29, 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.
Category:Notice_templates shows all notice templates.
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 }} |
This is a message box![discuss] |
{{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://discord.gg/Tndr3w8 Discord]. |image=Icon Sign.png |imagesize=64px}} |
This page is a stub. |
{{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. |