Template:Message: Difference between revisions
Template page
More actions
No edit summary |
No edit summary |
||
| (27 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="Template:Message.css" />{{#tag:div| | <includeonly><templatestyles src="Template:Message.css" />{{#tag:div| | ||
{{#if {{{title|}}} | {{#tag:div| | {{#if: {{{title|}}} | | ||
{{#tag:div|{{#tag:i|| | |||
{{#tag:i|| | |||
class=icon-{{#switch: {{{style}}} | 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}} | |class=message-title}} | ||
|}} | |}} | ||
{{{text}}} | {{{text}}} | ||
|class=message-{{{style|info}}} message | |class=message-{{{style|info}}} message | ||
}} | }}</includeonly><noinclude> | ||
<templatedata> | <templatedata> | ||
{ | { | ||
| Line 38: | Line 25: | ||
"success" | "success" | ||
], | ], | ||
"default": "info" | "default": "info", | ||
"description": "Message box style, which defines the colours and icon." | |||
}, | }, | ||
"title": { | "title": { | ||
"label": "Title", | "label": "Title", | ||
"type": "string" | "type": "string", | ||
"description": "Message box title, to display next to the icon." | |||
}, | }, | ||
"text": { | "text": { | ||
"label": "Text", | "label": "Text", | ||
"type": "string", | "type": "string", | ||
"required": true | "required": true, | ||
"description": "Message box main text." | |||
} | } | ||
}, | }, | ||
"description": "A message box containing important information to be made more prominent.", | "description": "A message box containing important information to be made more prominent.", | ||
"format": "block" | "format": "block", | ||
"paramOrder": [ | |||
"title", | |||
"text", | |||
"style" | |||
] | |||
} | } | ||
</templatedata> | </templatedata> | ||
== Example == | == Example == | ||
<pre><nowiki>{{Message|title=Title|text=Warning text!|style=warning}}</nowiki></pre> {{Message|Warning text!|style=warning}} | <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| | {{Message|title=Info (Default)|text=<code><nowiki>style=info</nowiki></code>|style=info}} | ||
{{Message|warning|style=warning}} | {{Message|title=Warning|text=<code><nowiki>style=warning</nowiki></code>|style=warning}} | ||
{{Message|danger|style=danger}} | {{Message|title=Danger|text=<code><nowiki>style=danger</nowiki></code>|style=danger}} | ||
{{Message|success|style=success}} | {{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}}