Difference between revisions of "Template:Ambox"

From Self-sufficiency
Jump to: navigation, search
(sync tracking cat with other mbox templates)
(Deploying the "small=left" feature, thus now using {{ambox/core}}. Tested in /sandbox and discussed in many places, see talk page.)
Line 1: Line 1:
<table class="metadata plainlinks ambox
+
{{#switch:{{{small|}}}
{{#switch:{{{type|}}}
+
| left =  
| speedy    = ambox-speedy
+
  {{ambox/core
| delete    = ambox-delete
+
  | small     = left
| content    = ambox-content
+
  | type       = {{{type|}}}
| style     = ambox-style
+
  | image      = {{#if:{{{smallimage|}}}
| move       = ambox-move
+
                | {{{smallimage}}}
| protection = ambox-protection
+
                | {{{image|}}}
| notice    <!-- notice = default -->
+
                }}
| #default  = ambox-notice
+
   | imageright = {{#if:{{{smallimageright|}}}
}}" style="{{{style|}}}">
+
                | {{{smallimageright}}}
<tr>
+
                | {{{imageright|}}}
{{#ifeq:{{{image|}}}|none
+
                }}
| <!-- No image. Cell with some width or padding necessary for text cell to have 100% width. --><td style="border: none; padding: 0px; width: 1px;"></td>
+
  | style      = {{{style|}}}
| <td class="mbox-image"><div style="width: 52px;">
+
  | textstyle  = {{{textstyle|}}}
  {{#ifeq:{{{image|}}}|blank
+
  | text       = {{#if:{{{smalltext|}}}
  | &nbsp;
+
                | {{{smalltext}}}  
   | {{#if:{{{image|}}}
+
                | {{{text}}}  
    | {{{image}}}
+
                }}
    | {{#switch:{{{type|}}}
+
  }}
      | speedy    = [[Image:Ambox speedy deletion.png|40x40px]]
+
| #default =  
      | delete    = [[Image:Ambox deletion.png|40x40px]]
+
  {{ambox/core
      | content    = [[Image:Ambox content.png|40x40px]]
+
  | type      = {{{type|}}}
      | style      = [[Image:Ambox style.png|40x40px]]
+
  | image      = {{{image|}}}
      | move      = [[Image:Ambox move.png|40x40px]]
+
  | imageright = {{{imageright|}}}
      | protection = [[Image:Ambox protection.png|40x40px]]
+
  | style     = {{{style|}}}
       | notice    <!-- notice = default -->
+
  | textstyle  = {{{textstyle|}}}
      | #default  = [[Image:Ambox notice.png|40x40px]]
+
   | text       = {{{text}}}
      }}
+
  }}
    }}
+
  }}</div></td>
+
}}
+
<td class="mbox-text" style="{{{textstyle|}}}"> {{{text}}} </td>
+
{{#if:{{{imageright|}}}
+
| <td class="mbox-imageright"><div style="width: 52px;"> {{{imageright}}} </div></td>
+
}}
+
</tr>
+
</table><!-- Detect and report usage with faulty "type" parameter:
+
-->{{#switch:{{{type|}}}
+
|   <!-- No type fed, is also valid input -->
+
| speedy
+
| delete
+
| content
+
| style
+
| move
+
| protection
+
| notice    =    <!-- Do nothing, valid "type" -->
+
| #default  = <div style="text-align: center;">This message box is using an invalid "type={{{type|}}}" parameter and needs fixing.</div>[[Category:Wikipedia message box parameter needs fixing|{{main other|Main:}}{{FULLPAGENAME}}]]<!-- Sort on namespace -->
+
 
}}<noinclude>
 
}}<noinclude>
  
{{pp-template|small=yes}}
+
{{pp-template}}
{{Documentation}}
+
{{documentation}}
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
</noinclude>
 
</noinclude>

Revision as of 20:21, 15 March 2009