Шаблон:Ambox — различия между версиями
Wikiadmin (обсуждение | вклад) м (Защищена страница «Шаблон:Ambox» ([edit=sysop] (бессрочно) [move=sysop] (бессрочно))) |
Wikiadmin (обсуждение | вклад) |
||
Строка 1: | Строка 1: | ||
− | < | + | <table class="metadata plainlinks noprint ambox {{#switch:{{{small|}}} |
− | {{# | + | | left = mbox-small-left width="20%" |
− | + | }} " style="{{{style|}}}margin:0 25% 1.5em;border:1px solid #AAAAAA;{{#switch:{{{type|}}} | |
− | {{#if:{{{imageright|}}}|{{ | + | | speedy = background:#FFDDDD;border-left:10px #B22222 solid; |
− | + | | delete = background:#FBFBFB;border-left:10px #B22222 solid; | |
− | + | | content = background:#FBFBFB;border-left:10px #F28500 solid; | |
+ | | approval = background:#FBFBFB;border-left:10px #0B610B solid; | ||
+ | | move = background:#FBFBFB;border-left:10px #9933CC solid; | ||
+ | | style = background:#FBFBFB;border-left:10px #F4C430 solid; | ||
+ | | protection = background:#FBFBFB;border-left:10px #BBBBAA solid; | ||
+ | | hierarchy = background:#FBFBFB;border-left:10px #9933CC solid; | ||
+ | | notice<!-- = default --> | ||
+ | | custom = background:#FBFBFB;border-left:10px {{{color}}} solid; | ||
+ | | #default = background:#FBFBFB;border-left:10px #1E90FF solid; | ||
+ | }}{{#if:{{{stacked|}}}|border-top:-1px;}}"><tr> | ||
+ | {{#switch:{{{image|}}} | ||
+ | | blank <!-- Fall back to "none", since deprecated. --> | ||
+ | | none = | ||
+ | <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. --> | ||
+ | | #default = | ||
+ | <td class="mbox-image" style="border:none;padding:2px 0 2px 0.9em;text-align:center;">{{#switch:{{{small|}}} | ||
+ | | left = <!-- Don't use the DIV --> | ||
+ | | #default = <div style="width:25px;"> | ||
+ | }}{{#if:{{{image|}}} | ||
+ | | {{{image}}} | ||
+ | | {{#switch:{{{type|}}} | ||
+ | | speedy = [[File:Ambox speedy deletion.png|Speedy|{{#switch:{{{small|}}}|left=25x25px|#default=40x40px}}|link=]] | ||
+ | | delete = [[File:Ambox deletion.png|Delete|{{#switch:{{{small|}}}|left=25x25px|#default=40x40px}}|link=]] | ||
+ | | content = [[File:Ambox content.png|Content|{{#switch:{{{small|}}}|left=25x25px|#default=40x40px}}|link=]] | ||
+ | | approval = [[File:Thumb up icon.svg|Approval|{{#switch:{{{small|}}}|left=25x25px|#default=40x40px}}|link=]] | ||
+ | | move = [[File:Ambox_move.png|Move|{{#switch:{{{small|}}}|left=20x20px|#default=25x25px}}|link=]] | ||
+ | | style = [[File:Edit-clear.svg|Style|{{#switch:{{{small|}}}|left=20x20px|#default=25x25px}}|link=]] | ||
+ | | protection = [[File:Ambox protection.png|Protection|{{#switch:{{{small|}}}|left=20x20px|#default=40x40px}}|link=]] | ||
+ | | hierarchy = [[File:Categorisation-hierarchy-top2down.svg|hHerarchy|{{#switch:{{{small|}}}|left=20x20px|#default=40x40px}}|link=]] | ||
+ | | notice<!-- = default --> | ||
+ | | #default = [[File:Ambox notice.png|Information|{{#switch:{{{small|}}}|left=25x25px|#default=40x40px}}|link=]] | ||
+ | }} | ||
+ | }}{{#switch:{{{small|}}} | ||
+ | | left = <!-- Don't use the /DIV --> | ||
+ | | #default = </div> | ||
+ | }}</td> | ||
+ | }} | ||
+ | <td class="mbox-text" style="{{{textstyle|}}}width:100%;border:none;padding:0.25em 0.9em;text-align:left;font-size:80%;line-height:1.4em;">{{#if:{{{small|}}}|<abbr title="{{{text|}}}">{{{smalltext|}}}</abbr>|{{{text|}}}}}</td> | ||
+ | {{#if:{{{imageright|}}} | ||
+ | | {{#ifeq:{{{imageright|}}}|none | ||
+ | | <!-- No image. --> | ||
+ | | <td class="mbox-imageright" style="border:none;padding:2px 0.9em 2px 0;text-align:center;">{{#switch:{{{small|}}} | ||
+ | | left = {{{imageright|}}} | ||
+ | | #default = <div style="width:{{{imagerightwidth|52}}}px;">{{{imageright|}}}</div> | ||
+ | }}</td> | ||
+ | }} | ||
+ | }} | ||
+ | </tr></table><noinclude>{{documentation}}</noinclude> |
Текущая версия на 11:21, 14 мая 2015
Note to editors: Please don't categorize this template by editing it directly. Instead, place the category in its documentation page, in its "includeonly" section.
History
This is the {{ambox}} or Article message box meta-template.
It is used to build article message box templates such as style. It offers several different colours, uses default images if no image parameter is given, and has some other features.
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:
The type parameter defines the colour of the left bar, and the image that is used by default. The type is chosen not on aesthetics but is based on the type of issue that the template describes. The seven available types and their default images are shown below.
The box and text will not appear in printed copies of pages; this is by design, as page maintenance notices are only of value if the user is online and able to edit the page to fix the issues.