Difference between revisions of "Template:Ambox/core"

From Self-sufficiency
Jump to: navigation, search
(Adding back the proper styles for the empty <td> (the {{td}} is not equivalent). Adding back the 52px DIV for the right image. And some changes in comments and code indentation.)
m (1 revision: Digital circuits (Import from Wikipedia))
 
(17 intermediate revisions by 9 users not shown)
Line 10: Line 10:
 
| notice    <!-- notice = default -->
 
| notice    <!-- notice = default -->
 
| #default  = ambox-notice
 
| #default  = ambox-notice
}}" style="{{#switch:{{{small|}}}
+
}} {{{class|}}}" style="{{{style|}}}">
| left = margin: 4px 1em 4px 0; width: 238px; border-collapse: collapse; font-size: 88%; line-height: 1.25em;
+
}} {{{style|}}}">
+
 
<tr>
 
<tr>
{{#ifeq:{{{image|}}}|none
+
{{#switch:{{{image|}}}
| <!-- 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>
+
| blank    <!-- Fall back to "none", since deprecated. -->
| <td class="mbox-image">{{#switch:{{{small|}}}
+
| 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">{{
 +
  #switch:{{{small|}}}
 
   | left = <!-- Don't use the DIV -->  
 
   | left = <!-- Don't use the DIV -->  
 
   | #default = <div style="width: 52px;">  
 
   | #default = <div style="width: 52px;">  
Line 22: Line 23:
 
   {{#if:{{{image|}}}
 
   {{#if:{{{image|}}}
 
   | {{{image}}}
 
   | {{{image}}}
   | [[Image:{{#switch:{{{type|}}}
+
   | [[File:{{#switch:{{{type|}}}
 
     | speedy    = Ambox speedy deletion.png
 
     | speedy    = Ambox speedy deletion.png
 
     | delete    = Ambox deletion.png
 
     | delete    = Ambox deletion.png
 
     | content    = Ambox content.png
 
     | content    = Ambox content.png
     | style      = Ambox style.png
+
     | style      = Edit-clear.svg
 
     | move      = Ambox move.png
 
     | move      = Ambox move.png
 
     | protection = Ambox protection.png
 
     | protection = Ambox protection.png
Line 34: Line 35:
 
       | left = 20x20px  
 
       | left = 20x20px  
 
       | #default = 40x40px  
 
       | #default = 40x40px  
       }} ]]
+
       }} |link=|alt=]]
 
   }}{{#switch:{{{small|}}}
 
   }}{{#switch:{{{small|}}}
 
   | left = <!-- Don't use the /DIV -->
 
   | left = <!-- Don't use the /DIV -->
   | </div>  
+
   | #default = </div>  
 
   }}</td>
 
   }}</td>
 
}}
 
}}
<td class="mbox-text" style="{{{textstyle|}}}"> {{{text}}} </td>
+
<td class="mbox-text" style="{{{textstyle|}}}"> {{{text}}} {{#if:{{{date|}}}
 +
|<small>''({{{date}}})''</small>
 +
}}</td>
 
{{#if:{{{imageright|}}}
 
{{#if:{{{imageright|}}}
 
| {{#ifeq:{{{imageright|}}}|none
 
| {{#ifeq:{{{imageright|}}}|none
 
   | <!-- No image. -->
 
   | <!-- No image. -->
 
   | <td class="mbox-imageright">{{#switch:{{{small|}}}
 
   | <td class="mbox-imageright">{{#switch:{{{small|}}}
     | left = <!-- Don't use the DIV -->
+
     | left = {{{imageright}}}
     | #default = <div style="width: 52px;">  
+
     | #default = <div style="width: 52px;"> {{{imageright}}} </div>
    }} {{{imageright}}} {{#switch:{{{small|}}}
+
      | left = <!-- Don't use the /DIV -->
+
      | </div>  
+
 
     }}</td>
 
     }}</td>
 
   }}
 
   }}
 
}}
 
}}
 
</tr>
 
</tr>
</table><!-- Detect and report usage with faulty "type" parameter:
+
</table><!--  
 +
Detect and report usage with faulty "type" parameter:
 
-->{{#switch:{{{type|}}}
 
-->{{#switch:{{{type|}}}
 
|  <!-- No type fed, is also valid input -->
 
|  <!-- No type fed, is also valid input -->
Line 65: Line 66:
 
| notice    = <!-- Do nothing, valid "type" -->
 
| 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 -->
 
| #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 -->
 +
}}<!--
 +
Detect and report usage of deprecated "image=blank":
 +
-->{{#switch:{{{image|}}}
 +
| blank = [[Category:Wikipedia message box parameter needs fixing|{{main other|Main:}}{{FULLPAGENAME}}]]<!-- Sort on namespace -->
 
}}<noinclude>
 
}}<noinclude>
 
+
{{documentation}}
{{pp-template|small=yes}}
+
{{Documentation}}
+
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
</noinclude>
 
</noinclude>

Latest revision as of 18:11, 9 December 2011