Template:Mbox
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = | image = | imageright = | class = | style = | textstyle = | text = {{{text}}} | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }} Template:Documentation </text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
|
Template:Template sandbox notice
}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2
</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template
}}
Template:Documentation</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
|
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box
</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box
</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}Template:Documentation</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||
}} |{{
#ifeq: show | show | <mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{ Template:Namespace detect
| type = notice | image = File:Edit-copy green.svg | imageright = | class = | style = | textstyle = | text = This is a documentation subpage for Template:Mbox (see that page for the {{#if:
|{{{text1}}} |{{#ifeq:Template | User |template template |{{#if:Template |template |article}} }} }} itself).
It contains usage information, categories, interlanguage links and other content that is not part of the original {{#if: |{{{text2}}} |{{#if: |{{{text1}}} |{{#ifeq:Template | User |template template page |{{#if:Template |template page |article}} }} }}
}}. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
|
Template:Template sandbox notice
}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template
}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:File:Edit-copy green.svg|none | | }} {{#if: |}}
{{#if:File:Edit-copy green.svg | File:Edit-copy green.svg | [[File:{{#switch:notice | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | This is a documentation subpage for Template:Mbox
(see that page for the {{#if: |{{{text1}}} |{{#ifeq:Template | User |template template |{{#if:Template |template |article}} }} }} itself).}}. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = File:Edit-copy green.svg | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if:File:Edit-copy green.svg | |}}
File:Edit-copy green.svg | This is a documentation subpage for Template:Mbox
(see that page for the {{#if: |{{{text1}}} |{{#ifeq:Template | User |template template |{{#if:Template |template |article}} }} }} itself).}}. |
---|
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:File:Edit-copy green.svg|none | | }} {{#if: | {{#ifeq:|none | |}}
}}
{{#if:File:Edit-copy green.svg | File:Edit-copy green.svg | [[Image:{{#switch:notice | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | This is a documentation subpage for Template:Mbox
(see that page for the {{#if: |{{{text1}}} |{{#ifeq:Template | User |template template |{{#if:Template |template |article}} }} }} itself).}}. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
}}{{ #if: | | {{#ifeq:Template|Template|}} }}}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}
{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | {{{text}}} | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}} Template:Documentation </text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = | image = | imageright = | class = | style = | textstyle = | text = Some text. bla. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | Some text. bla. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
Some text. bla. |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | Some text. bla. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = style | image = File:Emblem-question-yellow.svg | imageright = | class = | style = | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | small = left | smallimage = File:Emblem-question-yellow.svg | smallimageright = | smalltext = Text for the top of article sections. | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:File:Emblem-question-yellow.svg|none | | }}{{#if:
|}}
{{#if:File:Emblem-question-yellow.svg | File:Emblem-question-yellow.svg | [[File:{{#switch:style | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | Text for a big box, for the top of articles. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = File:Emblem-question-yellow.svg | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if:File:Emblem-question-yellow.svg | |}}
File:Emblem-question-yellow.svg | Text for a big box, for the top of articles. |
---|
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:File:Emblem-question-yellow.svg|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if:File:Emblem-question-yellow.svg | File:Emblem-question-yellow.svg | [[Image:{{#switch:style | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:left|yes | 30x30px | 40x40px }}|link=|alt=]]}} | Text for a big box, for the top of articles. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = critical | image = | imageright = | class = | style = | textstyle = | text = type=critical – Urgent warnings, such as Template:Tlx. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch:critical | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type=critical – Urgent warnings, such as Template:Tlx. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
type=critical – Urgent warnings, such as Template:Tlx. |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch:critical | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type=critical – Urgent warnings, such as Template:Tlx. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = important | image = | imageright = | class = | style = | textstyle = | text = type=important – Serious problems, such as Template:Tl. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch:important | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type=important – Serious problems, such as Template:Tl. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
type=important – Serious problems, such as Template:Tl. |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch:important | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type=important – Serious problems, such as Template:Tl. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = warning | image = | imageright = | class = | style = | textstyle = | text = type=warning – Other problems, such as Template:Tl. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch:warning | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type=warning – Other problems, such as Template:Tl. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
type=warning – Other problems, such as Template:Tl. |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch:warning | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type=warning – Other problems, such as Template:Tl. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = caution | image = | imageright = | class = | style = | textstyle = | text = type=caution – Points of concern, but not so serious, such as Template:Tl and Template:Tl. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch:caution | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type=caution – Points of concern, but not so serious, such as Template:Tl and Template:Tl. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
type=caution – Points of concern, but not so serious, such as Template:Tl and Template:Tl. |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch:caution | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type=caution – Points of concern, but not so serious, such as Template:Tl and Template:Tl. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = notice | image = | imageright = | class = | style = | textstyle = | text = type=notice – Points of information, such as Template:Tl. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch:notice | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type=notice – Points of information, such as Template:Tl. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
type=notice – Points of information, such as Template:Tl. |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch:notice | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type=notice – Points of information, such as Template:Tl. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = | image = | imageright = | class = | style = | textstyle = | text = type=(blank) – Default; general 'box'. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type=(blank) – Default; general 'box'. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
type=(blank) – Default; general 'box'. |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type=(blank) – Default; general 'box'. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = move | image = | imageright = | class = | style = | textstyle = | text = type=move – Merge, split and transwiki proposals, such as Template:Tl and Template:Tl. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch:move | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type=move – Merge, split and transwiki proposals, such as Template:Tl and Template:Tl. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
type=move – Merge, split and transwiki proposals, such as Template:Tl and Template:Tl. |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch:move | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type=move – Merge, split and transwiki proposals, such as Template:Tl and Template:Tl. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = protection | image = | imageright = | class = | style = | textstyle = | text = type=protection – Protection notices.. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch:protection | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type=protection – Protection notices.. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
type=protection – Protection notices.. |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch:protection | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type=protection – Protection notices.. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = license | image = | imageright = | class = | style = | textstyle = | text = type=license – License notices, such as Template:Tl | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch:license | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type=license – License notices, such as Template:Tl | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
type=license – License notices, such as Template:Tl |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch:license | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type=license – License notices, such as Template:Tl | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = warning
| image = File:Unbalanced scales.svg
| imageright =
| class =
| style =
| textstyle =
| text = type = content
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
This image is often used for Template:Tl and similar issues.
| small =
| smallimage =
| smallimageright =
| smalltext =
| subst =
| date =
| name =
}}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:File:Unbalanced scales.svg|none | | }}{{#if:
|}}
{{#if:File:Unbalanced scales.svg | File:Unbalanced scales.svg | [[File:{{#switch:warning | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type = content image = [[File:Unbalanced scales.svg|40px|link=|alt=]] This image is often used for Template:Tl and similar issues. |
{{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = File:Unbalanced scales.svg | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if:File:Unbalanced scales.svg | |}}
File:Unbalanced scales.svg | type = content image = [[File:Unbalanced scales.svg|40px|link=|alt=]] This image is often used for Template:Tl and similar issues. |
---|
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:File:Unbalanced scales.svg|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if:File:Unbalanced scales.svg | File:Unbalanced scales.svg | [[Image:{{#switch:warning | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type = content image = [[File:Unbalanced scales.svg|40px|link=|alt=]] This image is often used for Template:Tl and similar issues. |
{{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = notice
| image = File:Wikitext.svg
| imageright =
| class =
| style =
| textstyle =
| text = type = style
image = [[File:Wikitext.svg|50px|link=|alt=]]
This image is often used for Template:Tl etc.
| small =
| smallimage =
| smallimageright =
| smalltext =
| subst =
| date =
| name =
}}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:File:Wikitext.svg|none | | }}{{#if:
|}}
{{#if:File:Wikitext.svg | File:Wikitext.svg | [[File:{{#switch:notice | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type = style image = [[File:Wikitext.svg|50px|link=|alt=]] This image is often used for Template:Tl etc. |
{{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = File:Wikitext.svg | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if:File:Wikitext.svg | |}}
File:Wikitext.svg | type = style image = [[File:Wikitext.svg|50px|link=|alt=]] This image is often used for Template:Tl etc. |
---|
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:File:Wikitext.svg|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if:File:Wikitext.svg | File:Wikitext.svg | [[Image:{{#switch:notice | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type = style image = [[File:Wikitext.svg|50px|link=|alt=]] This image is often used for Template:Tl etc. |
{{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = move
| image = File:Merge-arrows.svg
| imageright =
| class =
| style =
| textstyle =
| text = type = move
image = [[File:Merge-arrows.svg|50px|link=|alt=]]
This image is used for Template:Tl etc.
| small =
| smallimage =
| smallimageright =
| smalltext =
| subst =
| date =
| name =
}}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:File:Merge-arrows.svg|none | | }}{{#if:
|}}
{{#if:File:Merge-arrows.svg | File:Merge-arrows.svg | [[File:{{#switch:move | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type = move image = [[File:Merge-arrows.svg|50px|link=|alt=]] This image is used for Template:Tl etc. |
{{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = File:Merge-arrows.svg | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if:File:Merge-arrows.svg | |}}
File:Merge-arrows.svg | type = move image = [[File:Merge-arrows.svg|50px|link=|alt=]] This image is used for Template:Tl etc. |
---|
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:File:Merge-arrows.svg|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if:File:Merge-arrows.svg | File:Merge-arrows.svg | [[Image:{{#switch:move | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type = move image = [[File:Merge-arrows.svg|50px|link=|alt=]] This image is used for Template:Tl etc. |
{{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
More examples
Some other parameter combinations.
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = | image = | imageright = | class = | style = | textstyle = | text = No type and no image given (default) | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | No type and no image given (default) | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
No type and no image given (default) |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | No type and no image given (default) | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = | image = none | imageright = | class = | style = | textstyle = | text = No type and image=none – No image is used and the text uses the whole message box area. | small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:none|none | | }}{{#if:
|}}
{{#if:none | none | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | No type and image=none – No image is used and the text uses the whole message box area. | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = none | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if:none | |}}
none | No type and image=none – No image is used and the text uses the whole message box area. |
---|
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:none|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if:none | none | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | No type and image=none – No image is used and the text uses the whole message box area. | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type =
| image = File:Gnome globe current event.svg
| imageright = File:Nuvola apps bookcase.svg
| class =
| style =
| textstyle =
| text = image = [[File:Gnome globe current event.svg|42px|alt=Clock over a larger globe]]
imageright = [[File:Nuvola apps bookcase.svg|40px|alt=Three stacked books]]
| small =
| smallimage =
| smallimageright =
| smalltext =
| subst =
| date =
| name =
}}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:File:Gnome globe current event.svg|none | | }}{{#if:File:Nuvola apps bookcase.svg
|}}
{{#if:File:Gnome globe current event.svg | File:Gnome globe current event.svg | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | image = [[File:Gnome globe current event.svg|42px|alt=Clock over a larger globe]] imageright = [[File:Nuvola apps bookcase.svg|40px|alt=Three stacked books]] |
File:Nuvola apps bookcase.svg |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = File:Gnome globe current event.svg | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if:File:Gnome globe current event.svg | |}}
File:Gnome globe current event.svg | image = [[File:Gnome globe current event.svg|42px|alt=Clock over a larger globe]] imageright = [[File:Nuvola apps bookcase.svg|40px|alt=Three stacked books]] |
---|
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:File:Gnome globe current event.svg|none | | }}{{#if:File:Nuvola apps bookcase.svg | {{#ifeq:File:Nuvola apps bookcase.svg|none
||
}}
}}
{{#if:File:Gnome globe current event.svg | File:Gnome globe current event.svg | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | image = [[File:Gnome globe current event.svg|42px|alt=Clock over a larger globe]] imageright = [[File:Nuvola apps bookcase.svg|40px|alt=Three stacked books]] |
File:Nuvola apps bookcase.svg |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type =
| image = File:Gnome globe current event.svg
| imageright = File:Shuttle.svg
| class =
| style =
| textstyle =
| text = This article or section documents a current spaceflight.
Content may change as the mission progresses.
| small =
| smallimage =
| smallimageright =
| smalltext =
| subst =
| date =
| name =
}}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:File:Gnome globe current event.svg|none | | }} {{#if:File:Shuttle.svg |}}
{{#if:File:Gnome globe current event.svg | File:Gnome globe current event.svg | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | This article or section documents a current spaceflight.
Content may change as the mission progresses. | File:Shuttle.svg |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = File:Gnome globe current event.svg | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if:File:Gnome globe current event.svg | |}}
File:Gnome globe current event.svg | This article or section documents a current spaceflight.
Content may change as the mission progresses. |
---|
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:File:Gnome globe current event.svg|none | | }} {{#if:File:Shuttle.svg | {{#ifeq:File:Shuttle.svg|none | |}}
}}
{{#if:File:Gnome globe current event.svg | File:Gnome globe current event.svg | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | This article or section documents a current spaceflight.
Content may change as the mission progresses. | File:Shuttle.svg |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = | image = | imageright = | class = | style = | textstyle = | text = small = left | small = left | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | small = left | {{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
small = left |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:left|yes | 30x30px | 40x40px }}|link=|alt=]]}} | small = left | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = style
| image =
| imageright =
| class =
| style =
| textstyle =
| text = type = style
small = left
| small = left
| smallimage =
| smallimageright =
| smalltext =
| subst =
| date =
| name =
}}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch:style | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | type = style small = left |
{{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
type = style small = left |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch:style | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:left|yes | 30x30px | 40x40px }}|link=|alt=]]}} | type = style small = left |
{{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type =
| image = File:Replacement filing cabinet.svg
| imageright =
| class =
| style =
| textstyle =
| text = small = left
image = [[File:Replacement filing cabinet.svg|50px|link=|alt=]]
smallimage = [[File:Replacement filing cabinet.svg|25px|link=|alt=]]
| small = left
| smallimage = File:Replacement filing cabinet.svg
| smallimageright =
| smalltext =
| subst =
| date =
| name =
}}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:File:Replacement filing cabinet.svg|none | | }}{{#if:
|}}
{{#if:File:Replacement filing cabinet.svg | File:Replacement filing cabinet.svg | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | small = left image = [[File:Replacement filing cabinet.svg|50px|link=|alt=]] smallimage = [[File:Replacement filing cabinet.svg|25px|link=|alt=]] |
{{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = File:Replacement filing cabinet.svg | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if:File:Replacement filing cabinet.svg | |}}
File:Replacement filing cabinet.svg | small = left image = [[File:Replacement filing cabinet.svg|50px|link=|alt=]] smallimage = [[File:Replacement filing cabinet.svg|25px|link=|alt=]] |
---|
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:File:Replacement filing cabinet.svg|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if:File:Replacement filing cabinet.svg | File:Replacement filing cabinet.svg | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:left|yes | 30x30px | 40x40px }}|link=|alt=]]}} | small = left image = [[File:Replacement filing cabinet.svg|50px|link=|alt=]] smallimage = [[File:Replacement filing cabinet.svg|25px|link=|alt=]] |
{{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type =
| image =
| imageright = File:Gnome globe current event.svg
| class =
| style =
| textstyle =
| text = small = left
imageright = [[File:Gnome globe current event.svg|50px|alt=Clock over a larger globe]]
smallimageright = none
| small = left
| smallimage =
| smallimageright = none
| smalltext =
| subst =
| date =
| name =
}}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:File:Gnome globe current event.svg
|}}
{{#if: | {{{image}}} | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | small = left imageright = [[File:Gnome globe current event.svg|50px|alt=Clock over a larger globe]] smallimageright = none |
File:Gnome globe current event.svg |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
small = left imageright = [[File:Gnome globe current event.svg|50px|alt=Clock over a larger globe]] smallimageright = none |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if:File:Gnome globe current event.svg | {{#ifeq:File:Gnome globe current event.svg|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:left|yes | 30x30px | 40x40px }}|link=|alt=]]}} | small = left imageright = [[File:Gnome globe current event.svg|50px|alt=Clock over a larger globe]] smallimageright = none |
File:Gnome globe current event.svg |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
<mediawiki xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.8/ http://www.mediawiki.org/xml/export-0.8.xsd" version="0.8" xml:lang="en"><siteinfo><sitename>MediaWiki</sitename><base>http://www.mediawiki.org/wiki/MediaWiki</base><generator>MediaWiki 1.22wmf12</generator><case>first-letter</case><namespaces><namespace key="-2" case="first-letter">Media</namespace><namespace key="-1" case="first-letter">Special</namespace><namespace key="0" case="first-letter"/><namespace key="1" case="first-letter">Talk</namespace><namespace key="2" case="first-letter">User</namespace><namespace key="3" case="first-letter">User talk</namespace><namespace key="4" case="first-letter">Project</namespace><namespace key="5" case="first-letter">Project talk</namespace><namespace key="6" case="first-letter">File</namespace><namespace key="7" case="first-letter">File talk</namespace><namespace key="8" case="first-letter">MediaWiki</namespace><namespace key="9" case="first-letter">MediaWiki talk</namespace><namespace key="10" case="first-letter">Template</namespace><namespace key="11" case="first-letter">Template talk</namespace><namespace key="12" case="first-letter">Help</namespace><namespace key="13" case="first-letter">Help talk</namespace><namespace key="14" case="first-letter">Category</namespace><namespace key="15" case="first-letter">Category talk</namespace><namespace key="90" case="first-letter">Thread</namespace><namespace key="91" case="first-letter">Thread talk</namespace><namespace key="92" case="first-letter">Summary</namespace><namespace key="93" case="first-letter">Summary talk</namespace><namespace key="100" case="first-letter">Manual</namespace><namespace key="101" case="first-letter">Manual talk</namespace><namespace key="102" case="first-letter">Extension</namespace><namespace key="103" case="first-letter">Extension talk</namespace><namespace key="104" case="first-letter">API</namespace><namespace key="105" case="first-letter">API talk</namespace><namespace key="106" case="first-letter">Skin</namespace><namespace key="107" case="first-letter">Skin talk</namespace><namespace key="828" case="first-letter">Module</namespace><namespace key="829" case="first-letter">Module talk</namespace><namespace key="1198" case="first-letter">Translations</namespace><namespace key="1199" case="first-letter">Translations talk</namespace><namespace key="2500" case="first-letter">VisualEditor</namespace><namespace key="2501" case="first-letter">VisualEditor talk</namespace></namespaces></siteinfo><page><title>Template:Mbox</title><ns>10</ns><id>45372</id><revision><id>634882</id><parentid>634876</parentid><timestamp>2013-01-25T22:40:38Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting self, problem was in ombox template</comment><text xml:space="preserve" bytes="707">{{
Template:Namespace detect
| type = | image = | imageright = | class = | style = | textstyle =
| text =Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces }}. And now a pipe and end braces |}}.
| small = | smallimage = | smallimageright = | smalltext = | subst = | date = | name = }}</text><sha1>40w6e1mdq2t695t9dv143e1rzq5pv1o</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation</title><ns>10</ns><id>20803</id><revision><id>688512</id><parentid>687083</parentid><timestamp>2013-05-11T17:18:34Z</timestamp><contributor><username>Wargo</username><id>25061</id></contributor><text xml:space="preserve" bytes="2079">{{#ifeq: Mbox | sandbox
| Template:Template sandbox notice}}Template:Documentation/start box2 {{#switch: {{#if:|1|0}}{{#if:|1|0}}{{#ifexist:|1|0}}{{#ifexist:Template:Documentation/docspace:Template:Documentation/template page/doc|1|0}} | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 = | 0110 | 0111 = {{ {{{1}}} }} | 0001 | 0011 = {{ Template:Documentation/docspace:Template:Documentation/template page/doc }} | 0000 | 0100 | 0010 | 0101 = }} Template:Documentation/end box2</text><sha1>bvikrz5412m4gizkphh8ftj604e3kbf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/docspace</title><ns>10</ns><id>93323</id><revision><id>631615</id><parentid>557279</parentid><timestamp>2013-01-20T15:55:26Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/docspace: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="302">{{#switch: Template
| | File | MediaWiki | Category = Template talk | #default = Template}}</text><sha1>7f8iymss9sr4v7f4t5pza1arwjogrv3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box</title><ns>10</ns><id>93324</id><revision><id>631856</id><parentid>631623</parentid><timestamp>2013-01-20T16:24:41Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><text xml:space="preserve" bytes="4124">
{{#if:
{{#ifeq: | off | | yes{{ #switch: Template | User | Template = yes }} }}
| Template:Fmbox }}{{#if:
{{#switch: Mbox | doc | testcases = strange }}
| [[Category:Wikipedia pages with strange ((documentation)) usage|Template:Main otherTemplate:Mbox]]
}}</text><sha1>r3qht4u0hwps2mqnst3puyi8anb9dmz</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/end box2</title><ns>10</ns><id>124329</id><revision><id>688362</id><parentid>688359</parentid><timestamp>2013-05-11T09:36:55Z</timestamp><contributor><username>Shirayuki</username><id>472859</id></contributor><comment>Undo revision 688359 by Shirayuki (talk)</comment><text xml:space="preserve" bytes="864">Template:Documentation/end box</text><sha1>sfe0ppdpxp1nwfzhpym4jwdtmgpph1p</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box</title><ns>10</ns><id>93326</id><revision><id>742132</id><parentid>742131</parentid><timestamp>2013-07-20T14:04:29Z</timestamp><contributor><ip>81.129.86.23</ip></contributor><text xml:space="preserve" bytes="2002">
|
|| ¬ = {{#switch: Template | Template = File:Template-info.png Template documentation | Template:Ns:Module = File:Template-info.png Module documentation | File = Summary | #default = Documentation }} | #default = }}{{ #if: | | {{ #if: yes | [view] [edit] [history] [[[:Template:Purge]]] | [#if: _ | %7B%7B%7Bpreload%7D%7D%7D_ | {{#ifeq: Template | File_ | Template:Documentation/preload-filespace_ | Template:Documentation/preload_ }} }} create] }}}}
}}</text><sha1>linb792zr3zrp72qrhjkmqg1mz6uevr</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/start box2</title><ns>10</ns><id>93327</id><revision><id>631642</id><parentid>585737</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>4 revisions from w:en:Template:Documentation/start box2: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="625">Template:Documentation/start box</text><sha1>t5j6y918odlsx0iuls0qgi6wbl050q3</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation/template page</title><ns>10</ns><id>93328</id><revision><id>631644</id><parentid>557289</parentid><timestamp>2013-01-20T15:55:27Z</timestamp><contributor><username>Krenair</username><id>483619</id></contributor><minor/><comment>1 revision from w:en:Template:Documentation/template page: Requested by average_drifter in #mediawiki</comment><text xml:space="preserve" bytes="232">{{#switch: Mbox | sandbox | testcases = Mbox | #default = Mbox }}</text><sha1>fenc3r6oe2sito28b1d8xgyo9gpq5uf</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Documentation subpage</title><ns>10</ns><id>20806</id><revision><id>757428</id><parentid>715052</parentid><timestamp>2013-08-05T14:14:46Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 90.219.4.40 (talk) to last revision by Shirayuki</comment><text xml:space="preserve" bytes="2616">{{#if: |
{{#if:x||}} |{{#ifeq: mbox | doc
|
{{
#ifeq: show | show
| Template loop detected: Template:Mbox
}}{{
#if:
|
| {{#ifeq:Template|Template|}}
}}
| }}
}}</text><sha1>7a3si8r4k2z0aqxpbbxz1c0gmny5pb9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Fmbox</title><ns>10</ns><id>37655</id><revision><id>558796</id><parentid>558707</parentid><timestamp>2012-07-05T06:11:26Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><comment>update from enwiki</comment><text xml:space="preserve" bytes="1344"> {{#ifeq:|none | | }}{{#if:
|}}
{{#if: | {{{image}}} | [[File:{{#switch: | warning = Cmbox deletion.png | editnotice = Imbox notice.png | system | #default = Imbox notice.png }}|40x40px|link=|alt=]]}} | Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces }}. And now a pipe and end braces |}}. |
{{{imageright}}} |
| | warning | editnotice | system =
| #default =}}</text><sha1>mrldgfpkjyqf89ukmq2vy7gh3ir2j7i</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox/doc</title><ns>10</ns><id>45374</id><revision><id>659649</id><parentid>651771</parentid><timestamp>2013-03-14T09:07:42Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="14176">Template:Documentation subpage This is the Template:Tl or message box meta-template.
It is used to build message box templates such as Template:Tl. It offers several different colours, uses default images if no image parameter is given and it has some other features.
This meta-template uses the mbox CSS classes in MediaWiki:Common.css. The classes can also be used directly in a wikitable if special functionality is needed. See the how-to guide for that.
Usage
Simple usage example:
{{mbox | text = Some text.}}
Template loop detected: Template:Mbox Complex example:
{{mbox | type = style | small = left | image = [[File:Emblem-question-yellow.svg|40px|alt=Question mark]] | smallimage = [[File:Emblem-question-yellow.svg|20px|alt=Question mark]] | textstyle = color: red; font-weight: bold; font-style: italic; | text = Text for a big box, for the top of articles. | smalltext = Text for the top of article sections. }}
Template loop detected: Template:Mbox
But you are not really supposed to use red bold italic text.
Message box types
The following examples use different type parameters but use no image parameters thus they use the default images for each type.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Other images
The default images shown above are mostly for convenience. In many cases it is more appropriate to use more specific images. These examples use the image parameter to specify an image other than the default images.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox Template loop detected: Template:Mbox
More examples
Some other parameter combinations.
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Template loop detected: Template:Mbox
Parameters
List of all parameters:
{{mbox | type = critical / serious / warning / notice / / move / protection | image = none / [[File:...|40px|...]] | imagewidth = width of image section / default is 52px | imageright = [[File:...|40px|...]] | imagerightwidth = width of right image section / default is 52px | style = CSS values | textstyle = CSS values | text = The message body text. | small = {{{small|}}} / left | smallimage = none / [[File:...|20px|...]] | smallimageright = none / [[File:...|20px|...]] | smalltext = A shorter message body text. }}
type
- If no type parameter is given the template has a 'blank' style.
image
- No parameter = If no image parameter is given the template uses a default image. Which default image it uses depends on the type parameter.
- An image = Should be an image with usual wiki notation. Widths of 40px - 50px are usually about right. (Images over 52 pixels wide will cause padding problems, unless you also set imagewidth.)
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
- Conversely, an icon that does not use "Template:ParaTemplate:Para", and which therefore is announced to visually impaired readers, should use an "Template:Para" parameter that describes the icon. With no Template:Para parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]
- With a nonempty "Template:Para" the alt text should describe the icon's function. For example:
image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]
- An icon whose license requires attribution may have alt text, but must keep the default link. Although public domain images do not require a link, many licenses do require one. Please see Purely decorative images for more information about licensing.
- Often an icon is purely decorative in the W3C sense that it repeats the text. To improve accessibility, it is desirable to not have it be announced by screen readers, as well as to avoid it linking to an irrelevant page. If (and only if) the image license allows this, it can be marked with "Template:ParaTemplate:Para". For example:
- none = Means that no image is used.
blank= This parameter is now deprecated. If you see it in use, change it to "image=none".
imagewidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagewidth=100px
imageright
- No parameter = If no imageright parameter is given then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 40px - 50px width are usually about right depending on the image height to width ratio. (Images over 52 pixels width will cause padding problems, unless you also set imagerightwidth.) For example:
imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
imagerightwidth
- Optional CSS value used to set width of image's div section. Allowing you to use images wider than the default 52px wide.
- Example
imagerightwidth=100px
style
- Optional CSS values used by the entire message box table. Without quotation marks
" "
but with the ending semicolons;
. For example:style = margin-bottom: 0.5em;
textstyle
- Optional CSS values used by the text cell. For example:
textstyle = text-align: center;
text
- The message body text.
The small parameters
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
small
- left = Makes it a smaller left aligned message box. This also makes the default images smaller. Note that any data fed to the smallimage, smallimageright and smalltext parameters is only used if "small=left". To make it so your template also understands the small parameter you can use this code:
small = {{{small|}}}
Template loop detected: Template:Mbox Template loop detected: Template:Mbox
smallimage
- No parameter = If no smallimage parameter is given then this template falls back to use the image parameter. If the image parameter also is empty then a small default image is used.
- An image = Should be an image with usual wiki notation. 20px width is usually about right for boxes with one line of text, while 25px width is usually about right for boxes with two lines of text. For example:
smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]
- none = Means that no image is used. This overrides any image fed to image, when "small=left".
Template loop detected: Template:Mbox
smallimageright
- No parameter = If no smallimageright parameter is given then this template falls back to use the imageright parameter. If the imageright parameter also is empty then no image is shown on the right side.
- An image = Should be an image with usual wiki notation. 20px - 25px width is usually about right. For example:
smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]
- Anything = Any other object that you want to show on the right side.
- none = Means that no right side image is used. This overrides any image fed to imageright, when "small=left".
Template loop detected: Template:Mbox
smalltext
- A shorter version of the message body text. If no smalltext parameter is given then this template falls back to use the text parameter.
Technical details
If you need to use special characters in the text parameter then you need to escape them like this:
{{mbox | text = <div> Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces <nowiki>}}</nowiki>. And now a pipe and end braces <nowiki>|}}</nowiki>. </div> }}
Template loop detected: Template:Mbox
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces }}. And now a pipe and end braces |}}. |
| Template:Ombox/core | Template:Ombox/core
}}</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | Equal sign = and a start and end brace { } work fine as they are. But here is a pipe | and two end braces }}. And now a pipe and end braces |}}. |
{{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197"> </text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">{{[[Template:|]]{{#if:|
|{{{2}}}
}}{{#if:|
|{{{3}}}
}}{{#if:|
|{{{4}}}
}}{{#if:|
|{{{5}}}
}}{{#if:|
|...
}}}}</text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>
The <div>
tags that surround the text in the example above are usually not needed. But if the text contains line breaks then sometimes we get weird line spacing. This especially happens when using vertical dotted lists. Then use the div tags to fix that.
This template uses CSS classes in MediaWiki:Common.css for most of its looks, thus it is fully skinnable.
This template calls Template:Tl which holds most of the code for Template:Tl, while Template:Tl itself does parameter preprocessing.
Internally this meta-template uses HTML wikimarkup instead of wikimarkup for the table code. That is the usual way we make meta-templates since wikimarkup has several drawbacks. For instance it makes it harder to use parser functions and some special characters in parameters.
The default images for this meta-template are in png format instead of svg format. The main reason is that some older web browsers have trouble with the transparent background that MediaWiki renders for svg images. The png images here have hand optimised transparent background colour so they look good in all browsers. Note that svg icons only look somewhat bad in the old browsers, thus such hand optimisation is only worth the trouble for very widely used icons.
For more technical details see the talk page and the "See also" links below.
See also
Template:Mbox templates Other pages:
- w:Template:Mbox
- w:Wikipedia:Ambox CSS classes – Describes how to use the ambox CSS classes directly in wikitables and HTML tables.
- w:Wikipedia:Article message boxes – The style guideline for creating article message boxes.
- w:Wikipedia talk:Article message boxes – For discussion about these matters.
</text><sha1>5cafb545bbublgg4mei08dvwxs9zay9</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Mbox templates</title><ns>10</ns><id>95150</id><revision><id>692773</id><parentid>565939</parentid><timestamp>2013-05-21T16:37:34Z</timestamp><contributor><ip>90.209.78.127</ip></contributor><text xml:space="preserve" bytes="268">Template:Nmbox</text><sha1>mm2hquqpmw1k85xftye00jkid2a0l4u</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Namespace detect</title><ns>10</ns><id>79689</id><revision><id>695915</id><parentid>497627</parentid><timestamp>2013-05-27T09:23:36Z</timestamp><contributor><ip>81.129.84.113</ip></contributor><text xml:space="preserve" bytes="1470">{{#switch:
{{#if: | {{{demospace}}} | {{#if: | {{#ifeq:| | talk | }} | {{#ifeq:template|template talk | talk | template }} }} }}
| main | = | talk = | user = | project = | file | image = | mediawiki = | template = | help = | category = | book = | extension = | other | #default =
}}
</text><sha1>qry2n28n1p12gxaxgu7gs1bkzywbpqv</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Nmbox</title><ns>10</ns><id>47495</id><revision><id>556782</id><parentid>328128</parentid><timestamp>2012-06-29T10:35:15Z</timestamp><contributor><username>Krinkle</username><id>135822</id></contributor><text xml:space="preserve" bytes="587"> {{#if: | |}}
Template:Documentation </text><sha1>6k7jc6wiy6i7qy82dd4dw1xja6e8k5w</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox</title><ns>10</ns><id>93344</id><revision><id>634878</id><parentid>634793</parentid><timestamp>2013-01-25T22:39:30Z</timestamp><contributor><username>Kaldari</username><id>31661</id></contributor><comment>reverting breakage</comment><text xml:space="preserve" bytes="723">{{#ifeq:|yes | Template:Ombox/core | Template:Ombox/core
}}Template:Documentation</text><sha1>p9vh00dqvq0u1q3950ueg6abd93dyrt</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Ombox/core</title><ns>10</ns><id>93345</id><revision><id>680423</id><parentid>680422</parentid><timestamp>2013-04-29T09:31:02Z</timestamp><contributor><username>Siebrand</username><id>5665</id></contributor><minor/><comment>Protected "Template:Ombox/core": Highly visible template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment><text xml:space="preserve" bytes="2250"> {{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if: | {{{image}}} | [[Image:{{#switch: | critical = Ambox warning pn.svg | important = Ambox warning pn.svg | warning = Ambox important.svg | caution = Edit-clear.svg | license = Imbox_license.svg | speedy = Imbox speedy deletion.png | delete = Imbox deletion.png | content = Imbox content.png | style = Edit-clear.svg | move = Imbox move.png | protection = Imbox protection.png | notice | #default = Imbox notice.png }} | {{#ifeq:|yes | 30x30px | 40x40px }}|link=|alt=]]}} | {{{text}}} | {{{imageright}}} |
| | critical | important | warning | caution | license | speedy | delete | content | style | move | protection | notice =
| #default =}}
Template:Documentation
</text><sha1>l3n9mp2c6ch14gekpe1oxxe8thp3xdb</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Para</title><ns>10</ns><id>40658</id><revision><id>557339</id><parentid>557338</parentid><timestamp>2012-06-30T23:27:18Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Para</comment><text xml:space="preserve" bytes="238">|{{#if:|{{{1}}}=|}}
Template:Documentation
</text><sha1>3ve3qhqjaafu9wuy6em7y1fz49qyqfx</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Purge</title><ns>10</ns><id>31341</id><revision><id>405355</id><parentid>405354</parentid><timestamp>2011-05-24T01:39:17Z</timestamp><contributor><username>Peachey88</username><id>31302</id></contributor><minor/><comment>1 revision from w:en:Template:Purge: update to en.wiki</comment><text xml:space="preserve" bytes="197">
Template:Documentation
</text><sha1>830osaj62tvmlh6zq374ixtzbukxcih</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tl</title><ns>10</ns><id>12644</id><redirect title="Template:Tlx"/><revision><id>760820</id><parentid>760712</parentid><timestamp>2013-08-10T10:29:27Z</timestamp><contributor><username>IAlex</username><id>17961</id></contributor><minor/><comment>Reverted edits by 175.200.179.56 (talk) to last revision by Varnent</comment><text xml:space="preserve" bytes="25">#REDIRECTTemplate:Tlx</text><sha1>avv0qklcaxr8n5r45lcc2x17y9w78sc</sha1><model>wikitext</model><format>text/x-wiki</format></revision></page><page><title>Template:Tlx</title><ns>10</ns><id>20809</id><revision><id>557363</id><parentid>534113</parentid><timestamp>2012-06-30T23:27:22Z</timestamp><contributor><username>Reedy</username><id>28424</id></contributor><minor/><comment>1 revision from w:en:Template:Tlx</comment><text xml:space="preserve" bytes="385">
Doc
See m:Template:Tlx. </text><sha1>0d6b5bkc7j2tegvw2yzm4b6iil98xqg</sha1>