Difference between revisions of "Template:Ambox"

From Game Detectives Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(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 19:21, 15 March 2009

<templatestyles src="Module:Documentation/styles.css"></templatestyles>
Template documentation[view] [edit] [history] [purge]
Description

This is the {{Ambox}} or Article message box meta-template.

Usage
{{Ambox|type=content|text=my text here}}, or
{{Ambox|type=speedy|text=my text here}}, etc
type

The type parameter defines the color 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.

If no type parameter is given the template defaults to |type=notice.

See also