Difference between revisions of "Template:Ambox"

From Game Detectives Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(Adding the printing of an error message when invalid "type" parameter. Thus making it much easier to find which message box on a page is reporting an error.)
 
(69 intermediate revisions by 34 users not shown)
Line 1: Line 1:
<table class="metadata plainlinks ambox
+
{{#invoke:Message box|ambox}}<noinclude>
{{#switch:{{{type|}}}
+
{{ {{TNTN|documentation}} }}
| speedy    = ambox-speedy
 
| serious    <!-- This value is **deprecated**, please don't use it! -->
 
| delete    = ambox-delete
 
| content    = ambox-content
 
| style      = ambox-style
 
| merge      <!-- This value is **deprecated**, please don't use it! -->
 
| move      = ambox-move
 
| protection = ambox-protection
 
| notice    <!-- notice = default -->
 
| #default  = ambox-notice
 
}}" style="{{{style|}}}">
 
<tr>
 
{{#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>
 
| <td class="mbox-image"><div style="width: 52px;">
 
  {{#ifeq:{{{image|}}}|blank
 
  | &nbsp;
 
  | {{#if:{{{image|}}}
 
    | {{{image}}}
 
    | {{#switch:{{{type|}}}
 
      | speedy    = [[Image:Ambox speedy deletion.png|40x40px]]
 
      | serious    <!-- This value is **deprecated**, please don't use it! -->
 
      | delete    = [[Image:Ambox deletion.png|40x40px]]
 
      | content    = [[Image:Ambox content.png|40x40px]]
 
      | style      = [[Image:Ambox style.png|40x40px]]
 
      | merge      <!-- This value is **deprecated**, please don't use it! -->
 
      | move      = [[Image:Ambox move.png|40x40px]]
 
      | protection = [[Image:Ambox protection.png|40x40px]]
 
      | notice    <!-- notice = default -->
 
      | #default  = [[Image:Ambox notice.png|40x40px]]
 
      }}
 
    }}
 
  }}</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. ([[:Category:Ambox templates using deprecated types|learn more]])</div>[[Category:Ambox templates using deprecated types|{{main other|Main:}}{{FULLPAGENAME}}]]<!-- Sort on namespace -->
 
}}<noinclude>
 
 
 
{{pp-template|small=yes}}
 
{{Documentation}}
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
 
</noinclude>
 
</noinclude>

Latest revision as of 16:05, 18 May 2018

<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