Template:Sitenotice
Jump to navigation
Jump to search
%CLOSE%
Template documentation
This documentation is transcluded from Template:Sitenotice/doc. [edit] [history] [purge]
This template is used on MediaWiki:Sitenotice
Usage
{{Sitenotice |type = Type of site notice (all site notices of type are dismissed together regardless of notice number) |image = Displays an image before the text (should be set to x40px if it's too big). |image bg = Colour of the div where the image is displayed (Hex, Name or Class). |text = Text to be displayed |text bg = Colour of the div where the text is displayed (Hex, Name or Class). |text color = If for some reason you need the text to be a different colour (Hex, Name or Class). |mobile = Can be set to 'yes' to enable displaying the sitenotice on the mobile skin. }}
- The sitenotice is defaulted to not be shown on the mobile skin. Per meta:Forum:Mobile sitenotice, this behaviour can be switched off by setting the
|mobile
parameter to 'yes' in cases of scheduled website outages and others. - The
|type
parameter may be omitted. All site notices of a given type are dismissed together regardless of the site notice id number. For example if a site notice of type oswf is dismissed, no other oswf type site messages will be displayed to the user (regardless of notice number). - The
|image
parameter may be omitted, leaving the text full width.|image bg
will be automatically omitted with it. - Existing colour classes may be used on
|text bg
and|image bg
instead, listed below. These will automatically switch between dark and ligth modes.- These classes are defined in MediaWiki:Common.less/wikitables.less, and overridden for dark mode in MediaWiki:Vector-darkmode.less/wikitables.less.
Backgrounds | Text |
---|---|
table-bg-red | text-red |
table-bg-orange | text-orange |
table-bg-yellow | text-yellow |
table-bg-green | text-green |
table-bg-blue | text-blue |
table-bg-purple | text-purple |
table-bg-pink | text-pink |
table-bg-grey | text-grey |
Note that %CLOSE%
is replaced by the close X, positioned absolutely in the top right of the parent (or left for ltr), however any padding/margins etc to ensure that the X does not overlap the contents must be added manually (done within this template).
Examples
Code | Result |
---|---|
{{Sitenotice |image = [[File:Ruby detail.png|x40px]] |image bg = #801c13 |text = This is where you will write your text. You can use <code><choose></code> and such. |text bg = #9f261e |text color = white }} |
|
{{Sitenotice |text = This is a text only sitenotice where the image was omitted, with changing background and text colors. |text bg = table-bg-green |text color = text-green }} |
This is a text only sitenotice where the image was omitted, with changing background and text colors. %CLOSE% |
{{Sitenotice |type = oswf |image = [[File:Bond detail.png|40px|link=RS:OSWF]] |image bg = palegoldenrod |text = This is a sitenotice with a type, such as for oswf. |text color = #fff |text bg = #DAA520 }} |