Difference between revisions of "Template:Ambox"

From Second Life Wiki
Jump to navigation Jump to search
(Now we can see the documentation again!)
(Shamelessly copied from wiki.openstreetmap.org and adapted (SVGs became PNG))
Line 1: Line 1:
{{#ifeq:{{{subst}}}|SUBST
<table class="{{Dir|lang={{{lang|}}}|rtl=mw-content-rtl}} metadata plainlinks ambox {{#switch:{{{small|}}}
|{{#if:{{{name|}}}
|left = mbox-small-left
  |{{Error|Template {{tlx|{{{name}}}}} has been incorrectly substituted.}}
}}" style="margin:2px 10%;{{#if:{{{stacked|}}}|margin-top:-3px;}}{{#switch:{{{type|}}}
}}[[Category:Pages with incorrectly substituted templates]]
|danger = background:#FAA;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #B22222
}}{{Ambox/{{#ifeq:{{{small}}}|left|small|core}}
|warning = background:#FDD;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #B22222
  |type = {{{type|}}}
|caution = background:#FFA;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #F28500
  |image = {{{image|}}}
|approval = background:#DFD;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #0F0
  |smallimage = {{#if:{{{smallimage|}}}|{{{smallimage}}}|{{{image|}}}}}
|proposal = background:#E4D8FF;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #9933CC
  |imageright = {{{imageright|}}}
|detail = background:#FBFBFB;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #F4C430
  |smallimageright = {{#if:{{{smallimageright|}}}|{{{smallimageright}}}|{{{imageright|}}}}}
|protection = background:#FBFBFB;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #BBA
  |class = ambox-{{#switch:{{{type|}}}
|notice<!-- = default -->
  |speedy = speedy
|#default = background:#FBFBFB;border:1px solid #AAA;border-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:10px solid #1E90FF
  |delete = delete
}};{{{style|}}}"><tr><!--
  |content = content
-->{{#switch:{{{image|}}}
  |style = style
|blank<!--Fall back to "none", since deprecated.-->
  |move = move
|none =
  |protection = protection
   <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.-->
  |notice
|#default =
  |#default = notice
  <td class="mbox-image" style="border:none;padding:2px 0;padding-{{Dir|lang={{{lang|}}}|rtl=right|ltr=left}}:.25em;text-align:center">{{#switch:{{{small|}}}
}} {{{class|}}}
   |left = <!-- Don't use the DIV -->
  |style = {{{style|}}}
   |#default = <div style="width:52px">
  |textstyle  = {{{textstyle|}}}
  }}{{#if:{{{image|}}}
  |smalltext  = {{{smalltext|}}}
  | {{{image|}}}
  |talk = {{#switch:{{{talk|¬}}}
   | [[File:{{#switch:{{{type|}}}
  |¬        = <!-- No talk link used -->
    |danger = Ambox warning.png{{!}}Danger
  |         = {{#ifeq:{{FULLROOTPAGENAME}}|Template:{{PAGENAME:{{{name}}}}}|#}}
    |warning = Ambox warning.png{{!}}Warning
  |#default = {{{talk}}}
    |caution = Ambox important.svg{{!}}Caution
}}
    |approval = Thumb up icon.png{{!}}Approved
|issue = {{#switch:{{{sect|¬}}}
    |proposal = Ambox warning purple.png{{!}}Proposal
  |¬ = <!-- No section parameter used -->
    |detail = Edit-clear.png{{!}}Detail
  | = This article
    |protection = Imbox protection.png{{!}}Protection
   |This {{{sect}}}
    |notice<!-- = default -->
}} {{{issue<includeonly>|</includeonly>}}} {{{text|}}}
    |#default = Ambox notice.png{{!}}Information
|fix = {{{fix<includeonly>|</includeonly>}}}
    }}|{{#switch:{{{small|}}}  
|date = {{#switch:{{{date|¬}}}
    | left = 20x20px
   |¬        = <!-- No date used -->
    | #default = 40x40px
   |         = {{#ifeq:{{FULLROOTPAGENAME}}|Template:{{PAGENAME:{{{name}}}}}|{{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}
    }}|link=]]
   |#default = {{{date}}}
   }}{{#switch:{{{small|}}}
}}
   |left = <!-- Don't use the /DIV -->
|info = {{{info|}}}
  |#default = </div>
}}{{Category handler
  }}</td>
|nocat={{{nocat|<noinclude>true</noinclude>}}}
}}<!--
|main={{Ambox/category
--><td class="mbox-text" style="width:100%;border:none;padding:.25em;text-align:center;{{{textstyle|}}}">{{#if:{{{edit|}}}
  |cat={{{cat|{{{category|}}}}}}  
| <div style="float:{{Dir|lang={{{lang|}}}|rtl=left|ltr=right}}">{{Edit|{{{edit|}}}}}</div>
  |all={{{all|}}}
}}{{#if:{{{text|}}}
  |date={{{date|}}}
| <nowiki />
}}{{Ambox/category
{{{text|}}}
  |cat={{{cat2|{{{category2|}}}}}}
| <span class="error">A non-empty {{Para|text}} parameter value is required in {{T|Ambox|...}}.</span>
   |all={{{all2|}}}  
}}</td><!--
   |date={{{date|}}}
-->{{#if:{{{imageright|}}}
}}{{Ambox/category
| {{#ifeq:{{{imageright|}}}|none
  |cat={{{cat3|{{{category3|}}}}}}  
  | <!--No image.-->
  |all={{{all3|}}}
  | <td class="mbox-imageright" style="border:none;padding:2px 0;padding-{{Dir|lang={{{lang|}}}|rtl=left|ltr=right}}:.9em;text-align:center">{{#switch:{{{small|}}}
  |date={{{date|}}}
    |left = {{{imageright|}}}
}}
    |#default = <div style="width:{{{imagerightwidth|52}}}px">{{{imageright|}}}</div>
|template={{#switch:Template:{{{name|}}}
    }}</td>
  |{{FULLPAGENAME}} = [[Category:Article message templates]]{{#ifexpr:{{#ifeq:{{{issue|¬}}}|¬|1|0}}+{{#ifeq:{{{fix|¬}}}|¬|1|0}}+{{#ifeq:{{{subst|¬}}}|¬|1|0}}
  |[[Category:Article message templates with missing parameters|{{#expr:{{#ifeq:{{{issue|¬}}}|¬|1|0}}+{{#ifeq:{{{fix|¬}}}|¬|1|0}}+{{#ifeq:{{{subst|¬}}}|¬|1|0}}}}]]
  }}{{#if:{{{category|}}}{{{category2|}}}{{{category3|}}}
  |[[Category:Article message templates with missing parameters|C]]
   }}
   }}
  |Template:        = {{#ifeq:{{BASEPAGENAME}}|{{SUBPAGENAME}}|[[Category:Article message templates with missing parameters]]}}
}}<!--
}}
--></tr></table><noinclude>{{Documentation}}</noinclude>
}}<noinclude>
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>

Revision as of 13:41, 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