« Modèle:Note » : différence entre les versions

1 181 octets enlevés ,  4 juillet 2012
using '' for formatting here does not work because it breaks when the incoming input has '' has well. Plus, no reason to use tables here. Only makes it worse. Reverting with fixes.
test0>Jongfeli
Aucun résumé des modifications
test0>Krinkle
(using '' for formatting here does not work because it breaks when the incoming input has '' has well. Plus, no reason to use tables here. Only makes it worse. Reverting with fixes.)
Ligne 1 : Ligne 1 :
<includeonly>{{#if: {{{1|}}}|<table cellspacing="0" cellpadding="0" border="0" style="background: transparent;"><tr><td nowrap="nowrap" valign="top">}}<span style="position: relative; top: -2px;">[[File:Bulbgraph.png|18px|Note|link=]]</span> '''Note''': {{#if: {{{1|}}}|</td><td valign="top" style="padding-left:0.5em;">''{{{1|}}}''</td></tr></table>}}</includeonly><noinclude>
{{#if: {{{1|<noinclude>demo</noinclude>}}} | <div class="note note-{{#switch:{{{2|}}}
== Why using this template ==
|gotcha=error
Displays a {{Note}}''icon and text.''
|=info
 
|#default={{{2|}}}
== Parameters ==
}}">
List the parameters with a brief description.
{{{1}}}</div> | [[File:Bulbgraph.png|18px|Note|link=]]&nbsp; }}<noinclude>
*Note text is optional, see [[#Methode 2|Method 2]] for details.
== Usage ==
 
== How to use ==
<pre>
<pre>
{{Note|parameter1=value}}
{{note|Foo}}
{{note|Foo|reminder}}
{{note|Foo|error}}
{{note|Foo|gotcha}}
{{tip|Foo}}
{{note}} Loose test
{{tip}} Loose test
</pre>
</pre>
{{note|Foo}}
{{note|Foo|reminder}}
{{note|Foo|error}}
{{note|Foo|gotcha}}
{{tip|Foo}}
{{note}} Loose test
{{tip}} Loose test


=== Method 1 ===
[[Category:Templates|{{PAGENAME}}]]
The following displays the note icon and the word 'Note:'.  You can follow this with whatever text/images/markup you like, and it works in-line, within a paragraph.
Monsters are green. <nowiki>{{Note}}''This is an in-line note, to remind you that some monsters are orangey-purple.''</nowiki>
 
Monsters are green. {{Note}}''This is an in-line note, to remind you that some monsters are orangey-purple.''
 
=== Method 2 ===
The following includes the text passed to the template, and uses a table to stop the text flowing round the icon.  These always force a newline before and after the note.
 
<nowiki>{{Note|Here is a long note, which is sufficiently wordy to run onto a second line,
which would normally cause it to wrap round the icon, but because we passed it as a parameter
it keeps its left alignment straight.}}</nowiki>
 
{{Note|Here is a long note, which is sufficiently wordy to run onto a second line, which would normally cause it to wrap round the icon, but because we passed it as a parameter it keeps its left alignment straight.}}
</noinclude>
</noinclude>
Utilisateur anonyme