Версия для слабовидящих

Шаблон:Ambox — различия между версиями

Материал из Ярославский педагогический университет
Перейти к: навигация, поиск
 
(не показана 1 промежуточная версия 1 участника)
Строка 1: Строка 1:
<includeonly>{|class="metadata plainlinks ambox {{#if:{{{mini|}}}|ambox-mini}} {{#switch:{{{type|}}}|delete|serious|content|style|good|discussion|notice|merge=ambox-{{{type}}}|ambox-talk}}" {{#if:{{{style|}}}|style="{{{style}}}"}}
+
<table class="metadata plainlinks noprint ambox {{#switch:{{{small|}}}
{{#ifeq:{{{image|}}}|none||{{!}}class="ambox-image"{{!}}<div>{{#ifeq:{{{image}}}|blank|<span style="visibility:hidden;">&nbsp;</span>|{{#switch:{{{image|{{{type}}}}}}|delete|serious=[[File:Stop hand nuvola.svg|40px|Критические проблемы]]|content=[[File:Emblem-important.svg|40px|Проблемы с содержанием статьи]]|style=[[File:Broom icon.svg|40px|Стилевые проблемы]]|good=[[File:Green star boxed.svg|40px|Статус статьи]]|discussion=[[File:Nuvola apps ksirc.png|40px|Обсуждение]]|merge=[[File:Merge-split-transwiki default.svg|40x40px|Перенос содержимого]]|notice=[[File:Information.svg|40px|Информация]]|#default={{{image|[[File:Information.svg|40px|Информация]]}}}}}}}</div>}}
+
| left = mbox-small-left width="20%"
|class="ambox-text"|{{{text|<span style="font-size:smaller;color:#AAAAAA">Параметр&nbsp;''text'' не&nbsp;задан</span>}}}{{#if:{{{text-small|}}}|<div class="ambox-text-small">{{{text-small}}}</div>}}
+
}} " style="{{{style|}}}margin:0 25% 1.5em;border:1px solid #AAAAAA;{{#switch:{{{type|}}}
{{#if:{{{imageright|}}}|{{!}}class="ambox-imageright"{{!}}<div>{{{imageright}}}</div>}}
+
| speedy    = background:#FFDDDD;border-left:10px #B22222 solid;
|class="widthhack"|<!-- a hack for some cases to keep the box wide -->
+
| delete    = background:#FBFBFB;border-left:10px #B22222 solid;
|}</includeonly><noinclude></noinclude>
+
| 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

[view] [edit] [history] [purge] Template-info.svg Template documentation


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.