Difference between revisions of "Template:Ambox"

From Second Life Wiki
Jump to navigation Jump to search
(copied from wikipedia)
 
m (Missed the 'caution' icon...)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!--{{Ambox}} begin-->{{#switch:{{{small|}}}
<table class="{{Dir|lang={{{lang|}}}|rtl=mw-content-rtl}} metadata plainlinks ambox {{#switch:{{{small|}}}
| left =  
|left = mbox-small-left
  {{Ambox/core
}}" style="margin:2px 10%;{{#if:{{{stacked|}}}|margin-top:-3px;}}{{#switch:{{{type|}}}
  | small      = left
|danger = background:#FAA;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #B22222
  | type      = {{{type|}}}
|warning = background:#FDD;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #B22222
  | image      = {{#if:{{{smallimage|}}}
|caution = background:#FFA;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #F28500
                | {{{smallimage}}}
|approval = background:#DFD;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #0F0
                | {{{image|}}}
|proposal = background:#E4D8FF;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #9933CC
                }}
|detail = background:#FBFBFB;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #F4C430
  | imageright = {{#if:{{{smallimageright|}}}
|protection = background:#FBFBFB;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #BBA
                | {{{smallimageright}}}
|notice<!-- = default -->
                | {{{imageright|}}}
|#default = background:#FBFBFB;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #1E90FF
                }}
}};{{{style|}}}"><tr><!--
   | style     = {{{style|}}}
-->{{#switch:{{{image|}}}
   | textstyle  = {{{textstyle|}}}
|blank<!--Fall back to "none", since deprecated.-->
   | text      = {{#if:{{{smalltext|}}}
|none =
                | {{{smalltext}}}  
  <td class="mbox-empty-cell" style="width:1px;border:none;padding:0"></td><!--No image. Cell with some width or padding necessary for text cell to have 100% width.-->
                | {{{text}}}  
|#default =
                }}
  <td class="mbox-image" style="border:none;padding:2px 0;padding-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:.25em;text-align:center">{{#switch:{{{small|}}}
  }}
   |left = <!-- Don't use the DIV -->
| #default =  
  |#default = <div style="width:52px">
   {{Ambox/core
  }}{{#if:{{{image|}}}
   | type      = {{{type|}}}
   | {{{image|}}}
  | image      = {{{image|}}}
   | [[File:{{#switch:{{{type|}}}
  | imageright = {{{imageright|}}}
    |danger = Ambox warning.png{{!}}Danger
   | style     = {{{style|}}}
    |warning = Ambox warning.png{{!}}Warning
  | textstyle  = {{{textstyle|}}}
    |caution = Imbox content.png{{!}}Caution
  | text      = {{{text}}}
    |approval = Thumb up icon.png{{!}}Approved
    |proposal = Ambox warning purple.png{{!}}Proposal
    |detail = Edit-clear.png{{!}}Detail
    |protection = Imbox protection.png{{!}}Protection
    |notice<!-- = default -->
    |#default = Ambox notice.png{{!}}Information
    }}|{{#switch:{{{small|}}}  
    | left = 20x20px
    | #default = 40x40px
    }}|link=]]
   }}{{#switch:{{{small|}}}
  |left = <!-- Don't use the /DIV -->
   |#default = </div>
  }}</td>
}}<!--
--><td class="mbox-text" style="width:100%;border:none;padding:.25em;text-align:center;{{{textstyle|}}}">{{#if:{{{edit|}}}
| <div style="float:{{Dir|lang={{{lang|}}}|rtl=left|ltr=right}}">{{Edit|{{{edit|}}}}}</div>
}}{{#if:{{{text|}}}
| <nowiki />
{{{text|}}}
| <span class="error">A non-empty {{Para|text}} parameter value is required in {{T|Ambox|...}}.</span>
}}</td><!--
-->{{#if:{{{imageright|}}}
| {{#ifeq:{{{imageright|}}}|none
  | <!--No image.-->
   | <td class="mbox-imageright" style="border:none;padding:2px 0;padding-{{Dir|lang={{{lang|}}}|rtl=left|ltr=right}}:.9em;text-align:center">{{#switch:{{{small|}}}
    |left = {{{imageright|}}}
    |#default = <div style="width:{{{imagerightwidth|52}}}px">{{{imageright|}}}</div>
    }}</td>
   }}
   }}
}}<!--
}}<!--
 
--></tr></table><noinclude>{{Documentation}}</noinclude>
--><includeonly>{{#ifeq:{{BASEPAGENAME}}|{{SUBPAGENAME}}|{{#ifeq:{{NAMESPACE}}|Template|[[Category:Article message boxes]]}}}}</includeonly><!--
 
--><!--{{Ambox}} end--><noinclude>
 
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>

Latest revision as of 18:01, 13 September 2022

[Edit] [🔄Purge] Template-info.png Template documentation

{{Ambox}} stands for Article message box. This template is used in many pages.

History

This template is a derived work. It is, however, NOT exactly the same as Wikipedia's template of the same name! All CSS has been integrated into the template, and therefore some features are not available. However it is still a very useful template!

Usage instructions

Example to display a notice:

{{Ambox
| type = notice
| text = Hello world!
}}

The code above should return:

There are lots more examples of ambox use on the Wiki labels page.

type

Amboxes are divided into various types. Each type should have a corresponding colour code. The colour-coding helps to inform of the severity of the issues at a glance, so you can use the following parameters to change the color of your ambox.

stacked

To display multiple boxes stacked on top of each other (without anything else between them), you may set the optional stacked= parameter to any non-empty value for all successive occurences of the box (except the first one), as in the examples above.

imageright

You can display an additional small image (icon) on the right hand side of the box by passing an 'imageright' parameter with an image reference. For example:

imageright = [[File:Broom icon.svg|40px|link=WikiProject Cleanup]]

(This adds the little sweeping broom icon on the right which you see on Template:Cleanup)

See also

  • {{Merge}} – warning & proposal to for merging two different article pages
  • {{Wfmessage}} – "webpage flow message" based on the style of the homepage