Vorlage:Ambox/Doku: Unterschied zwischen den Versionen

Documenting.
imported>Davidgothberg
(Some more documentation.)
imported>Davidgothberg
(Documenting.)
Zeile 5: Zeile 5:
|-
|-
| style="width: 52px; padding-left: 0.5em; text-align: center;" | [[Image:Emblem-important.svg|40px]]
| style="width: 52px; padding-left: 0.5em; text-align: center;" | [[Image:Emblem-important.svg|40px]]
| style="padding: 0.25em 0.5em;" | To see the examples on this page you need to copy the CSS code to [[Special:Mypage/monobook.css|your personal monobook.css]]. See explanation below.
| style="padding: 0.25em 0.5em;" | '''Note!''' To correctly see the examples below you need to add some CSS code to [[Special:Mypage/monobook.css|your personal monobook.css]] since these classes do not yet exist in [[MediaWiki:Common.css]]. For the CSS code you need and more, see [[Wikipedia:Template standardisation/issuebox demo]].
|}
|}


Zeile 11: Zeile 11:
This is the '''ambox''' or '''article message box meta template'''.
This is the '''ambox''' or '''article message box meta template'''.


It is used to create ''article message box'' templates such as {{tl|wikify}} etc.
It is used to create ''article message box'' templates such as {{tl|wikify}} etc. It uses default images if no image parameter is given and it has some other features.


This template uses CSS classes for most of its looks. It uses default images if no image parameter is given and it has some other features.
=== Usage examples ===


Simple usage example:


'''Note!''' To correctly see the examples below you need to add some CSS code to [[Special:Mypage/monobook.css|your personal monobook.css]] since these classes do not yet exist in [[MediaWiki:Common.css]]. For usage demonstration, parameter explanations, the CSS code you need and more, see [[Wikipedia:Template standardisation/issuebox demo]].
<pre>
{{ambox | text = Some text.}}
</pre>
 
{{ambox | text = Some text.}}
 
 
Complex example:
 
<pre>
{{ambox
| type  = style
| image = [[Image:Wikitext.svg|50px]]
| text  = The message body text.
}}
</pre>
 
{{ambox
| type  = style
| image = [[Image:Wikitext.svg|50px]]
| text  = The message body text.
}}
 
==== Default images ====
 
The following examples use different '''type''' parameters but use no image parameters thus they use the default images for each type.
 
{{ambox
| type  = serious
| text  = Serious issue – Some text some text some text some text some text some text some text some text some text some text.
}}
{{ambox
| type  = content
| text  = Content issue – Some text some text some text some text some text some text some text some text some text some text.
}}
{{ambox
| type  = style
| text  = Style issue – Some text some text some text some text some text some text some text some text some text some text.
}}
{{ambox
| type  = merge
| text  = Merge issue – Some text some text some text some text some text some text some text some text some text some text.
}}
{{ambox
| type  = notice
| text  = Article notice – Some text some text some text some text some text some text some text some text some text some text.
}}
 
==== Other images ====
 
These examples use the '''image''' parameter to specify an image other than the default images.
 
{{ambox
| type  = content
| image = [[Image:Unbalanced scales.svg|40px]]
| text  = Content issue – Some text some text some text some text some text some text some text some text some text some text.
}}
{{ambox
| type  = style
| image = [[Image:Wikitext.svg|50px]]
| text  = Style issue – Some text some text some text some text some text some text some text some text some text some text.
}}
{{ambox
| type  = notice
| image = [[Image:Current event marker.svg|50px]]
| text  = Article notice – Some text some text some text some text some text some text some text some text some text some text.
- Some text some text some text some text some text some text some text some text some text some text.
}}
 
==== Special ====
 
Some other parameter combinations.
 
{{ambox
| text  = No type and no image given ('''default''') – Some text some text some text some text some text some text some text some text.
}}
{{ambox
| image = blank
| text  = No type and '''image=blank''' – Some text some text some text some text some text some text some text some text some text.
}}
{{ambox
| image = none
| text  = No type and '''image=none''' – Some text some text some text some text some text some text some text some text some text.
}}
 
{{ambox
| image = [[Image:Current event marker.svg|50px]]
| imageright = [[Image:Nuvola apps bookcase.png|40px]]
| text  = '''Image''' and '''imageright''' set to other images.
}}
 
{{ambox
| image = [[Image:Current event_marker.svg|50px]]
| imageright = [[Image:Shuttle.svg|20px]]
| text  = This article or section documents a current [[spaceflight]].
<br><small>Content may change as the mission progresses.</small>
}}
 
=== Parameters ===
 
List of all parameters:
 
<pre>
{{ambox
| type  = serious / content / style / merge / notice
| image = none / blank / [[Image:Some image.svg|40px]]
| imageright = [[Image:Some image.svg|40px]]
| text  = The message body text.
}}
</pre>
 
'''type'''
:If no '''type''' parameter is given the template defaults to type '''notice''' which is used for "article notices". That means it gets a blue side bar like in the simple usage example above.
 
'''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. 40px - 50px width are usually about right depending on the image height to width ratio. For example:
::<code><nowiki>[[Image:Unbalanced scales.svg|40px]]</nowiki></code>
:'''none''' = Means that no image is used.
:'''blank''' = Means that no image is used but an empty area the same size as a default image is used, which means that text in the message box gets aligned well with other article message boxes. (See the "special" examples above.)
 
'''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. For example:
::<code><nowiki>[[Image:Nuvola apps bookcase.png|40px]]</nowiki></code>
 
=== Technical details ===
 
This template uses CSS classes for most of its looks, thus it is fully "skinnable".
 
This meta template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta templates since wiki markup messes with the possibility to use [[m:Help:ParserFunctions|parser functions]] and special characters in parameters.
 
If you need to use special characters in the text parameter then you need to escape them like this:
 
<pre>
{{ambox
| text  = <div>
Equal sign = and a start { and end brace } works fine as they are.
But here is a pipe {{!}} and two end braces &lt;nowiki>}}&lt;/nowiki>.
And now a pipe and end braces &lt;nowiki>|}}&lt;/nowiki>.
</div>
}}
</pre>
 
{{ambox
| text  = <div>
Equal sign = and a start { and end brace } works 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>
}}
 
 
The CSS classes can of course be used directly in a wikitable too. Like this:
 
<pre>
{| class="ambox ambox-content"
|-
| class="ambox-image" | [[Image:Emblem-important.svg|40px]]
| Some text.
|}
</pre>
 
{| class="ambox ambox-content"
|-
| class="ambox-image" | [[Image:Emblem-important.svg|40px]]
| Some text.
|}


=== See also ===
=== See also ===
Anonymer Benutzer