Zum Inhalt springen

Vorlage:Ambox/Doku: Unterschied zwischen den Versionen

Update for usa of second and third category parameters.
imported>Debresser
K (Reverted edits by Flipjaksin (talk) to last version by Debresser)
imported>Debresser
(Update for usa of second and third category parameters.)
Zeile 1: Zeile 1:
{{Documentation subpage}}
{{Documentation subpage}}
{{high-risk| 900,000+ | Wikipedia talk:Article message boxes }}
{{High-risk| 900,000+ | Wikipedia talk:Article message boxes }}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
{{mbox templates}}
{{Mbox templates}}
This is the {{tl|ambox}} or '''article message box''' meta-template.
This is the {{tl|ambox}} or '''article message box''' meta-template.


Zeile 10: Zeile 10:


=== Usage ===
=== Usage ===
Simple usage example:
Simple usage example:


<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 30: Zeile 31:
| text      = Text for a big box, for the top of articles.
| text      = Text for a big box, for the top of articles.
| smalltext  = Text for the top of article sections.
| smalltext  = Text for the top of article sections.
| date      = {{{date|}}}
| category  = A name of a category to use for monthly categories
| category  = A name of a category to use for monthly categories
| date      = {{{date|}}}
| all        = A category which all articles will be placed in
| all        = A category which all articles will be placed in
}}
}}
</pre>
</pre>


{{ambox
{{Ambox
| type      = style
| type      = style
| small      = left
| small      = left
Zeile 49: Zeile 50:


=== Article message box types ===
=== Article message box types ===
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 71: 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 81: Zeile 83:


=== Other images ===
=== 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.
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 100: Zeile 103:


=== More examples ===
=== More examples ===
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 116: 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 124: Zeile 128:


=== Parameters ===
=== Parameters ===
List of all parameters:
List of all parameters:


<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 141: Zeile 146:
| smallimageright = none / [[File:...|20px|...]]
| smallimageright = none / [[File:...|20px|...]]
| smalltext  = A shorter message body text.
| smalltext  = A shorter message body text.
| category    = Prefix for monthly categories
| preposition = Preposition between category name and month (defaults to "from")
| preposition = Preposition between category name and month (defaults to "from")
| date        = {{{date|}}}
| date        = {{{date|}}}
| category    = Prefix for monthly categories
| all        = Category which all articles will be placed in, if any
| all        = Category which all articles will be placed in, if any
| category2  = Second prefix for monthly categories
| all2        = Second category which all articles will be placed in, if any
| category3  = Third prefix for monthly categories
| all3        = Third category which all articles will be placed in, if any
}}
}}
</pre>
</pre>
Zeile 184: Zeile 193:


==== Categorisation parameters ====
==== Categorisation parameters ====
*'''category''' / '''cat''' - prefix for monthly categories, e.g. ''Wikipedia articles needing style editing''
 
*'''preposition''' - preposition between category name and month; the default is ''from''
* '''date'''= {{{date|}}} - pass through the date parameter when using monthly cleanup categories
*'''date'''= {{{date|}}} - pass through the date parameter when using monthly cleanup categories
* '''category''' / '''cat''' - prefix for monthly categories, e.g. ''Wikipedia articles needing style editing''
*'''all''' - category which all articles will be placed in, e.g. ''All articles needing style editing''
* '''preposition''' - preposition between category name and month; the default is ''from''
* '''all''' - category which all articles will be placed in, e.g. ''All articles needing style editing''


==== The small parameters ====
==== 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.
The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.


Zeile 195: 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 210: 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 236: Zeile 247:


=== Technical details ===
=== Technical details ===
If you need to use special characters in the text parameter then you need to escape them like this:
If you need to use special characters in the text parameter then you need to escape them like this:


<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 248: 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 260: 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 266: 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