Template:Caution: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
m 1 revision imported
No edit summary
Line 1:
<onlyinclude><templatestyles src="Caution/styles.css" />
<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:Caution.png|20px|2em|Warning|link=]]</span> '''Caution''': {{#if: {{{1|}}}|</td><td valign="top" style="padding-left:0.5em;">{{{1|}}}</td></tr></table>}}</includeonly><noinclude>
<div class="warning-note>
 
[[File:OOjs UI icon alert-yellow.svg]] &nbsp;'''Warning: ''' {{{1}}}</div></onlyinclude>
== Usage ==
</noinclude><templatedata>
 
{
This template has two possible usages:
"params": {
# Will have the text flow below when the caution text is too long
"1": {
# Uses a table to indent the text.
"label": "Warning Text",
 
"example": "Do not continue until Step XYZ is complete",
=== Method 1 ===
"type": "string",
 
"required": true
The following displays the warning icon and the word 'Warning:'. You can follow this with whatever text/images/markup you like.
}
 
},
Wiki Code:
"description": "Show a Warning"
<nowiki>{{Caution}}</nowiki> Be careful!
}
 
</templatedata>[[Category:AutoDumpContentFromCommons]]</noinclude>
{{Caution}} Don't do that!
 
=== Method 2 ===
The following includes the text passed to the template, and uses a table to stop the text flowing round the icon.
 
Wiki Code:
<nowiki>{{Caution|Here is a long warning, which is sufficiently wordy to run onto a second line (unless you have a really large screen!),
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>
 
{{Caution|Here is a long caution, which is sufficiently wordy to run onto a second line (unless you have a really large screen!), which would normally cause it to wrap round the icon, but because we passed it as a parameter it keeps its left alignment straight.}}
 
{{Languages|Template:Warning}}
[[Category:Templates|{{PAGENAME}}]]
</noinclude>