Template:Message: Difference between revisions
Template page
More actions
mNo edit summary |
No edit summary |
||
| (42 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<noinclude> | <includeonly><templatestyles src="Template:Message.css" />{{#tag:div| | ||
{{#if: {{{title|}}} | | |||
{{#tag:div|{{#tag:i|| | |||
class=icon-{{#switch: {{{style}}} | |||
| info = message-circle-more | |||
| danger = message-circle-warning | |||
| success = message-circle-heart | |||
| warning = message-circle-warning | |||
}}}}{{#tag:span|{{{title}}} }} | |||
|class=message-title}} | |||
|}} | |||
{{{text}}} | |||
|class=message-{{{style|info}}} message | |||
}}</includeonly><noinclude> | |||
<templatedata> | |||
{ | |||
"params": { | |||
"style": { | |||
"label": "Style", | |||
"type": "string", | |||
"suggestedvalues": [ | |||
"info", | |||
"danger", | |||
"warning", | |||
"success" | |||
], | |||
"default": "info", | |||
"description": "Message box style, which defines the colours and icon." | |||
}, | |||
"title": { | |||
"label": "Title", | |||
"type": "string", | |||
"description": "Message box title, to display next to the icon." | |||
}, | |||
"text": { | |||
"label": "Text", | |||
"type": "string", | |||
"required": true, | |||
"description": "Message box main text." | |||
} | |||
}, | |||
"description": "A message box containing important information to be made more prominent.", | |||
"format": "block", | |||
"paramOrder": [ | |||
"title", | |||
"text", | |||
"style" | |||
] | |||
} | |||
</templatedata> | |||
<pre><nowiki>{{Message|Warning text!|style=warning}}</nowiki></pre> {{Message|Warning text!|style=warning}} | == Example == | ||
<pre><nowiki>{{Message|title=Title|text=Warning text!|style=warning}}</nowiki></pre> | |||
{{Message|title=Title|text=Warning text!|style=warning}} | |||
== Supported Styles == | == Supported Styles == | ||
{{Message|title=Info (Default)|text=<code><nowiki>style=info</nowiki></code>|style=info}} | |||
{{Message|title=Warning|text=<code><nowiki>style=warning</nowiki></code>|style=warning}} | |||
{{Message|title=Danger|text=<code><nowiki>style=danger</nowiki></code>|style=danger}} | |||
{{Message|title=Success|text=<code><nowiki>style=success</nowiki></code>|style=success}} | |||
</ | |||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 09:57, 25 October 2025
A message box containing important information to be made more prominent.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Title | title | Message box title, to display next to the icon. | String | optional |
| Text | text | Message box main text. | String | required |
| Style | style | Message box style, which defines the colours and icon.
| String | optional |
Example
{{Message|title=Title|text=Warning text!|style=warning}}