Zum Inhalt springen

Vorlage:Ambox/Doku: Unterschied zwischen den Versionen

reformat
imported>MSGJ
imported>MSGJ
(reformat)
Zeile 36: Zeile 36:
This parameter should be updated if the template is ever moved. The purpose of this parameter is twofold:
This parameter should be updated if the template is ever moved. The purpose of this parameter is twofold:
* If incorrectly substituted, it allows the meta-template to notify the name of the template which has been substituted, which may help editors to fix the problem.
* If incorrectly substituted, it allows the meta-template to notify the name of the template which has been substituted, which may help editors to fix the problem.
* It allows the template to act slightly differently on its template page, for example to show the date even when not specified, and to apply categorisation of the template itself.
* It allows the template to have a more useful display on its template page, for example to show the date even when not specified, and to apply categorisation of the template itself.


=== ''subst'' ===
=== ''subst'' ===
Zeile 89: Zeile 89:
| 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}}.
}}
}}
If no ''type'' parameter is given the template defaults to {{para|type|notice}}.


=== ''image'' ===
=== ''image'' ===
You can choose a specific image to use for the template by using the ''image'' parameter. Images are specified using the standard syntax for inserting files in Wikipedia (see [[Wikipedia:Manual of Style/Images#How to place an image]].) For example:
You can choose a specific image to use for the template by using the ''image'' parameter. Images are specified using the standard syntax for inserting files in Wikipedia (see [[Wikipedia:Manual of Style/Images#How to place an image]].) Widths of 40-50px are typical. For example:


* {{tl|POV}} specifies {{para|image|<nowiki>[[File:Unbalanced scales.svg|40px|link=|alt=]]</nowiki>}} and looks like this:
* {{tl|POV}} specifies {{para|image|<nowiki>[[File:Unbalanced scales.svg|40px|link=|alt=]]</nowiki>}} and looks like this:
Zeile 99: Zeile 101:
{{Wikify}}
{{Wikify}}


Other variations:
Please note:
* If no image is specified then the default image corresponding to the ''type'' is used. (See [[#type]] above.)
* If no image is specified then the default image corresponding to the ''type'' is used. (See [[#type]] above.)
* If {{para|image|none}} is specified, then no image is used and the text uses the whole message box area.
* If {{para|image|none}} is specified, then no image is used and the text uses the whole message box area.
* If an icon is [[Wikipedia:Alternative text for images#Purely decorative images|purely decorative]] and also in the [[Wikipedia:Image use policy#Public_domain|public domain]], [[Wikipedia:Accessibility|accessibility]] can be improved by suppressing the link to the file page by adding "{{para|link}}{{para|alt}}" as seen above.


=== ''sect'' ===
=== ''sect'' ===
Zeile 129: Zeile 132:


This parameter may then be used by an editor as follows:
This parameter may then be used by an editor as follows:
* {{para|talk|SECTION HEADING}} - the template will link to the specified section on the article's talk page.
* {{para|talk|SECTION HEADING}} - the link will point to the specified section on the article's talk page, e.g. {{para|talk|Foo}}
* {{para|talk|FULL PAGE NAME}} - the template will link to the page specified (which may include a [[WP:ANCHOR|section anchor]] as well).
* {{para|talk|FULL PAGE NAME}} - the template will link to the page specified (which may include a [[WP:ANCHOR|section anchor]]), e.g. {{para|talk|Talk:Banana#Foo}}


Notes:
Notes:
Zeile 157: Zeile 160:
The ''all'' parameter defines a category into which all articles should be placed.
The ''all'' parameter defines a category into which all articles should be placed.


{{clear}}
== Other parameters ==
 
{| class="wikitable" align="right" style="background:transparent; width=40%"
===Complex example===
!All parameters
 
|-
<pre>
|<pre style="font-size:90%; width=40%">
{{Ambox
| name      = Name of template
| subst      = <includeonly>{{subst:</includeonly><includeonly>substcheck}}</includeonly>
| 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.
| talk      = {{{talk|}}}
| smalltext  = Text for the top of article sections.
| date      = {{{date|}}}
| cat        = A name of a category to use for monthly categories
| all        = A category which all articles will be placed in
}}
</pre>
 
{{Ambox
{{Ambox
|nocat=true
| name        =  
| 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.
}}
 
But you are not really supposed to use red bold italic text.
 
 
=== Parameters ===
 
List of all parameters:
 
<pre>
{{Ambox
| name        = Name of template without the Template: part
| subst      = <includeonly>{{subst:</includeonly><includeonly>substcheck}}</includeonly>
| subst      = <includeonly>{{subst:</includeonly><includeonly>substcheck}}</includeonly>
| type        = speedy / delete / content / style / notice / move / protection
| small      = {{{small|}}}
| image      = none / [[File:...|40px|...]]
| type        =  
| imageright  = [[File:...|40px|...]]
| image      =  
| class      = A custom CSS class to apply to the box
| imageright  =  
| style      = CSS values
| smallimage  =
| textstyle  = CSS values
| smallimageright =
| text       = The message body text.
| class      =  
| style      =  
| textstyle  =  
| sect       = {{{1|}}}
| issue      =
| talk        = {{{talk|}}}
| talk        = {{{talk|}}}
| small      = {{{small|}}} / left
| fix        =  
| smallimage  = none / [[File:...|20px|...]]
| smallimageright = none / [[File:...|20px|...]]
| smalltext  = A shorter message body text.
| preposition = Preposition between category name and month (defaults to "from")
| date        = {{{date|}}}
| date        = {{{date|}}}
| category    = Prefix for monthly categories
| text        =
| all        = Category which all articles will be placed in, if any
| smalltext  =
| category2  = Second prefix for monthly categories
| cat        =  
| all2        = Second category which all articles will be placed in, if any
| all        =  
| category3  = Third prefix for monthly categories
| cat2        =  
| all3        = Third category which all articles will be placed in, if any
| all2        =  
}}
| cat3        =  
| all3        =  
<noinclude>
{{Documentation}}
</noinclude>
</pre>
</pre>
|}


'''name'''
=== ''imageright'' ===
:This is the name of the template (without the namespace) and allows the template to have a more useful display on its template page, and to give a specific warning when incorrectly substituted. For example, on [[Template:Orphan]] we define {{para|name|orphan}}.
An image on the right side of the message box may be specified using this parameter. The syntax is the same as for the ''image'' parameter, except that the default is no image.
 
'''subst'''
:This should be used in order to detect when the template has been incorrectly substituted. Such pages will be placed in [[:Category:Pages with incorrectly substituted templates]]
 
'''type'''
:If no '''type''' parameter is given the template defaults to type '''notice'''. That means it gets a blue side bar.
 
'''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.)
:: Often an icon is [[Wikipedia:Alternative text for images#Purely decorative images|purely decorative]] in the W3C sense that it repeats the text. To improve [[Wikipedia:Accessibility|accessibility]], it is desirable to not have it be announced by [[screen reader]]s, 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 "{{para|link}}{{para|alt}}". For example:
:::<code><nowiki>image = [[File:Unbalanced scales.svg|40px|link=|alt=]]</nowiki></code>
:: Conversely, an icon that does not use "{{para|link}}{{para|alt}}", and which therefore is announced to visually impaired readers, should use an "{{para|alt|<var>[[Wikipedia:Alternative text for images|alt text]]</var>}}" parameter that describes the icon. With no {{para|link}} parameter (using the default link), the alt text should describe the icon's visual appearance. For example:
:::<code><nowiki>image = [[File:Gnome globe current event.svg|40px|alt=Clock over a larger globe]]</nowiki></code>
:: With a nonempty "{{para|link|<var>Page</var>}}" the alt text should describe the icon's function. For example:
:::<code><nowiki>image = [[File:Purple question mark.svg|40px|link=Special:Random|alt=Random article]]</nowiki></code>
:: 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 ''[[Wikipedia:Alternative text for images#Purely decorative images|Purely decorative images]]'' for more information about licensing.
:'''none''' = Means that no image is used.
:<s>'''blank'''</s> = This parameter is now deprecated. If you see it in use, change it to "image=none".
 
'''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.) For example:
::<code><nowiki>imageright = [[File:Nuvola apps bookcase.png|40px|alt=Three stacked books]]</nowiki></code>
:'''Anything''' = Any other object that you want to show on the right side.
 
'''style'''
:Optional [[Cascading Style Sheets|CSS]] values used by the entire message box table. Without quotation marks <code>" "</code> but with the ending semicolons <code>;</code>. For example:
::<code>style = margin-bottom: 0.5em;</code>
 
'''textstyle'''
:Optional [[Cascading Style Sheets|CSS]] values used by the text cell. For example:
::<code>textstyle = text-align: center;</code>
 
'''text'''
:The text displayed in the message.
 
'''talk'''
:If this parameter is passed through it adds the message "More details and relevant discussion can be found on the talk page." The '''talk''' parameter can be used in either of the following ways:
:*{{para|talk|SECTION NAME}} - the link will point to the specified section on the current article's talk page, e.g. {{para|talk|Foo}}
:*{{para|talk|FULL PAGE NAME}} - the link will point to the page name specified (which may include a section anchor), e.g. {{para|talk|Talk:Banana#Foo}}


==== Categorisation parameters ====
=== ''smallimage'' and ''smallimageright'' ===
Images for the small format box may be specified using these parameters. They will have no effect unless {{para|small|left}} is specified.


* '''date'''= {{{date|}}} - pass through the date parameter when using monthly cleanup categories
=== ''class'' ===
* '''category''' / '''cat''' - prefix for monthly categories, e.g. ''Wikipedia articles needing style editing''
A custom CSS class to apply to the box.
* '''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 ====
=== ''style'' and ''textstyle'' ===
Optional [[Cascading Style Sheets|CSS]] values may be defined, without quotation marks <code>" "</code> but with the ending semicolons <code>;</code>.
* ''style'' specifies the style used by the entire message box table.
* ''textstyle'' relates to the text cell.


The small article message boxes are meant for the top of sections. Normally they should only contain one or two lines of text.
=== ''text'' and ''smalltext'' ===
Instead of specifying the ''issue'' and the ''fix'' it is possible to use the ''text'' parameter instead.


'''small'''
Customised text for the small format can be defined using ''smalltext''.
:'''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>
{{Ambox
|nocat=true
| small = left
| text = small = left
}}
{{Ambox
|nocat=true
| type = style
| small = left
| text = type = style <br> small = left
}}
:'''any other value, including blank and no parameter''' = Default-sized inlined message box. Ignores '''smallimage''', '''smallimageright''' and '''smalltext'''.
'''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:
::<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".
{{Ambox
|nocat=true
| small = left
| image      = [[File:Replacement filing cabinet.svg|50px|link=|alt=]]
| smallimage = [[File:Replacement filing cabinet.svg|25px|link=|alt=]]
| text =
small = left <br> image = <nowiki>[[File:Replacement filing cabinet.svg|50px|link=|alt=]]</nowiki> <br> smallimage = <nowiki>[[File:Replacement filing cabinet.svg|25px|link=|alt=]]</nowiki>
}}
 
'''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:
::<code><nowiki>smallimageright = [[File:Nuvola apps bookcase.png|20px|alt=Three stacked books]]</nowiki></code>
:'''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".
{{ambox
|nocat=true
| small = left
| imageright = [[File:Gnome globe current event.svg|50px|alt=Clock over a larger globe]]
| smallimageright = none
| text =
small = left <br> imageright = <nowiki>[[File:Gnome globe current event.svg|50px|alt=Clock over a larger globe]]</nowiki> <br> smallimageright = none
}}


'''smalltext'''
=== Additional dategorisation parameters ===
:A shorter version of the message body text. If no '''smalltext''' parameter is given then this template falls back to use the '''text''' parameter.
* ''cat2'' and ''cat3'' provide additional monthly categories; see [[#cat]].
* ''all2'' and ''all3'' provide additonal categories into which all articles are placed, just like [[#all]].


=== Technical details ===
== Technical details ==
This meta-template uses the ambox CSS classes in [[MediaWiki:Common.css]]. The classes can also be used directly in a [[Help:Table|wikitable]] if special functionality is needed. See the [[Wikipedia:Ambox CSS classes|how-to guide]] for that.
This meta-template uses the ambox CSS classes in [[MediaWiki:Common.css]]. The classes can also be used directly in a [[Help:Table|wikitable]] if special functionality is needed. See the [[Wikipedia:Ambox CSS classes|how-to guide]] for that.


Anonymer Benutzer