Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Note: Difference between revisions

Template page
Boursk (talk | contribs)
Initial draft
 
Boursk (talk | contribs)
Added optional header and 'example' type
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude>{{#if: {{{1|{{{content|{{{text|{{{demo|<noinclude>demo</noinclude>}}}}}}}}}}}} | <templatestyles src="Note/styles.css" /><div role="note" class="note note-{{#switch: {{{2|{{{type|}}}}}}
<onlyinclude>{{#if: {{{1|{{{content|{{{text|{{{demo|<noinclude>demo</noinclude>}}}}}}}}}}}} | <templatestyles src="Note/styles.css" /><div class="note-container note-{{#switch: {{{2|{{{type|}}}}}}
     |gotcha=error
     |gotcha=error
     |warning=warn
     |warning=warn
Line 5: Line 5:
     |=info
     |=info
     |#default={{{2|{{{type|}}}}}}
     |#default={{{2|{{{type|}}}}}}
     }} {{#ifeq:{{{inline|}}}|1|note-inline}}">{{#ifeq:{{{inline|}}}|1|{{{1|{{{content|{{{text}}}}}}}}}|
     }} {{#ifeq:{{{inline|}}}|1|note-inline}}"><div role="note" class="note note-{{#switch: {{{2|{{{type|}}}}}}
{{{1|{{{content|{{{text}}}}}}}}}}}</div>
    |gotcha=error
    |warning=warn
    |notice=info
    |=info
    |#default={{{2|{{{type|}}}}}}
    }}">{{#ifeq:{{{inline|}}}|1|{{{header|{{{1|{{{content|{{{text}}}}}}}}}}}}|
{{{header|{{{1|{{{content|{{{text}}}}}}}}}}}}}}</div>{{#if:{{{header|}}}|<div class="note-body">
{{{1|{{{content|{{{text}}}}}}}}}</div>}}</div>
   | [[File:Icon lightbulb-yellow.svg|18px|alt=Note|link=]]&nbsp;'''Note:''' }}<!--
   | [[File:Icon lightbulb-yellow.svg|18px|alt=Note|link=]]&nbsp;'''Note:''' }}<!--
--></onlyinclude>
--></onlyinclude>
== Usage ==
== Usage ==
<pre>
<pre>
{{Note|text=Foo}}
{{Note|text=Note without type}}
{{Note|type=info|text=Foo}}
 
{{Note|type=reminder|text=Foo}}
{{Note|type=info|text=Note with type 'info'}}
{{Note|type=warn|text=Foo}}
{{Note|type=info|text=Note with type 'info'|header=Header text}}
{{Note|type=error|text=Foo}}
 
{{Note}} Loose test
{{Note|type=example|text=Note with type 'example'}}
{{Note|type=example|text=Note with type 'example'|header=Header text}}
 
{{Note|type=reminder|text=Note with type 'reminder'}}
{{Note|type=reminder|text=Note with type 'reminder'|header=Header text}}
 
{{Note|type=warn|text=Note with type 'warn'}}
{{Note|type=warn|text=Note with type 'warn'|header=Header text}}
 
{{Note|type=error|text=Note with type 'error'}}
{{Note|type=error|text=Note with type 'error'|header=Header text}}


* Text {{Note|inline=1|text=Foo}}
{{Note|type=reminder|text=Add<br>br tags<br>to add<br>a line break}}
 
{{Note|type=reminder|text=
* Multiple paragraphs.
 
Of text.}}
{{Note|type=reminder|text=
* Multiple paragraphs.
 
Of text.|header=Header text}}
 
{{Note}} Text with a note prefix
 
