Template:SiteNotice: Difference between revisions

From Inkipedia, the Splatoon wiki
m (Text replacement - "{{roundy}}" to "border-radius: 20px;")
(Added explanation of how this template is technically different from Template:Notice.)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{| align="{{{align|}}}" cellpadding="1px" style="border: 3px solid {{{border|rgb({{SiteColor|Generic}})}}}; {{#if|{{{width|}}}|width:{{{width}}}|}}; border-radius: 20px;"
<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 }});>
|style="padding:0px 0px 0px 3px; width:{{#if: {{{file|}}} | {{{filesize|48px}}} | 0%; display:none}};"|{{#if: {{{file|}}} | [[File:{{{file|}}}|{{{filesize|48px}}}|link=]]}}
{{#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>
|style="padding:6px 6px 0px 6px; text-align: {{{text-align|left}}};"| {{#if: {{{header|}}}|<span style="font-size: 11pt; font-weight: bold;">{{{header|}}}</span><br> |}}
<span style="font-size: 9pt;">{{{content|}}}</span>
|}</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|align=|text-align=|border=|width=|file=|filesize=|header=|content=}}</nowiki></code>
'''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>align</code>
| style="vertical-align:top" |<code>color</code>
| style="vertical-align:top" |Named, optional
| style="vertical-align:top" |Named, optional
| colspan="4" |The align attribute of the notice, e.g. <code>center</code>. Defaults to "" (unset)
| 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 left.
| 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>border</code>
| style="vertical-align:top" |Named, optional
| colspan="4" |The border attribute of the notice, e.g. <code>border=rgb(<nowiki>{{SiteColor|Splatoon}}</nowiki>)</code>. Defaults to <code>rgb(<nowiki>{{SiteColor|Generic}}</nowiki>)</code>
|-
| style="vertical-align:top" |<code>width</code>
| style="vertical-align:top" |Named, optional
| colspan="4" |The width attribute of the notice, e.g. <code>30%</code>. Defaults to unset (fit to contents).
|-
|-
| style="vertical-align:top" |<code>file</code>
| style="vertical-align:top" |<code>file</code>
Line 53: Line 44:
<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.}}
{{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]]
</noinclude>

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.}}

Example.jpg
Under Construction
This article is under construction.

{{SiteNotice|file=Example.jpg|header=Notice with header text only.}}

Example.jpg
Notice with header text only.

{{SiteNotice|file=Example.jpg|content=Small notice without a header.}}

Example.jpg
Small notice without a header.

{{SiteNotice|file=Example.jpg|header=Green notice|color=green}}

Example.jpg
Green notice

{{SiteNotice|file=Example.jpg|header=Blue notice|color=blue}}

Example.jpg
Blue notice

{{SiteNotice|file=Example.jpg|header=Teal notice|color=teal}}

Example.jpg
Teal notice

{{SiteNotice|file=Example.jpg|header=Orange notice|color=orange}}

Example.jpg
Orange notice

{{SiteNotice|file=Example.jpg|header=Yellow notice|color=yellow}}

Example.jpg
Yellow notice

{{SiteNotice|file=Example.jpg|header=Red notice|color=red}}

Example.jpg
Red notice

{{SiteNotice|file=Example.jpg|header=Maroon notice|color=maroon}}

Example.jpg
Maroon notice

{{SiteNotice|file=Example.jpg|header=Pink notice|color=pink}}

Example.jpg
Pink notice

{{SiteNotice|file=Example.jpg|header=Gray notice|color=gray}}

Example.jpg
Gray notice