Template:Message: Difference between revisions
Template page
More actions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="Template:Message.css" /><div class="message-{{{style|info}}} message"> | <includeonly><templatestyles src="Template:Message.css" />{{#tag:div| | ||
{{{ | {{#if {{{title|}}} | | ||
{{#tag:div| | |||
<span> | |||
{{#tag:i|| | |||
class=icon-{{#switch: {{{style}}} | |||
| info = message-circle-question-mark | |||
| danger = message-circle-x | |||
| success = message-circle-heart | |||
| warning = message-circle-warning | |||
}} | |||
}} | |||
</span> | |||
<span>{{{title}}}</span> | |||
|class=message-title}} | |||
|}} | |||
{{{text}}} | |||
|class=message-{{{style|info}}} message | |||
}} | |||
<div class="message-{{{style|info}}} message"> | |||
{{#if {{{title|}}} | <div class="message-title">{{{title}}}</div> | }} | |||
{{{text}}} | |||
</div></includeonly><noinclude> | </div></includeonly><noinclude> | ||
This template can be used to add message boxes to other pages, using a list of supported styles. | This template can be used to add message boxes to other pages, using a list of supported styles. | ||
== Example == | == Example == | ||
<pre><nowiki>{{Message|Warning text!|style=warning}}</nowiki></pre> {{Message|Warning text!|style=warning}} | <pre><nowiki>{{Message|title=Title|text=Warning text!|style=warning}}</nowiki></pre> {{Message|Warning text!|style=warning}} | ||
== Supported Styles == | == Supported Styles == | ||
| Line 15: | Line 44: | ||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude><templatedata> | ||
{ | |||
"params": { | |||
"style": { | |||
"label": "Style", | |||
"type": "string", | |||
"suggestedvalues": [ | |||
"info", | |||
"danger", | |||
"warning", | |||
"success" | |||
], | |||
"default": "info" | |||
}, | |||
"title": { | |||
"label": "Title", | |||
"type": "string" | |||
}, | |||
"text": { | |||
"label": "Text", | |||
"type": "string", | |||
"required": true | |||
} | |||
}, | |||
"description": "A message box containing important information to be made more prominent.", | |||
"format": "block" | |||
} | |||
</templatedata> | |||
Revision as of 12:00, 23 October 2025
This template can be used to add message boxes to other pages, using a list of supported styles.
Example
{{Message|title=Title|text=Warning text!|style=warning}}
Supported Styles
A message box containing important information to be made more prominent.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Style | style | no description
| String | optional |
| Title | title | no description | String | optional |
| Text | text | no description | String | required |