* Text {{Note|inline=1|text=with an inline note}}
</pre>
</pre>
{{Note|text=Foo}}
{{Note|text=Note without type}}
{{Note|type=info|text=Foo}}
{{Note|type=info|text=Note with type 'info'}}
{{Note|type=reminder|text=Foo}}
{{Note|type=info|text=Note with type 'info'|header=Header text}}
{{Note|type=reminder|text=Multiple<br>lines<br>of<br>text}}
{{Note|type=example|text=Note with type 'example'}}
{{Note|type=example|text=Note with type 'example'|header=Header text}}
{{Note|type=reminder|text=Note with type 'reminder'}}
{{Note|type=reminder|text=Note with type 'reminder'|header=Header text}}
{{Note|type=warn|text=Note with type 'warn'}}
{{Note|type=warn|text=Note with type 'warn'|header=Header text}}
{{Note|type=error|text=Note with type 'error'}}
{{Note|type=error|text=Note with type 'error'|header=Header text}}
{{Note|type=reminder|text=Add<br>br tags<br>to add<br>a line break}}
{{Note|type=reminder|text=
{{Note|type=reminder|text=
* Multiple paragraphs.
* Multiple paragraphs.


Of text.}}
Of text.}}
{{Note|type=warn|text=Foo}}
{{Note|type=reminder|text=
{{Note|type=error|text=Foo}}
* Multiple paragraphs.
{{Note}} Loose test
 
Of text.|header=Header text}}
{{Note}} Text with a note prefix


* Text {{Note|inline=1|text=Foo}}
* Text {{Note|inline=1|text=with an inline note}}


== Template Parameters ==
== Template Specification ==
{| class="wikitable"
{{Note/doc}}
! colspan=2 | Parameter !! Description !! Type !! Status
|-
| Inline formatting || <code>inline</code> ||
Show the template without line breaks before and after it.
<dt>Default</dt>
<dd>0</dd>
<dt>Auto value</dt>
<dd>1</dd>
|| Boolean || Optional
|-
| Type || <code>type</code> <code>2</code> ||
One of "info", "reminder", "warn" or "error". This setting affects the color and icon.
<dt>Suggested values</dt>
<dd><code>info</code> <code>reminder</code> <code>warn</code> <code>error</code></dd>
<dt>Default</dt>
<dd>info</dd>
|| String || Optional
|-
| Text || <code>text</code> <code>1</code> <code>content</code> || Informative note || Content || Optional
|}

Latest revision as of 12:31, 27 April 2026

{{{text}}}

Usage

{{Note|text=Note without type}}

{{Note|type=info|text=Note with type 'info'}}
{{Note|type=info|text=Note with type 'info'|header=Header text}}

{{Note|type=example|text=Note with type 'example'}}
{{Note|type=example|text=Note with type 'example'|header=Header text}}

{{Note|type=reminder|text=Note with type 'reminder'}}
{{Note|type=reminder|text=Note with type 'reminder'|header=Header text}}

{{Note|type=warn|text=Note with type 'warn'}}
{{Note|type=warn|text=Note with type 'warn'|header=Header text}}

{{Note|type=error|text=Note with type 'error'}}
{{Note|type=error|text=Note with type 'error'|header=Header text}}

{{Note|type=reminder|text=Add<br>br tags<br>to add<br>a line break}}

{{Note|type=reminder|text=
* Multiple paragraphs.

Of text.}}
{{Note|type=reminder|text=
* Multiple paragraphs.

Of text.|header=Header text}}

{{Note}} Text with a note prefix

* Text {{Note|inline=1|text=with an inline note}}
Note without type
Note with type 'info'
Header text
Note with type 'info'
Note with type 'example'
Header text
Note with type 'example'
Note with type 'reminder'
Header text
Note with type 'reminder'
Note with type 'warn'
Header text
Note with type 'warn'
Note with type 'error'
Header text
Note with type 'error'
Add
br tags
to add
a line break
  • Multiple paragraphs.
Of text.
Header text
  • Multiple paragraphs.
Of text.

Note Note: Text with a note prefix

  • Text
    with an inline note

Template Specification

Show a note in a box (e.g. a top-of-the-page warning).

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Inline formattinginline

Show the template without line breaks before and after it.

Default
0
Auto value
1
Booleanoptional
Typetype 2

One of “info”, “example”, “reminder”, “warn”, or “error”. This setting affects the color and icon.

Suggested values
info example reminder warn error
Default
info
Stringoptional
Headerheader

Header text. This is expected to be used in combination with the 'text' parameter.

Contentoptional
Texttext 1 content

Informative note. If the 'header' parameter is used, this will be the body text.

Contentoptional