Wikipedia:Article message boxes/issuebox demo

Article message box demo

edit

This is a demonstration and test page for the code for the article message boxes. The boxes use one single meta template which in turn uses some CSS classes for pretty much all their looks. The meta template uses default images if no image parameter is given and it has some other nifty features.

Most of the examples on this page have now been moved to the documentation of the meta template {{ambox}}.

CSS code

edit

The CSS code for the article message boxes has now been added to MediaWiki:Common.css, which means it is now full deployed and can be used all over the English Wikipedia.

Note! Those of you who took part in the testing of this code:

importStylesheet('Wikipedia:Template standardisation/CSS');
  • If you added CSS code to your monobook.css you should now remove it. The code to remove is the code you see below.

For reference, here is the code that has been added to MediaWiki:Common.css. (Note, this code might not be up to date with what really runs at MediaWiki:Common.css.)

/* Article message box template style */
table.ambox {
  width: 80%; 
  margin: 0 auto;
  border-collapse: collapse; 
  background: #f8fcff; 
  border: 1px solid #aaa; 
  border-left: 10px solid #39f;       /* Default "notice" blue */
}

table.ambox th, table.ambox td {      /* The message body cell(s) */
  padding: 0.25em 0.5em;              /* 0.5em left/right */
}

table.ambox td.mbox-image {          /* The left image cell */
  width: 52px; 
  padding: 2px 0px 2px 0.5em;         /* 0.5em left, 0px right */
  text-align: center; 
}

table.ambox td.mbox-imageright {     /* The right image cell */
  width: 52px; 
  padding: 2px 0.5em 2px 0px;         /* 0px left, 0.5em right */
  text-align: center; 
}
 
table.ambox-notice {
  border-left: 10px solid #39f;       /* Blue */
/* border-right: 10px solid #39f; */  /* If you want two blue bars */
}

table.ambox-serious {
  border-left: 10px solid #c00;       /* Red */
}

table.ambox-content {
  border-left: 10px solid #f63;       /* Orange */
}

table.ambox-style {
  border-left: 10px solid #fc3;       /* Yellow */
}

table.ambox-merge {
  border-left: 10px solid #95b;       /* Purple */
}

The meta template

edit

The meta template that uses the CSS code above is at Template:Ambox. See examples and documentation there.

Technical details

edit

The CSS classes can also be used directly in a wikitable. Like this:

{| class="ambox ambox-content"
|-
| class="mbox-image" | [[Image:Emblem-important.svg|40px]]
| Some text.
|}
  Some text.

Test area

edit

Test area where we can play around.

Testing shortcut box interference

edit

Testing shortcut box insertion as imageright parameter

edit

Other testing

edit
{{ambox
| text  = <div>
Text with equal sign = and a start { and end brace }. 
And here is a pipe {{!}} and two end braces <nowiki>}}</nowiki>. 
And now a pipe + end braces <nowiki>|}}</nowiki>.
</div>
}}


Testing the CSS padding:


Testing transwiki colours and default images:

  This page is a candidate to be copied to Wiktionary using the Transwiki process.
  This page is a candidate to be copied to Wiktionary using the Transwiki process.
  This page is a candidate to be copied to Wiktionary using the Transwiki process.
  This page is a candidate to be copied to Wiktionary using the Transwiki process.
  This page is a candidate to be copied to Wiktionary using the Transwiki process.
  This page is a candidate to be copied to Wiktionary using the Transwiki process.
  This page is a candidate to be copied to Wiktionary using the Transwiki process.
  This page is a candidate to be copied to Wiktionary using the Transwiki process.

Testing padding

edit
Some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text.
Some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text.
Some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text.
Some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text.

See also

edit