Zum Inhalt springen

Vorlage:Ambox/Doku: Unterschied zwischen den Versionen

Keine Änderung der Größe ,  vor 12 Jahren
K
Undid revision 493564923 by AllenZh (talk)
imported>AllenZh
K ("Ambox" to "ambox".)
imported>Debresser
K (Undid revision 493564923 by AllenZh (talk))
Zeile 14: Zeile 14:


<pre>
<pre>
{{ambox | text = Some text.}}
{{Ambox | text = Some text.}}
</pre>
</pre>


{{ambox | text = Some text.}}
{{Ambox | text = Some text.}}


Complex example:
Complex example:


<pre>
<pre>
{{ambox
{{Ambox
| subst      = <includeonly>{{subst:</includeonly><includeonly>substcheck}}</includeonly>
| subst      = <includeonly>{{subst:</includeonly><includeonly>substcheck}}</includeonly>
| type      = style
| type      = style
Zeile 37: Zeile 37:
</pre>
</pre>


{{ambox
{{Ambox
| type      = style
| type      = style
| small      = left
| small      = left
Zeile 53: Zeile 53:
The following examples use different '''type''' parameters but use no image parameters thus they use the default images for each type.
The following examples use different '''type''' parameters but use no image parameters thus they use the default images for each type.


{{ambox
{{Ambox
| type  = speedy
| type  = speedy
| text  = type=<u>speedy</u> – Speedy deletion issues, such as {{tl|db-g1}} and {{tl|db-g3}}.
| text  = type=<u>speedy</u> – Speedy deletion issues, such as {{tl|db-g1}} and {{tl|db-g3}}.
}}
}}
{{ambox
{{Ambox
| type  = delete
| type  = delete
| text  = type=<u>delete</u> – Deletion issues, such as {{tl|afd}} and {{tl|prod}}.
| text  = type=<u>delete</u> – Deletion issues, such as {{tl|afd}} and {{tl|prod}}.
}}
}}
{{ambox
{{Ambox
| type  = content
| type  = content
| text  = type=<u>content</u> – Content issues, such as {{tl|POV}} and {{tl|globalize}}.
| text  = type=<u>content</u> – Content issues, such as {{tl|POV}} and {{tl|globalize}}.
}}
}}
{{ambox
{{Ambox
| type  = style
| type  = style
| text  = type=<u>style</u> – Style issues, such as {{tl|cleanup}} and {{tl|wikify}}.
| text  = type=<u>style</u> – Style issues, such as {{tl|cleanup}} and {{tl|wikify}}.
Zeile 73: Zeile 73:
| text  = type=<u>notice</u> – Article notices, such as {{tl|current}} and {{tl|inuse}}.
| text  = type=<u>notice</u> – Article notices, such as {{tl|current}} and {{tl|inuse}}.
}}
}}
{{ambox
{{Ambox
| type  = move
| type  = move
| text  = type=<u>move</u> – Merge, split and transwiki proposals, such as {{tl|split}} and {{tl|copy to wiktionary}}.
| text  = type=<u>move</u> – Merge, split and transwiki proposals, such as {{tl|split}} and {{tl|copy to wiktionary}}.
}}
}}
{{ambox
{{Ambox
| type  = protection
| type  = protection
| text  = type=<u>protection</u> – Protection notices, such as {{tl|pp-vandalism}} and {{tl|pp-semi-protected}}.
| text  = type=<u>protection</u> – Protection notices, such as {{tl|pp-vandalism}} and {{tl|pp-semi-protected}}.
Zeile 86: Zeile 86:
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.
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.


{{ambox
{{Ambox
| type  = content
| type  = content
| image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
| image = [[File:Unbalanced scales.svg|40px|link=|alt=]]
| text  = type = content <br> image = <nowiki>[[File:Unbalanced scales.svg|40px|link=|alt=]]</nowiki> <br> This image is often used for {{tl|POV}} and similar issues.
| text  = type = content <br> image = <nowiki>[[File:Unbalanced scales.svg|40px|link=|alt=]]</nowiki> <br> This image is often used for {{tl|POV}} and similar issues.
}}
}}
{{ambox
{{Ambox
| type  = style
| type  = style
| image = [[File:Wikitext.svg|50px|link=|alt=]]
| image = [[File:Wikitext.svg|50px|link=|alt=]]
| text  = type = style <br> image = <nowiki>[[File:Wikitext.svg|50px|link=|alt=]]</nowiki> <br> This image is often used for {{tl|wikify}} etc.
| text  = type = style <br> image = <nowiki>[[File:Wikitext.svg|50px|link=|alt=]]</nowiki> <br> This image is often used for {{tl|wikify}} etc.
}}
}}
{{ambox
{{Ambox
| type  = move
| type  = move
| image = [[File:Merge-arrows.svg|50px|link=|alt=]]
| image = [[File:Merge-arrows.svg|50px|link=|alt=]]
Zeile 106: Zeile 106:
Some other parameter combinations.
Some other parameter combinations.


{{ambox
{{Ambox
| text  = No type and no image given ('''default''')
| text  = No type and no image given ('''default''')
}}
}}
{{ambox
{{Ambox
| image = none
| image = none
| text  = No type and '''image=none''' – No image is used and the '''text''' uses the whole message box area.
| text  = No type and '''image=none''' – No image is used and the '''text''' uses the whole message box area.
}}
}}


{{ambox
{{Ambox
| image = [[File:Gnome globe current event.svg|42px|alt=Clock over a larger globe]]
| 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]]
| imageright = [[File:Nuvola apps bookcase.svg|40px|alt=Three stacked books]]
Zeile 120: Zeile 120:
}}
}}


{{ambox
{{Ambox
| image = [[File:Gnome globe current event.svg|42px|alt=Clock over a larger globe]]
| image = [[File:Gnome globe current event.svg|42px|alt=Clock over a larger globe]]
| imageright = [[File:Shuttle.svg|20px|link=|alt=]]
| imageright = [[File:Shuttle.svg|20px|link=|alt=]]
Zeile 132: Zeile 132:


<pre>
<pre>
{{ambox
{{Ambox
| name        = Name of template without the Template: part
| name        = Name of template without the Template: part
| subst      = <includeonly>{{subst:</includeonly><includeonly>substcheck}}</includeonly>
| subst      = <includeonly>{{subst:</includeonly><includeonly>substcheck}}</includeonly>
Zeile 206: Zeile 206:
:'''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:
:'''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:
::<code><nowiki>small = {{{small|}}}</nowiki></code>
::<code><nowiki>small = {{{small|}}}</nowiki></code>
{{ambox
{{Ambox
| small = left
| small = left
| text = small = left
| text = small = left
}}
}}
{{ambox
{{Ambox
| type = style
| type = style
| small = left
| small = left
Zeile 221: Zeile 221:
::<code><nowiki>smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]</nowiki></code>
::<code><nowiki>smallimage = [[File:Gnome globe current event.svg|20px|alt=Clock over a larger globe]]</nowiki></code>
:'''none''' = Means that no image is used. This overrides any image fed to '''image''', when "small=left".
:'''none''' = Means that no image is used. This overrides any image fed to '''image''', when "small=left".
{{ambox
{{Ambox
| small = left
| small = left
| image      = [[File:Replacement filing cabinet.svg|50px|link=|alt=]]
| image      = [[File:Replacement filing cabinet.svg|50px|link=|alt=]]
Zeile 251: Zeile 251:


<pre>
<pre>
{{ambox
{{Ambox
| text  = <div>
| text  = <div>
Equal sign = and a start and end brace { } work fine as they are.
Equal sign = and a start and end brace { } work fine as they are.
Zeile 260: Zeile 260:
</pre>
</pre>


{{ambox
{{Ambox
| text  = <div>
| text  = <div>
Equal sign = and a start and end brace { } work fine as they are.
Equal sign = and a start and end brace { } work fine as they are.
Zeile 272: Zeile 272:
This template uses CSS classes in [[MediaWiki:Common.css]] for most of its looks, thus it is fully skinnable.
This template uses CSS classes in [[MediaWiki:Common.css]] for most of its looks, thus it is fully skinnable.


This template calls {{Tl|ambox/core}} which holds most of the code for {{tl|ambox}}, while {{Tl|ambox}} itself does parameter preprocessing.
This template calls {{Tl|Ambox/core}} which holds most of the code for {{tl|ambox}}, while {{Tl|Ambox}} itself does parameter preprocessing.


Internally this meta-template uses HTML markup 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 [[m:Help:ParserFunctions|parser functions]] and some special characters in parameters.
Internally this meta-template uses HTML markup 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 [[m:Help:ParserFunctions|parser functions]] and some special characters in parameters.
Zeile 278: Zeile 278:
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.
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 [[Template talk:ambox|talk page]] and the "See also" links below. Since this template works almost exactly like {{Tl|Tmbox}}, {{Tl|Imbox}}, {{Tl|Cmbox}} and {{Tl|Ombox}} their talk pages and related pages might also contain more details.
For more technical details see the [[Template talk:Ambox|talk page]] and the "See also" links below. Since this template works almost exactly like {{Tl|Tmbox}}, {{Tl|Imbox}}, {{Tl|Cmbox}} and {{Tl|Ombox}} their talk pages and related pages might also contain more details.


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