Template:SiteNotice: Difference between revisions
(Copied from old revision of Template:Notice due to MediaWiki:Sitenotice not displaying the revised template properly; all styling was missing, so MediaWiki:Sitenotice is probably not compatible with TemplateStyles.) |
(Added explanation of how this template is technically different from Template:Notice.) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly><div style="text-align: {{{text-align|left}}}; padding: .5em; margin: .5em 0; border-width: 1px 5px 1px 5px; border-style: solid; border-radius: 5px 5px 5px 5px; display: flex; flex-direction: row; column-gap: 1em; border-color: rgb({{#switch: {{{color|green}}} | green = 170, 220, 0 | teal = 47, 172, 172 | blue = 0, 153, 255 | orange = 255, 128, 0 | yellow = 235, 238, 61 | red = 217, 0, 0 | pink = 240, 60, 120 | maroon = 174, 21, 102 | gray = 201, 201, 201 | #default = 170, 220, 0 }});> | ||
| | {{#if: {{{file|}}} | <div style="display: flex; align-items: center;>[[File:{{{file}}}|{{{filesize|48px}}}|link=]]</div> | }}<div style="flex-grow: 1; display: flex; flex-direction: column; justify-content: center;">{{#if: {{{header|}}}|<div style="font-weight: 600;">{{{header}}}</div> | }}<div style="font-size: 9pt;">{{{content|}}}</div></div></div></includeonly><noinclude> | ||
< | |||
Use this template to create notices on [[MediaWiki:Sitenotice]]. For non-sitenotice usage, please use [[Template:Notice]] or other [[:Category:Notice templates|notice templates]] instead. | Use this template to create notices on [[MediaWiki:Sitenotice]]. For non-sitenotice usage, please use [[Template:Notice]] or other [[:Category:Notice templates|notice templates]] instead. | ||
This template is intended to be almost identical to Template:Notice, with the exception that this template uses in-line CSS instead of a TemplateStyles CSS stylesheet. In-line CSS is necessary because TemplateStyles CSS only works within <code>.mw-parser-output</code>, and the sitenotice is outside of <code>.mw-parser-output</code>. | |||
== Usage == | == Usage == | ||
'''Syntax''': <code><nowiki>{{SiteNotice | '''Syntax''': <code><nowiki>{{SiteNotice|text-align=|border=|width=|file=|filesize=|header=|content=}}</nowiki></code> | ||
{| class="wikitable sitecolor-generic" | {| class="wikitable sitecolor-generic" | ||
| style="vertical-align:top" |<code> | | style="vertical-align:top" |<code>color</code> | ||
| style="vertical-align:top" |Named, optional | | style="vertical-align:top" |Named, optional | ||
| colspan="4" |The | | colspan="4" |The color preset for the border. Options are <code>green</code>, <code>blue</code>, <code>teal</code>, <code>orange</code>, <code>yellow</code>, <code>red</code>, <code>maroon</code>, <code>pink</code>, and <code>gray</code>. Defaults to <code>green</code>. | ||
|- | |- | ||
| style="vertical-align:top" |<code>text-align</code> | | style="vertical-align:top" |<code>text-align</code> | ||
| style="vertical-align:top" |Named, optional | | style="vertical-align:top" |Named, optional | ||
| colspan="4" |The text-align attribute of the header and content text, e.g. <code>center</code>. Defaults to | | colspan="4" |The text-align attribute of the header and content text, e.g. <code>center</code>. Defaults to <code>left</code>. | ||
|- | |- | ||
| style="vertical-align:top" |<code>file</code> | | style="vertical-align:top" |<code>file</code> | ||
Line 46: | Line 37: | ||
=== Examples === | === Examples === | ||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Under Construction|content=This article is under construction.}}</nowiki></code> | <code><nowiki>{{SiteNotice|file=Example.jpg|header=Under Construction|content=This article is under construction.}}</nowiki></code> | ||
{{ | {{SiteNotice|file=Example.jpg|header=Under Construction|content=This article is under construction.}} | ||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Notice with header text only.}}</nowiki></code> | <code><nowiki>{{SiteNotice|file=Example.jpg|header=Notice with header text only.}}</nowiki></code> | ||
{{ | {{SiteNotice|file=Example.jpg|header=Notice with header text only.}} | ||
<code><nowiki>{{SiteNotice|file=Example.jpg|content=Small notice without a header.}}</nowiki></code> | <code><nowiki>{{SiteNotice|file=Example.jpg|content=Small notice without a header.}}</nowiki></code> | ||
{{ | {{SiteNotice|file=Example.jpg|content=Small notice without a header.}} | ||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Green notice|color=green}}</nowiki></code> | |||
{{SiteNotice|file=Example.jpg|header=Green notice|color=green}} | |||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Blue notice|color=blue}}</nowiki></code> | |||
{{SiteNotice|file=Example.jpg|header=Blue notice|color=blue}} | |||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Teal notice|color=teal}}</nowiki></code> | |||
{{SiteNotice|file=Example.jpg|header=Teal notice|color=teal}} | |||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Orange notice|color=orange}}</nowiki></code> | |||
{{SiteNotice|file=Example.jpg|header=Orange notice|color=orange}} | |||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Yellow notice|color=yellow}}</nowiki></code> | |||
{{SiteNotice|file=Example.jpg|header=Yellow notice|color=yellow}} | |||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Red notice|color=red}}</nowiki></code> | |||
{{SiteNotice|file=Example.jpg|header=Red notice|color=red}} | |||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Maroon notice|color=maroon}}</nowiki></code> | |||
{{SiteNotice|file=Example.jpg|header=Maroon notice|color=maroon}} | |||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Pink notice|color=pink}}</nowiki></code> | |||
{{SiteNotice|file=Example.jpg|header=Pink notice|color=pink}} | |||
<code><nowiki>{{SiteNotice|file=Example.jpg|header=Gray notice|color=gray}}</nowiki></code> | |||
{{SiteNotice|file=Example.jpg|header=Gray notice|color=gray}} | |||
[[Category:Notice templates]] | [[Category:Notice templates]] | ||
Latest revision as of 17:20, 16 July 2023
Use this template to create notices on MediaWiki:Sitenotice. For non-sitenotice usage, please use Template:Notice or other notice templates instead.
This template is intended to be almost identical to Template:Notice, with the exception that this template uses in-line CSS instead of a TemplateStyles CSS stylesheet. In-line CSS is necessary because TemplateStyles CSS only works within .mw-parser-output
, and the sitenotice is outside of .mw-parser-output
.
Usage
Syntax: {{SiteNotice|text-align=|border=|width=|file=|filesize=|header=|content=}}
color
|
Named, optional | The color preset for the border. Options are green , blue , teal , orange , yellow , red , maroon , pink , and gray . Defaults to green .
| |||
text-align
|
Named, optional | The text-align attribute of the header and content text, e.g. center . Defaults to left .
| |||
file
|
Named, optional | The file to show on the left-hand section as a filename. e.g. Example.jpg . Defaults to nothing shown.
| |||
filesize
|
Named, optional | The file's size on the left-hand section. e.g. 30px . Defaults to 48px if a file was specified, otherwise none.
| |||
header
|
Named, optional | The header text. e.g. Notice . Defaults to nothing shown.
| |||
content
|
Named, optional | The content text. e.g. Test message . Defaults to nothing shown.
|
Examples
{{SiteNotice|file=Example.jpg|header=Under Construction|content=This article is under construction.}}
{{SiteNotice|file=Example.jpg|header=Notice with header text only.}}
{{SiteNotice|file=Example.jpg|content=Small notice without a header.}}
{{SiteNotice|file=Example.jpg|header=Green notice|color=green}}
{{SiteNotice|file=Example.jpg|header=Blue notice|color=blue}}
{{SiteNotice|file=Example.jpg|header=Teal notice|color=teal}}
{{SiteNotice|file=Example.jpg|header=Orange notice|color=orange}}
{{SiteNotice|file=Example.jpg|header=Yellow notice|color=yellow}}
{{SiteNotice|file=Example.jpg|header=Red notice|color=red}}
{{SiteNotice|file=Example.jpg|header=Maroon notice|color=maroon}}
{{SiteNotice|file=Example.jpg|header=Pink notice|color=pink}}
{{SiteNotice|file=Example.jpg|header=Gray notice|color=gray}}