Template:Notice: Difference between revisions

Template page
(Created template)
 
(Removed the "message" parameter)
Line 27: Line 27:
   }}
   }}
  }}}
  }}}
  | content    = {{{message}}}
  | content    = {{{1}}}
}}</includeonly><noinclude>
}}</includeonly><noinclude>
{{doc}}
{{doc}}
</noinclude>
</noinclude>

Revision as of 17:24, 12 August 2016

{{❢}} Template documentation

This template is for creating notices. Notices are intended for presenting information that really stands out. They are much more disruptive than section notes, so you shouldn't use them as part of the regular text of a page. They are more for things you really want to jump out at the reader, like warnings.

This template is for general use, and it provides several standard notice types. While it does allow you to create custom notice types, it is not really intended for that purpose. For creating custom notice boxes, you should make a new template based on {{notice box}}.

Usage

The most basic usage is simply providing the notice box content.

{{notice
 | This is the notice box content.
}}

Produces:

{{❢}} Notice
This is the notice box content.

For different types of notices, you can use the type argument. For example, to create an error notice, you could do:

{{notice
 | type = error
 | This is the notice box content.
}}

Which produces:

{{❢}} Error
This is the notice box content.

The recognized types are listed below.

Custom titles

By default, the notice box's title will be the type (which defaults to notice). However, it is possible to change the title of the message box with the title argument.

{{notice
 | type  = question
 | title = Just what do you think you're doing?
 | This is not a wise course of action.
}}

Produces:

{{❓}} Just what do you think you're doing?
This is not a wise course of action.

Types

The recognized types are:

notice
For general notices.
information
For giving additional information. (info is a shorthand synonym.)
question
For describing unanswered questions.
caution
For telling the reader to be careful about something.
warning
For informing the reader about a problem that isn't serious enough to change anything, but that they should be aware of.
problem
For informing the reader about a serious problem that probably has noticeable impacts.

By default, type is set to notice. Unrecognized types also fall back to notice.

Type examples

notice
{{❢}} Notice
Content.
information
{{❢}} Information
Content.
question
{{❓}} Question
Content.
caution
{{❢}} Caution
Content.
warning
{{❢}} Warning
Content.
problem
{{❢}} Problem
Content.

Notice box customization

Most everything in a notice is customizable.

title
By default, the notice box's title is the type of notice box being used (which defaults to notice).
icon
Sets the icon used in the top left corner. Set it to blank to remove the icon. To make icons easily, you can use {{notice icon}}.
background
Sets the background colour of the notice box. You can use anything recognized by CSS as a colour.

For a truly customizable notice box that you will use multiple times, a better plan might be to create a new template based on {{notice box}}.

Notes

Because of the nature of wiki markup, you have to be careful about how you format your content text. Normally when you have two lines of text separated by a single newline, they get joined into a single paragraph:

This is line 1.
This is line 2.

produces:

This is line 1. This is line 2.

That works in the content of a notice box... except for the last line:

{{notice
 | This is line 1.
This is line 2.

This is line 3.
This is line 4.

This is line 5.
This is line 6.
}}

Produces:

{{❢}} Notice

This is line 1. This is line 2.

This is line 3. This is line 4.

This is line 5.

This is line 6.

Notice that lines 5 and 6 are separated into two paragraphs.

To prevent this, you can do:

{{notice
 | This is line 1.
This is line 2.

This is line 3.
This is line 4.

This is line 5.
This is line 6.

<nowiki/>}}

to get:

{{❢}} Notice

This is line 1. This is line 2.

This is line 3. This is line 4.

This is line 5. This is line 6.

But as you can see, it creates extra space at the bottom.

The only real solution is to simply make sure the last paragraph in your notice box content is all on a single line.

It's a pain the ass, sure, but... it's all you can do.
The above documentation is transcluded from Template:Notice/Documentation. (edit | history)