Difference between revisions of "Template:Messagebox"

 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
For example, the following markup:
 
For example, the following markup:
  
  <nowiki>{{messagebox|This is a message!}}</nowiki>
+
  <nowiki>{{messagebox|This is a message.}}</nowiki>
  
 
will look like this:
 
will look like this:
  
{{messagebox|This is a message!}}
+
{{messagebox|This is a message.}}
  
You can give a second parameter to change the type of the box:
+
If you use ''two'' parameters, the first one will be the title of the box:
  
* <code><nowiki>{{messagebox|This is informational.|info}}</nowiki></code> → {{messagebox|This is informational.|info}}
+
<nowiki>{{messagebox|Title|This is a message with a title.}}</nowiki>
  
* <code><nowiki>{{messagebox|This is a warning!|warning}}</nowiki></code> → {{messagebox|This is a warning!|warning}}
+
{{messagebox|Title|This is a message with a title.}}
  
</noinclude><includeonly><p class="{{#if:{{{2|}}}|{{{2}}}-box}} message-box"><span>{{{1}}}</span></p></includeonly>
+
You can give a "type" parameter to change the type of the box:
 +
 
 +
* <code><nowiki>{{messagebox|This is informational.|type=info}}</nowiki></code> → {{messagebox|This is informational.|type=info}}
 +
 
 +
* <code><nowiki>{{messagebox|This is a warning!|type=warning}}</nowiki></code> → {{messagebox|This is a warning!|type=warning}}
 +
 
 +
* <code><nowiki>{{messagebox|This tells you to stop here!|type=stop}}</nowiki></code> → {{messagebox|This tells you to stop here!|type=stop}}
 +
 
 +
</noinclude><includeonly><html><figure</html> class="{{#if:{{{type|}}}|{{{type}}}-box}} message-box"<html>></html>{{#if: {{{2|}}}|<html><figcaption></html>{{{1}}}<html></figcaption></html><p>{{{2}}}</p>|<p class="standalone">{{{1}}}</p>}}<html></figure></html></includeonly>

Latest revision as of 21:06, 16 May 2023

This template is used for typesetting messages that you want to be set apart from the surrounding text.

For example, the following markup:

{{messagebox|This is a message.}}

will look like this:

This is a message.

If you use two parameters, the first one will be the title of the box:

{{messagebox|Title|This is a message with a title.}}
Title

This is a message with a title.

You can give a "type" parameter to change the type of the box:

  • {{messagebox|This is informational.|type=info}}

    This is informational.

  • {{messagebox|This is a warning!|type=warning}}

    This is a warning!

  • {{messagebox|This tells you to stop here!|type=stop}}

    This tells you to stop here!