Changes

Jump to: navigation, search

Template:Notice/doc

4,433 bytes added, 08:11, 29 April 2016
m
Switching to sections to aid modifications, and fixing a small bug
{{SPW|is not on|name=Notice}}
;Description:A simple notice box.;Dependencies* Uses [[:File:Gtk-ok.png]].;Syntax:Type <code>{{t|Notice|parameters}}</code> somewhere.;Parameters* '''type=''' - Notice box header text (default: Header text)* '''info=''' - Notice box additional info (default: Explanation)* '''image=''' - ''Optional'' Notice box symbol image (default: <code>[[[[:File:Gtk-ok.png]]|50px]]</code>)* '''border=''' - ''Optional'' Notice box border bar color (default see below)*:Border options*:* red - <span style="background-color:#b22222;">&nbsp; &nbsp;</span>: <code>10px solid #b22222</code>*:* orange - <span style="background-color:#f28500;">&nbsp; &nbsp;</span>: <code>10px solid #f28500</code>*:* yellow - <span style="background-color:#f4c430;">&nbsp; &nbsp;</span>: <code>10px solid #f4c430</code>*:* purple - <span style="background-color:#9932cc;">&nbsp; &nbsp;</span>: <code>10px solid #9932cc</code>*:* blue - <span style="background-color:#1e90ff;">&nbsp; &nbsp;</span>: <code>10px solid #1e90ff</code> ''(default)''*:* green - <span style="background-color:#228b22;">&nbsp; &nbsp;</span>: <code>10px solid #228b22</code>*:* gray - <span style="background-color:#bba;">&nbsp; &nbsp;</span>: <code>10px solid #bba</code>* '''style=''' - ''Optional'' Completely override the inline-CSS used for the Notice box, defaults to:*:<code>font-size:{{{styleFontSize}}}; width:{{{styleWidth}}}; margin:{{{styleMargin}}}; border:{{{styleBorder}}}; border-collapse:{{{styleBorderCollapse}}}; background-color:{{{styleBackgroundColor}}}; border-left:{{{border}}}</code>*Partially override the inline-CSS used for the Notice box. ''(Optional)''*:*'''styleFontSize=''' (default: <code>95%</code>)*:*'''styleWidth=''' (default: <code>80%</code>)*:*'''styleMargin=''' (default: <code>0 auto</code>)*:*'''styleBorder=''' (default: <code>1px #aaa solid</code>)*:*'''styleBorderCollapse=''' (default: <code>collapse</code>)*:*'''styleBackgroundColor=''' (default: <code>#eee</code>);Sample output:<code><nowiki>{{Notice|type=Notice box|info=Does not use the {{t|Ambox}} template and could be considered a simpler alternative, since it doesn't have a CSS dependency.}}</nowiki></code>::gives...:{{Notice|type=Notice box|info=Does not use the {{t|Ambox}} template and could be considered a simpler alternative, since it doesn't have a CSS dependency.}} {{clear}};See also* {{t|Ambox}}<includeonly>
[[Category:Wikia Help templates]]
</includeonly><noinclude>
[[Category:Template documentation]]
</noinclude>
<dl>
==<dt>Description</dt>==
<dd>A simple notice box.</dd>
 
==<dt>Dependencies</dt>==
<dd>
*Uses [[:File:Gtk-ok.png]] as default image.
*Uses for this documentation:
**{{t|SPW}} = Wikia specific to link back to original.
**{{t|t}} = To show clickable template mentions.
**{{t|para}} = To show parameter usage.
**{{t|-}} and {{t|Lorem ipsum}} = To format the output of the samples.
</dd>
 
