Template:Message box: Difference between revisions

From Modded Wiki
Jump to navigation Jump to search
This doesn't work at all
m 96 revisions imported
 
(71 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<includeonly><div style="background-color: {{{bgcol|#FFFFCC}}}; border: 2px solid {{{linecol|#616161}}}; {{#if: {{{mini||1}}} | padding: 3px 6px; margin: 2px 2px; display: inline; | padding: 3px 12px; margin: 2px auto; max-width: {{{width|640px}}}; text-align:center;}} {{{css|}}}"><!--
<includeonly><div
-->{{#if: {{{title|}}} | '''{{{title|}}}''' }}{{#if: {{{discuss||1}}} | <sup>[[{{TALKPAGENAME}}|Discuss]]</sup> }}<!--
class="msgbox searchaux {{#if: {{{mini|{{{small|}}}}}} | msgbox-mini | }} {{
-->{{#if: {{{icon|}}} | {{CommentSprite| {{{icon|}}} }}&nbsp; }}{{#if: {{{text|}}} | {{#if: {{{title|}}} | <br /> }} {{{text|}}} }}</div></includeonly><noinclude>
  #switch: {{{type|}}}
== Usage ==
  | style | display | presentation = msgbox-yellow
=== Basic usage ===
  | minor | minor-issue | content | issue = msgbox-orange
<pre>
  | major | major-issue | delete = msgbox-red
{{msgbox
  | organization | title | move = msgbox-purple
| title = This is a normal message box
  | details | parity | edition | upcoming = msgbox-blue
| text = With helpful and descriptive subtext
  | notice | note | info = msgbox-green
  | other = msgbox-magenta
  | #default = {{#if: {{#pos: {{{class|}}} | msgbox- <!-- end pos -->}} || msgbox-gray <!-- end if -->}}
}} {{{class|}}}"
style="
  max-width: {{{width|{{#if: {{{mini|{{{small|}}}}}} | 50em | 90% }}}}};
  {{#if: {{{subtle|}}} | max-width: 300px; float: right; clear: both; flex-direction: column; font-size: 95%; }}
  {{#if: {{{bgcol|}}} | background: {{{bgcol}}}; | }}
  {{#if: {{{linecol|}}} | border-left: 4px solid {{{linecol}}}; | }}
  {{#if: {{{float|}}} | float: {{{float}}}; | }}
  {{{css|}}}
  "
>
<div id="msgbox-icon"> {{
  #if: {{{icon|}}}
    | <div id="msgbox-iconimage" style="{{{imagecss|}}}">
}}{{
  #if: {{{image|}}}{{{imagetextbefore|}}}{{{imagetextafter|}}}
  | <div id="msgbox-image" style="{{{imagecss|}}}">
}} {{{imagetextbefore|}}}{{
  #if: {{{icon|}}}
  | {{CommentSprite | {{{icon|}}} }}
}}{{
  #if:{{{image|}}}
  |{{
      #if: {{{imageisraw|}}}
      | {{{image}}}
      | [[File:{{{image}}}|{{#if: {{{imagesize|}}}| {{{imagesize}}}| {{#if: {{{mini|{{{small|}}}}}} | 16px | 32px }}}}|text-top]]
}}}}{{{imagetextafter|}}}{{
  #if: {{{icon|}}}
  | </div>
}}{{
  #if: {{{image|}}}{{{imagetextbefore|}}}{{{imagetextafter|}}}
  | </div>
}}
}}
</pre>
</div>
 
<div style="width: 100%;">{{
Will result in:
  #if: {{{title|}}}
{{msgbox| title = This is a normal message box | text = With helpful and descriptive subtext}}
  | '''{{{title}}}'''&nbsp;{{
 
    #if: {{{discuss|}}}{{{discussPage|}}}{{{discussAnchor|}}}
=== Mini usage ===
    | <sup>[<nowiki/>{{direct link|{{
<pre>
      #if: {{{discussPage|}}}
{{msgbox
      | {{{discussPage}}}
| mini = 1
      | {{TALKPAGENAME}}
| icon = 8
    }}{{
| text = This is a mini message box with an information icon using [[Template:CommentSprite]]
      #if: {{{discussAnchor|}}}
      | &#35;{{{discussAnchor}}}
    }}|discuss}}</sup>
  }}
}}{{
  #if: {{{linkshere|}}}
  | <sup>{{#if:{{{discuss|}}}|, <nowiki/>|[<nowiki/>}}[[Special:WhatLinksHere/{{FULLPAGENAME}}|links]]{{#ifeq:{{NAMESPACENUMBER}}|6|, [[Special:GlobalUsage/{{PAGENAME}}|global usage]]}}<nowiki/>]</sup>
  | {{
    #if:{{{discuss|}}}
    |<sup>]</sup>
  }}
}}
}}
</pre>
{{
 
  #if: {{{text|}}}
Will result in:
  | <div id="msgbox-text">{{{text}}}</div>
{{msgbox| mini = 1 | icon = 8 | text = This is a mini message box with an information icon using [[Template:CommentSprite]]}}
 
=== Advanced usage ===
<pre>
{{msgbox
| bgcol = #eef
| linecol = #ddf
| title = This is a blue message box
| text = It has a discuss link, custom width and some custom CSS
| discuss = 1
| width = 340px
| css = -moz-box-shadow: 0px 0px 6px #888; -webkit-box-shadow: 0px 0px 6px #888;
}}
}}
</pre>
</div>
 
</div>{{
Will result in:
  #if: {{{subtle|}}}
{{msgbox| bgcol = #eef | linecol = #ddf | title = This is a blue message box | text = It has a discuss link, custom width and some custom CSS | discuss = 1 | width = 340px | css = -moz-box-shadow: 0px 0px 6px #888; -webkit-box-shadow: 0px 0px 6px #888;}}
  | <div class="mobileonly">{{-}}</div>
 
}}</includeonly><noinclude>
 
{{documentation}}
[[Category:Notice templates|M]]
<!-- Put categories/interwikis on the documentation page -->
</noinclude>
</noinclude>

Latest revision as of 11:33, 4 July 2024

[create] [refresh]Documentation
This template has no documentation. If you know how to use this template, please create it.