Template:Ambox: Difference between revisions

From Nottinghack Wiki
Jump to navigation Jump to search
Created page with "{{#ifeq:{{{subst}}}|SUBST |{{#if:{{{name|}}} |{{error|Template {{tlx|{{{name}}}}} has been incorrectly substituted.}} }}[[Category:Pages with incorrectly substituted template..."
 
No edit summary
Line 1: Line 1:
{{#ifeq:{{{subst}}}|SUBST
<table class="metadata plainlinks ambox {{#switch:{{{type|}}}
|{{#if:{{{name|}}}
| speedy    = ambox-speedy
   |{{error|Template {{tlx|{{{name}}}}} has been incorrectly substituted.}}
| delete    = ambox-delete
}}[[Category:Pages with incorrectly substituted templates]]
| content    = ambox-content
}}{{#ifeq:{{{small}}}|left
| style      = ambox-style
|{{Ambox/core
| move      = ambox-move
  |small     = left
| protection = ambox-protection
   |type      = {{{type|}}}
| notice    <!-- notice = default -->
  |image      = {{#if:{{{smallimage|}}}
| #default  = ambox-notice
  |{{{smallimage}}}
}}" style="{{{style|}}}">
  |{{{image|}}}
<tr>
{{#switch:{{{image|}}}
| blank    <!-- Fall back to "none", since deprecated. -->
| none = <td class="mbox-empty-cell"></td>   <!-- No image. Cell with some width or padding necessary for text cell to have 100% width. -->
| #default =
  <td class="mbox-image"><div style="width: 52px;">
  {{#if:{{{image|}}}
  | {{{image}}}
  | [[File:{{#switch:{{{type|}}}
    | speedy    = Ambox speedy deletion.png
    | delete    = Ambox deletion.png
    | content    = Ambox content.png
    | style     = Edit-clear.svg
    | move      = Ambox move.png
    | protection = Ambox protection.png
    | notice          <!-- notice = default -->
    | #default   = Ambox notice.png
    }} | 40x40px |link=|alt=]]
  }}</div>
  </td>
}}
<td class="mbox-text" style="{{{textstyle|}}}"> {{{text}}} </td>
{{#if:{{{imageright|}}}
| {{#ifeq:{{{imageright|}}}|none
  | <!-- No image. -->
  | <td class="mbox-imageright"><div style="width: 52px;"> {{{imageright}}} </div></td>
   }}
   }}
  |imageright = {{#if:{{{smallimageright|}}}
}}
  |{{{smallimageright}}}
</tr>
  |{{{imageright|}}}
</table><!--
  }}
Detect and report usage with faulty "type" parameter:
  |style      = {{{style|}}}
-->{{#switch:{{{type|}}}
  |textstyle  = {{{textstyle|}}}
<!-- No type fed, is also valid input -->
  |text      = {{#if:{{{smalltext|}}}
| speedy
  |{{{smalltext}}}
| delete
  |{{{text}}}
| content
   }}
| style
}}
| move
|{{Ambox/core
| protection
  |type      = {{{type|}}}
| notice    = <!-- Do nothing, valid "type" -->
  |image      = {{{image|}}}
| #default   = <div style="text-align: center;">This message box is using an invalid "type={{{type|}}}" parameter and needs fixing.</div>[[Category:Message box parameter needs fixing|Main{{FULLPAGENAME}}]]<!-- Sort on namespace -->
  |imageright = {{{imageright|}}}
}}
  |style      = {{{style|}}}
  |textstyle  = {{{textstyle|}}}
  |text      = {{{text}}}
  |date      = {{#ifeq:{{FULLROOTPAGENAME}}|Template:{{PAGENAME:{{{name}}}}}
  |{{#ifeq:{{{date|¬}}}|¬||{{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}
  {{{date|}}}
   }}
}}
}}{{cat handler
|main={{#if:{{{cat|}}}
  |{{#if:{{{date|}}}
  |[[Category:{{{cat}}} {{{preposition|from}}} {{{date}}}]]{{#ifexist:Category:{{{cat}}} {{{preposition|from}}} {{{date}}}|
    |[[Category:Articles with invalid date parameter in template]]
  }}
  |[[Category:{{#if:{{{undated|}}}
    |{{{undated}}}
    |{{{cat}}}
  }}]]
  }}
}}{{#if:{{{all|}}}
  |[[Category:{{{all}}}]]
}}
|template={{#ifeq:{{BASEPAGENAME}}|{{SUBPAGENAME}}|[[Category:Article message boxes]]}}
}}{{#ifeq:{{FULLPAGENAME}}|Template:{{PAGENAME:{{{name}}}}}
|{{documentation}}<!-- Transclude documentation on template page -->
}}<noinclude>
 
{{Documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>

Revision as of 23:19, 28 February 2011