==<dt>Syntax</dt>==
<dd>Type <code>{{t|Notice|parameters}}</code> somewhere.</dd>
===<dt>Parameters</dt>===
<dd>
*<i>Recommended</i>: {{para|type}}
*:Notice box header text.
*:Default: {{para|type|<var>Header text</var>}}
*<i>Recommended</i>: {{para|info}}
*:Notice box additional info.
*:Default: {{para|type|<var>Explanation</var>}}
*<i>Optional</i>: {{para|image}}
*:Notice box symbol image.
*:Provide the image-filename with extension, or use {{para|image|no}} to completely remove/inhibit the image part.
*:Default: {{para|image|<var>Gtk-ok.png</var>}}
*<i>Optional</i>: {{para|imageSize}}
*:Notice box symbol image-size.
*:Provide the image-size including the unit, eg: <code>px</code>, part.
*:Default: {{para|imageSize|<var>50px</var>}}
*<i>Optional</i>: {{para|border}}
*:Notice box left-border-bar definition.
*:Use {{para|border|<var>definition</var>}}, where <code><var>definition</var></code> is a valid custom definition for the [http://www.w3schools.com/cssref/pr_border-left.asp CSS property <code>border-left</code>].
*:Or use {{para|border|preset}}, where <code>preset</code> is one of the predefined names below<nowiki>:</nowiki>
*:*<span style="background-color:#b22222;">&nbsp; &nbsp;</span> red &rArr; <code>10px solid #b22222</code>
*:*<span style="background-color:#f28500;">&nbsp; &nbsp;</span> orange &rArr; <code>10px solid #f28500</code>
*:*<span style="background-color:#f4c430;">&nbsp; &nbsp;</span> yellow &rArr; <code>10px solid #f4c430</code>
*:*<span style="background-color:#9932cc;">&nbsp; &nbsp;</span> purple &rArr; <code>10px solid #9932cc</code>
*:*<span style="background-color:#1e90ff;">&nbsp; &nbsp;</span> blue &rArr; <code>10px solid #1e90ff</code>
*:*<span style="background-color:#228b22;">&nbsp; &nbsp;</span> green &rArr; <code>10px solid #228b22</code>
*:*<span style="background-color:#bba;">&nbsp; &nbsp;</span> gray &rArr; <code>10px solid #bba</code>
*:Default: {{para|border|blue}}
*:<i>You don't need to provide the <code>;</code> at the end to properly terminate the definition(s) because it will be appended automatically for proper functionality.</i>
*<i>Optional</i>: {{para|float|side}}
*:Float the Notice box.
*:Where <code>side</code> can be one of: <i>(Case insensitive)</i>
*:*<code>l</code> or <code>left</code>
*:*<code>r</code> or <code>right</code>
*:*<code>n</code> or <code>none</code>
*:When anything else is provided it will be treated as <b><code>none</code></b>.
*:<span style="color:red;"><b>When used</b> it alters the <u>default value</u> for <code>styleWidth</code></span> of {{para|style}}<sup>(see below)</sup> as following when the effective floating is:
*:*left &rArr; <code>25%</code>
*:*right &rArr; <code>25%</code>
*:*none &rArr; <code>50%</code>
*<i>Optional</i>: {{para|style|<var>inline-CSS;</var>}}
*:Completely override the inline-CSS used in the [http://www.w3schools.com/tags/att_global_style.asp style-attribute] of the table that generates the Notice box.
*:Where <code><var>inline-CSS;</var></code> defaults to:
*:<code>font-size:{{{styleFontSize}}}; width:{{{styleWidth}}}; margin:{{{styleMargin}}}; border:{{{styleBorder}}}; border-collapse:{{{styleBorderCollapse}}}; background-color:{{{styleBackgroundColor}}}; border-left:{{{border}}}</code>
*:To override parts of the default shown above you can use: <i>(defaults shown as value)</i>
*:*{{para|styleFontSize|95%}}
*:*{{para|styleWidth|80%}} <i>(Default value is altered when {{para|float}}<sup>(see above)</sup> is used.)</i>
*:*{{para|styleMargin|0 auto}}
*:*{{para|styleBorder|1px #aaa solid}}
*:*{{para|styleBorderCollapse|collapse}}
*:*{{para|styleBackgroundColor|#eee}}
</dd>
 
==<dt>Sample output</dt>==
<dd><dl>
===Sample:1===
<dt style="font-family:monospace,Courier; font-weight:normal; border:2px solid teal; border-radius:1em;">
<nowiki>{{Notice|type=Notice box|info=Does not use the {{t|Ambox}} template and could be considered a simpler alternative, since it doesn't have a CSS dependency.}}</nowiki>
</dt>
<dd>gives...</dd>
<dd style="border:2px solid teal; border-radius:1em;">{{Notice|type=Notice box|info=Does not use the {{t|Ambox}} template and could be considered a simpler alternative, since it doesn't have a CSS dependency.}}</dd>
===Sample:2===
<dt style="font-family:monospace,Courier; font-weight:normal; border:2px solid teal; border-radius:1em;">
<nowiki>{{Notice|styleWidth=50%|type=Notice box|info={{Lorem ipsum|1|&amp;ldquo;|&amp;rdquo;}} }}</nowiki>
</dt>
<dd>gives...</dd>
<dd style="border:2px solid teal; border-radius:1em;">{{Notice|styleWidth=50%|type=Notice box|info={{Lorem ipsum|1|&ldquo;|&rdquo;}} }}</dd>
===Sample:3===
<dt style="font-family:monospace,Courier; font-weight:normal; border:2px solid teal; border-radius:1em;">
<nowiki>{{Lorem ipsum|1|&amp;ldquo;|&amp;rdquo;}}</nowiki><br/>
<nowiki>{{Notice|float=N|type=Notice box|info={{Lorem ipsum|1|&amp;ldquo;|&amp;rdquo;}} }}</nowiki><br/>
<nowiki>{{Lorem ipsum|2|&amp;ldquo;|&amp;rdquo;}}{{-}}</nowiki>
</dt>
<dd>gives...</dd>
<dd style="border:2px solid teal; border-radius:1em;">{{Lorem ipsum|1|&ldquo;|&rdquo;}}
{{Notice|float=N|type=Notice box|info={{Lorem ipsum|1|&ldquo;|&rdquo;}} }}
{{Lorem ipsum|2|&ldquo;|&rdquo;}}{{-}}</dd>
===Sample:4===
<dt style="font-family:monospace,Courier; font-weight:normal; border:2px solid teal; border-radius:1em;">
<nowiki>{{Lorem ipsum|1|&amp;ldquo;|&amp;rdquo;}}</nowiki><br/>
<nowiki>{{Notice|float=Left|type=Notice box|info={{Lorem ipsum|1|&amp;ldquo;|&amp;rdquo;}} }}</nowiki><br/>
<nowiki>{{Lorem ipsum|2|&amp;ldquo;|&amp;rdquo;}}{{-}}</nowiki>
</dt>
<dd>gives...</dd>
<dd style="border:2px solid teal; border-radius:1em;">{{Lorem ipsum|1|&ldquo;|&rdquo;}}
{{Notice|float=Left|type=Notice box|info={{Lorem ipsum|1|&ldquo;|&rdquo;}} }}
{{Lorem ipsum|2|&ldquo;|&rdquo;}}{{-}}</dd>
===Sample:5===
<dt style="font-family:monospace,Courier; font-weight:normal; border:2px solid teal; border-radius:1em;">
<nowiki>{{Lorem ipsum|1|&amp;ldquo;|&amp;rdquo;}}</nowiki><br/>
<nowiki>{{Notice|float=Right|type=Notice box|info={{Lorem ipsum|1|&amp;ldquo;|&amp;rdquo;}} }}</nowiki><br/>
<nowiki>{{Lorem ipsum|2|&amp;ldquo;|&amp;rdquo;}}{{-}}</nowiki>
</dt>
<dd>gives...</dd>
<dd style="border:2px solid teal; border-radius:1em;">{{Lorem ipsum|1|&ldquo;|&rdquo;}}
{{Notice|float=Right|type=Notice box|info={{Lorem ipsum|1|&ldquo;|&rdquo;}} }}
{{Lorem ipsum|2|&ldquo;|&rdquo;}}{{-}}</dd>
 
</dl></dd>
 
==<dt>See also</dt>==
<dd>
*{{t|Ambox}}
</dd>
 
</dl>
1,071
edits

Navigation menu