Difference between revisions of "Template:Fmbox/test1"

From blackwiki
Jump to navigation Jump to search
imported>Davidgothberg
(Copied the code from the main template. (Thus adding the "id" parameter.))
imported>Davidgothberg
(The 31 days CSS caching for the global "mbox-image" and "mbox-text" classes has passed, so removing the hard-coded styles.)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<table id="{{{id|}}}" class="plainlinks fmbox
 
<table id="{{{id|}}}" class="plainlinks fmbox
 
{{#switch:{{{type|}}}
 
{{#switch:{{{type|}}}
 +
| warning    = fmbox-warning
 
| editnotice = fmbox-editnotice
 
| editnotice = fmbox-editnotice
 
| system          <!-- system = default -->
 
| system          <!-- system = default -->
Line 6: Line 7:
 
}} {{{class|}}}" style="clear: both; margin: 0.2em 0; border: 1px solid #aaa; background: #f9f9f9; width: 100%;  
 
}} {{{class|}}}" style="clear: both; margin: 0.2em 0; border: 1px solid #aaa; background: #f9f9f9; width: 100%;  
 
{{#switch:{{{type|}}}
 
{{#switch:{{{type|}}}
 +
| warning    = background: #FFDBDB; border: 1px solid #BB7070;
 
| editnotice = background: transparent;
 
| editnotice = background: transparent;
 
| system          <!-- system = default -->
 
| system          <!-- system = default -->
Line 13: Line 15:
 
{{#ifeq:{{{image|}}}|none
 
{{#ifeq:{{{image|}}}|none
 
| <!-- No image. -->
 
| <!-- No image. -->
| <td class="mbox-image" style="border: none; padding: 2px 0 2px 0.9em; text-align: center;">
+
| <td class="mbox-image">
 
   {{#if:{{{image|}}}
 
   {{#if:{{{image|}}}
 
   | {{{image}}}
 
   | {{{image}}}
   | [[Image:Imbox notice.png|40x40px]]
+
   | {{#switch:{{{type|}}}
 +
    | warning    = [[Image:Cmbox deletion.png|40x40px]]
 +
    | editnotice = [[Image:Imbox notice.png|40x40px]]
 +
    | system          <!-- system = default -->
 +
    | #default  = [[Image:Imbox notice.png|40x40px]]
 +
    }}
 
   }}</td>
 
   }}</td>
 
}}
 
}}
<td class="mbox-text" style="border: none; padding: 0.25em 0.9em; width: 100%; {{{textstyle|}}}"> {{{text}}} </td>
+
<td class="mbox-text" style="{{{textstyle|}}}"> {{{text}}} </td>
 
{{#if:{{{imageright|}}}
 
{{#if:{{{imageright|}}}
| <td class="mbox-imageright" style="border: none; padding: 2px 0.9em 2px 0; text-align: center;"> {{{imageright}}} </td>
+
| <td class="mbox-imageright"> {{{imageright}}} </td>
 
}}
 
}}
 
</tr>
 
</tr>
</table><noinclude>
+
</table><!-- Detect and report usage with faulty "type" parameter:
 +
-->{{#switch:{{{type|}}}
 +
|  <!-- No type fed, is also valid input -->
 +
| warning
 +
| editnotice
 +
| system    =    <!-- Do nothing, valid "type" -->
 +
| #default  = [[Category:Wikipedia message box parameter needs fixing|{{main other|Main:}}{{FULLPAGENAME}}]]<!-- Sort on namespace -->
 +
}}<noinclude>
  
  
Line 33: Line 47:
 
The box above is template code on this page, the boxes below are transclusions of this page and show how that code renders when the box is used in different ways. If you anyway have updated the code above then you have to {{purge|purge this page}} to see the effect on the examples below.
 
The box above is template code on this page, the boxes below are transclusions of this page and show how that code renders when the box is used in different ways. If you anyway have updated the code above then you have to {{purge|purge this page}} to see the effect on the examples below.
  
 +
{{fmbox/test1
 +
| type = warning
 +
| text = type=warning
 +
}}
 
{{fmbox/test1
 
{{fmbox/test1
 
| type = editnotice
 
| type = editnotice
| text = editnotice
+
| text = type=editnotice
 
}}
 
}}
 
{{fmbox/test1
 
{{fmbox/test1
 
| type = system
 
| type = system
| text = system
+
| text = type=system
 
}}
 
}}
  
Line 79: Line 97:
 
<pre>
 
<pre>
 
{{fmbox/test1
 
{{fmbox/test1
| type  = system / editnotice
+
| type  = system / editnotice / warning
 
| image = none / [[Image:Some image.svg|40px]]
 
| image = none / [[Image:Some image.svg|40px]]
 
| imageright = [[Image:Some image.svg|40px]]
 
| imageright = [[Image:Some image.svg|40px]]
Line 88: Line 106:
 
}}
 
}}
 
</pre>
 
</pre>
 +
 +
=== Testing error reporting ===
 +
 +
<!--
 +
{{fmbox/test1
 +
| type = fun
 +
| text = type=fun
 +
}}
 +
-->

Latest revision as of 03:38, 2 November 2008


David's sandbox for {{fmbox}}

Here David Göthberg is testing and showing new code versions. Please do not edit this page. If you want to experiment do so in {{fmbox/sandbox}} or create your own subpage under {{fmbox}} or in your own user space.

The box above is template code on this page, the boxes below are transclusions of this page and show how that code renders when the box is used in different ways. If you anyway have updated the code above then you have to Script error: No such module "Purge". to see the effect on the examples below.

Some text just to test bottom margin.

Special

Some other parameter combinations.

Parameters

List of all parameters:

{{fmbox/test1
| type  = system / editnotice / warning
| image = none / [[Image:Some image.svg|40px]]
| imageright = [[Image:Some image.svg|40px]]
| class = CSS class names
| style = CSS values
| textstyle = CSS values
| text  = The message body text.
}}

Testing error reporting