Template:MessageBox: Difference between revisions

From Structorica Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div
<includeonly><div
    class="msgbox searchaux {{#if: {{{mini|{{{small|}}}}}} | msgbox-mini | }} {{#if: {{{subtle|}}} | msgbox-subtle | }} {{
  class="msgbox searchaux {{#if: {{{mini|{{{small|}}}}}} | msgbox-mini | }} {{#if: {{{subtle|}}} | msgbox-subtle | }} {{
    #switch: {{{type|}}}
  #switch: {{{type|}}}
    | style | display | presentation = msgbox-yellow
  | style | display | presentation = msgbox-yellow
    | minor | minor-issue | content | issue = msgbox-orange
  | minor | minor-issue | content | issue = msgbox-orange
    | major | major-issue | delete = msgbox-red
  | major | major-issue | delete = msgbox-red
    | organization | title | move = msgbox-purple
  | organization | title | move = msgbox-purple
    | details | upcoming = msgbox-blue
  | details | parity | edition | upcoming = msgbox-blue
    | notice | note | info = msgbox-green
  | notice | note | info = msgbox-green
    | other = msgbox-magenta
  | other = msgbox-magenta
    | #default = {{#if: {{#pos: {{{class|}}} | msgbox- <!-- end pos -->}} || msgbox-gray <!-- end if -->}}
  | #default = {{#if: {{#pos: {{{class|}}} | msgbox- <!-- end pos -->}} || msgbox-gray <!-- end if -->}}
    }} {{{class|}}}"
  }} {{{class|}}}"
    style="
  style="
    max-width: {{{width|{{#if: {{{subtle|}}} | 306px | {{#if: {{{mini|{{{small|}}}}}} | 50em | 90% }} }}}}};
  max-width: {{{width|{{#if: {{{subtle|}}} | 306px | {{#if: {{{mini|{{{small|}}}}}} | 50em | 90% }} }}}}};
    {{#if: {{{bgcol|}}} | background: {{{bgcol}}}; | }}
  {{#if: {{{bgcol|}}} | background: {{{bgcol}}}; | }}
    {{#if: {{{linecol|}}} | border-left: 4px solid {{{linecol}}}; | }}
  {{#if: {{{linecol|}}} | border-left: 4px solid {{{linecol}}}; | }}
    {{#if: {{{float|}}} | float: {{{float}}}; | }}
  {{#if: {{{float|}}} | float: {{{float}}}; | }}
    {{{css|}}}
  {{{css|}}}
    "
  "
  >
>
  <div class="msgbox-icon"> {{
<div class="msgbox-icon"> {{
    #if: {{{icon|}}}
  #if: {{{icon|}}}
      | <div class="msgbox-iconimage" style="{{{imagecss|}}}">
    | <div class="msgbox-iconimage" style="{{{imagecss|}}}">
  }}{{
}}{{
    #if: {{{image|}}}{{{imagetextbefore|}}}{{{imagetextafter|}}}
  #if: {{{image|}}}{{{imagetextbefore|}}}{{{imagetextafter|}}}
    | <div class="msgbox-image nomobile" style="{{{imagecss|}}}">
  | <div class="msgbox-image nomobile" style="{{{imagecss|}}}">
  }} {{{imagetextbefore|}}}{{
}} {{{imagetextbefore|}}}{{
    #if: {{{icon|}}}
  #if: {{{icon|}}}
    | {{CommentSprite | {{{icon|}}} }}
  | {{CommentSprite | {{{icon|}}} }}
  }}{{
}}{{
      #if:{{{image|}}}
    #if:{{{image|}}}
      |{{
    |{{
        #if: {{{imageisraw|}}}  
      #if: {{{imageisraw|}}}  
        | {{{image}}}  
      | {{{image}}}  
        | [[File:{{{image}}}|{{#if: {{{imagesize|}}}| {{{imagesize}}}| {{#if: {{{mini|{{{small|}}}}}} | 16px | 32px }}}}|text-top|class={{{imageclass|}}}|link={{#if:{{{dolinkimage|}}}||File:{{{image}}}}}|alt=]]
      | [[File:{{{image}}}|{{#if: {{{imagesize|}}}| {{{imagesize}}}| {{#if: {{{mini|{{{small|}}}}}} | 16px | 32px }}}}|text-top|class={{{imageclass|}}}|link={{#if:{{{dolinkimage|}}}||File:{{{image}}}}}|alt=]]
  }}}}{{{imagetextafter|}}}{{
}}}}{{{imagetextafter|}}}{{
    #if: {{{icon|}}}
  #if: {{{icon|}}}
    | </div>
  | </div>
  }}{{
}}{{
    #if: {{{image|}}}{{{imagetextbefore|}}}{{{imagetextafter|}}}
  #if: {{{image|}}}{{{imagetextbefore|}}}{{{imagetextafter|}}}
    | </div>
  | </div>
  }}
}}
  </div>
</div>
  <div style="width: 100%;">{{
<div style="width: 100%;">{{
    #if: {{{title|}}}
  #if: {{{title|}}}
    | <div style="font-weight: bold; display: inline">{{{title}}}</div>&nbsp;{{
  | <div style="font-weight: bold; display: inline">{{{title}}}</div>&nbsp;{{
      #if: {{{discuss|}}}{{{discussPage|}}}{{{discussAnchor|}}}
    #if: {{{discuss|}}}{{{discussPage|}}}{{{discussAnchor|}}}
      | <sup>[<nowiki/>{{DirectLink|{{
    | <sup>[<nowiki/>{{DirectLink|{{
        #if: {{{discussPage|}}}
      #if: {{{discussPage|}}}
        | {{{discussPage}}}
      | {{{discussPage}}}
        | {{TALKPAGENAME}}
      | {{TALKPAGENAME}}
      }}{{
    }}{{
        #if: {{{discussAnchor|}}}
      #if: {{{discussAnchor|}}}
        | &#35;{{{discussAnchor}}}
      | &#35;{{{discussAnchor}}}
      }}|discuss}}</sup>
    }}|discuss}}</sup>
    }}
  }}
  }}{{
}}{{
    #if: {{{linkshere|}}}
  #if: {{{linkshere|}}}
    | <sup>{{#if:{{{discuss|}}}|, <nowiki/>|[<nowiki/>}}[[Special:WhatLinksHere/{{FULLPAGENAME}}|links]]{{#ifeq:{{NAMESPACENUMBER}}|6|, [[Special:GlobalUsage/{{PAGENAME}}|global usage]]}}<nowiki/>]</sup>
  | <sup>{{#if:{{{discuss|}}}|, <nowiki/>|[<nowiki/>}}[[Special:WhatLinksHere/{{FULLPAGENAME}}|links]]{{#ifeq:{{NAMESPACENUMBER}}|6|, [[Special:GlobalUsage/{{PAGENAME}}|global usage]]}}<nowiki/>]</sup>
    | {{
  | {{
      #if:{{{discuss|}}}
    #if:{{{discuss|}}}
      |<sup>]</sup>
    |<sup>]</sup>
    }}
  }}
  }}
}}
  {{
{{
    #if: {{{text|}}}
  #if: {{{text|}}}
    | <div class="msgbox-text">{{{text}}}</div>
  | <div class="msgbox-text">{{{text}}}</div>
  }}
}}
  </div>
</div>
  </div></includeonly><noinclude>
</div></includeonly><noinclude>
=== Documentation ===
=== Documentation ===
This template is used to add consistent styling to message boxes.


Examples:
== Usage ==
<syntaxhighlight lang="wikitext">{{Message box
| mini = Mini mode
| small = Mini mode
| subtle = Subtle mode
| class = Classes for the template
| type = Notice type
| bgcol = Custom background color
| linecol = Custom line color
| width = Custom width
| float = Custom alignment
| icon = Icon from Template:CommentSprite
| imagecss = Custom image CSS
| image = Extra image
| imagetextbefore = Text before the image
| imagetextafter = Text after the image
| imagesize = Image size
| imageclass = Image class
| dolinkimage = Whether the image links to its file page (usually unnecessary, defaults to no link)
| title = Template title
| discuss = Discuss button
| discussPage = Talk page link
| discussAnchor = Talk page section specification
| linkshere = Links button to Special:WhatLinksHere
| text = Template text
| css = Custom CSS
}}</syntaxhighlight>
 
== Examples ==
<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="wikitext">
{{MessageBox
{{MessageBox
| type = minor
| type = minor
| title = Minor Edit Notice
| title = Minor edit notice
| text = This page contains minor formatting improvements and spelling corrections. No major content changes were made.
| text = This page contains minor formatting improvements and spelling corrections. No major content changes were made.
| discuss = 1
}}
}}
</syntaxhighlight>
</syntaxhighlight>
{{MessageBox
{{MessageBox
| type = minor
| type = minor
| title = Minor Edit Notice
| title = Minor edit notice
| text = This page contains minor formatting improvements and spelling corrections. No major content changes were made.
| text = This page contains minor formatting improvements and spelling corrections. No major content changes were made.
| discuss = 1
}}
}}
{{-}}


---
<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="wikitext">
{{MessageBox
{{MessageBox
Line 102: Line 129:
| text = This page has been nominated for deletion due to lack of content. Please review and vote.
| text = This page has been nominated for deletion due to lack of content. Please review and vote.
}}
}}
---
{{-}}
 
<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="wikitext">
{{MessageBox
{{MessageBox
Line 117: Line 145:
| text = Important information: Server maintenance scheduled for tonight from 2 AM to 4 AM UTC.
| text = Important information: Server maintenance scheduled for tonight from 2 AM to 4 AM UTC.
}}
}}
---
{{-}}
 
<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="wikitext">
{{MessageBox
{{MessageBox
| type = major
| type = major
| subtle = 1
| subtle = 1
| title = Major Content Update
| text = This article has been significantly expanded with new sections on gameplay mechanics and strategy guides.
| discuss = 1
| discuss = 1
| title = Major content issue
| text = This article contains significant problems including outdated information, broken links, and inaccurate gameplay mechanics descriptions.
}}
}}
</syntaxhighlight>
</syntaxhighlight>
Line 130: Line 159:
| type = major
| type = major
| subtle = 1
| subtle = 1
| title = Major Content Update
| text = This article has been significantly expanded with new sections on gameplay mechanics and strategy guides.
| discuss = 1
| discuss = 1
| title = Major content issue
| text = This article contains significant problems including outdated information, broken links, and inaccurate gameplay mechanics descriptions.
}}
}}
{{-}}


<syntaxhighlight lang="wikitext">
{{MessageBox
| type = notice
| title = Template usage
| linkshere = 1
| text = This template is used in several places across the wiki.
}}
</syntaxhighlight>
{{MessageBox
| type = notice
| title = Template usage
| linkshere = 1
| text = This template is used in several places across the wiki.
}}
{{-}}


---
<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="wikitext">
{{MessageBox
{{MessageBox
| type = notice
|| type = notice
| mini = 1
|| mini = 1
| icon = 8
|| icon = 8
| bgcol = rgba(255, 235, 59, 0.1)
|| bgcol = rgba(255, 235, 59, 0.1)
| linecol = rgba(255, 235, 59, 0.3)
|| linecol = rgba(255, 235, 59, 0.3)
| css = border-radius: 8px; font-style: italic;
|| css = border-radius: 8px; font-style: italic;
| text = Notice: The wiki will be temporarily unavailable during the server migration next weekend.
|| text = Notice: The wiki will be temporarily unavailable during the server migration next weekend.
}}
}}
</syntaxhighlight>
</syntaxhighlight>
Line 163: Line 201:
| text = Notice: The wiki will be temporarily unavailable during the server migration next weekend.
| text = Notice: The wiki will be temporarily unavailable during the server migration next weekend.
}}
}}
---
{{-}}
 
<syntaxhighlight lang="wikitext">
<syntaxhighlight lang="wikitext">
{{MessageBox
{{MessageBox
Line 185: Line 224:
}}
}}


[[ru:Шаблон:MessageBox]]
== Source ==
 
This template is a fork of [https://minecraft.wiki/w/Template:message_box Minecraft Wiki's message_box template] and is quite complex in its implementation.
 
This template is used for creating local informational messages.
 
In most cases, it is recommended to use standalone templates created based on it rather than using MessageBox directly.
 
Styles are described on the MediaWiki:Common.css page.
 
 
[[Category:Notice templates]]
 
[[ru:Template:MessageBox]]
</noinclude>
</noinclude>

Latest revision as of 16:57, 15 January 2026

Documentation

This template is used to add consistent styling to message boxes.

Usage

{{Message box
| mini = Mini mode
| small = Mini mode
| subtle = Subtle mode
| class = Classes for the template
| type = Notice type
| bgcol = Custom background color
| linecol = Custom line color
| width = Custom width
| float = Custom alignment
| icon = Icon from Template:CommentSprite
| imagecss = Custom image CSS
| image = Extra image
| imagetextbefore = Text before the image
| imagetextafter = Text after the image
| imagesize = Image size
| imageclass = Image class
| dolinkimage = Whether the image links to its file page (usually unnecessary, defaults to no link)
| title = Template title
| discuss = Discuss button
| discussPage = Talk page link
| discussAnchor = Talk page section specification
| linkshere = Links button to Special:WhatLinksHere
| text = Template text
| css = Custom CSS
}}

Examples

{{MessageBox
| type = minor
| title = Minor edit notice
| text = This page contains minor formatting improvements and spelling corrections. No major content changes were made.
}}
Minor edit notice
 
This page contains minor formatting improvements and spelling corrections. No major content changes were made.
{{MessageBox
| type = delete
| mini = 1
| icon = 8
| text = This page has been nominated for deletion due to lack of content. Please review and vote.
}}
This page has been nominated for deletion due to lack of content. Please review and vote.
{{MessageBox
| type = info
| small = 1
| icon = 8
| text = Important information: Server maintenance scheduled for tonight from 2 AM to 4 AM UTC.
}}
Important information: Server maintenance scheduled for tonight from 2 AM to 4 AM UTC.
{{MessageBox
| type = major
| subtle = 1
| discuss = 1
| title = Major content issue
| text = This article contains significant problems including outdated information, broken links, and inaccurate gameplay mechanics descriptions.
}}
Major content issue
 [discuss]
This article contains significant problems including outdated information, broken links, and inaccurate gameplay mechanics descriptions.
{{MessageBox
| type = notice
| title = Template usage
| linkshere = 1
| text = This template is used in several places across the wiki.
}}
Template usage
 [links]
This template is used in several places across the wiki.
{{MessageBox
|| type = notice
|| mini = 1
|| icon = 8
|| bgcol = rgba(255, 235, 59, 0.1)
|| linecol = rgba(255, 235, 59, 0.3)
|| css = border-radius: 8px; font-style: italic;
|| text = Notice: The wiki will be temporarily unavailable during the server migration next weekend.
}}
Notice: The wiki will be temporarily unavailable during the server migration next weekend.
{{MessageBox
| type = issue
| small = 1
| icon = 8
| bgcol = rgba(255, 87, 34, 0.1)
| linecol = rgba(255, 87, 34, 0.3)
| css = box-shadow: 0 2px 8px rgba(255, 87, 34, 0.2);
| text = Content issue detected: This article may contain outdated information. Please verify with latest game version.
}}
Content issue detected: This article may contain outdated information. Please verify with latest game version.

Source

This template is a fork of Minecraft Wiki's message_box template and is quite complex in its implementation.

This template is used for creating local informational messages.

In most cases, it is recommended to use standalone templates created based on it rather than using MessageBox directly.

Styles are described on the MediaWiki:Common.css page.