Template:Ambox/doc: Difference between revisions

From BoyWiki
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation subpage}}
<noinclude> {{Documentation subpage}}</noinclude>




<includeonly>{{Languages|Template:Ambox}}</includeonly>
==Basic usage==
{{Mbox templates}}
The box below shows the most common parameters that are accepted by {{Tl|Ambox}}. The purpose of each is described below.
{{Documentation subpage}}
<pre style="overflow:auto;">
{{High-use|8000}}
{{Ambox
{{Lua|Module:Message box{{\sandbox}}}}
| name  =
| subst = <includeonly>{{subst:substcheck}}</includeonly>
| small = {{{small|}}}
| style=border-color:(purple; magenta; red; pink; orange; yellow; chartreuse; green; Cyan; violet; blue(default); brown; gray; black;)
| type  =
| image =
| sect  = {{{1|}}}
| issue =
| talk  = {{{talk|}}}
| fix  =
| date  = {{{date|}}}
| cat  =
| all  =
}}
</pre>


This is the {{Tl|Ambox}} or '''Article message box''' meta-template.
==Examples==
<pre>
{{ambox
| style=border-color:Cyan;
| text= this is text.<br>
| image = [[File:OOjs UI icon notice-warning.svg.png|50px]]
| info = '''this is info'''
}}
</pre>


== Parameters ==
{{ambox
=== <code>type</code> ===
| style=border-color:Cyan;
The <code>type</code> parameter defines the colour of the left bar, and the image that is used by default. The type is chosen not on aesthetics but is based on the type of issue that the template describes. The seven available types and their default images are shown below.
| text= this is text.<br>
{{Ambox{{\sandbox}}
| image = [[File:OOjs UI icon notice-warning.svg.png|50px]]
| nocat = true
| info = '''this is info'''
| type  = speedy
| text  = type=<u>speedy</u> — Speedy deletion issues, such as {{tl|speedy}}.
}}
}}
{{Ambox{{\sandbox}}
 
| nocat = true
'''Default ambox'''
| type  = delete
<pre>
| text  = type=<u>delete</u> — Deletion issues, such as {{tl|delete}}.
{{ambox
| info = '''this is info'''
}}
}}
{{Ambox{{\sandbox}}
</pre>
| nocat = true
{{ambox
| type  = content
| info = '''this is info'''
| text  = type=<u>content</u> — Content issues, such as {{tl|Update}} and {{tl|Expand}}.
}}
{{Ambox{{\sandbox}}
| nocat = true
| type  = style
| text  = type=<u>style</u> — Style issues, such as {{tl|cleanup}} and {{tl|Documentation needed}}.
}}
{{Ambox{{\sandbox}}
| nocat = true
| type  = notice
| text  = type=<u>notice</u> — Notices, such as {{tl|Extension exception}} and {{tl|Translating}}.
}}
{{Ambox{{\sandbox}}
| nocat = true
| type  = move
| text  = type=<u>move</u> — Merge, split and transwiki proposals, such as {{tl|Merge}} and {{tl|Move to Commons}}.
}}
{{Ambox{{\sandbox}}
| nocat = true
| type  = protection
| text  = type=<u>protection</u> — Protection notices, such as {{tl|Pp-cascading}} and {{tl|protectedinterface}}.
}}
}}


If no <code>type</code> parameter is given the template defaults to {{para|type|notice}}.
==Common parameters==
=== ''name'' ===
The ''name'' parameter specifies the name of the template, without the Template namespace prefix. For example {{Tl|Underlinked}} specifies {{Para|name|Underlinked}}.
 
This parameter should be updated if the template is ever moved. The purpose of this parameter is twofold:
* If incorrectly [[Wikipedia:Substitution|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 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'' ===
The ''subst'' parameter allows the meta-template to detect whether the template has been incorrectly substituted, and give an appropriate warning. It will also add such pages to [[:Category:Pages with incorrectly substituted templates]]. Just copy the code exactly as it appears in the box.
 
=== ''small'' ===
The ''small'' parameter should be passed through the template, as this will allow editors to use the small format by specifying {{para|small|left}} on an article:
{{Ambox|nocat=true|small=left|text=This is the small left-aligned Ambox format.}}
Otherwise the standard format will be produced:
{{Ambox|nocat=true|text=This is the standard Ambox format.}}
 
Other variations:
* For templates which should ''never'' be small, specify {{Para|small|no}} or do not pass the small parameter at all.
* For templates which should ''always'' be small, just specify {{Para|small|left}}.
* For templates which should ''default to small'', try {{para|small|<nowiki>{{{small|left}}}</nowiki>}}. This will allow an editor to override by using {{para|small|no}} on an article.
 
To use a small box that adjusts its width to match the text, use {{para|style|width: auto; margin-right: 0px;}} and {{para|textstyle|width: auto;}} together:
{{Ambox|nocat=true|small=left|style=width: auto; margin-right: 0px;|textstyle=width: auto; margin-right: 0px;|text=This is the small left-aligned Ambox format with flexible width.}}
 
See {{section link||sect}} below for more information on how to limit {{para|small}} display to cases when the template is being used for a section instead of the whole article (recommended, to prevent inconsistent top-of-article display).
 
 
=== ''talk'' ===
Some article message templates include a link to the talk page, and allow an editor to specify a section heading to link directly to the relevant section. To achieve this functionality, simply pass the ''talk'' parameter through, i.e. {{para|talk|<nowiki>{{{talk|}}}</nowiki>}}
 
This parameter may then be used by an editor as follows:
* {{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 [[Help:Link#Section linking (anchors)|section anchor]]), e.g. {{para|talk|Talk:Banana#Foo}}
 
Notes:
* When this parameter is used by a template, the talk page link will appear on the template itself (in order to demonstrate the functionality) but this will only display on articles if the parameter is actually defined.
* In order to make sure there is always a link to the talk page, you can use {{para|talk|<nowiki>{{{talk|#}}}</nowiki>}}.
* If the talk page does not exist, there will be no link, whatever the value of the parameter.
 
=== ''date'' ===
Passing the ''date'' parameter through to the meta-template means that the date that the article is tagged may be specified by an editor (or more commonly a [[Bots|bot]]). This will be displayed after the message in a smaller font.
 
.
 
=== ''info'' ===
This parameter is for specifying additional information. Whatever you add here will appear after the date, and will not be displayed if the template is being wrapped in {{tl|multiple issues}}.
 
=== ''removalnotice'' ===
If you specify {{para|removalnotice|yes}}, then the following notice will be displayed after the date and after the ''info'' text:
* <small>[[Help:Maintenance template removal|Learn how and when to remove this template message]].</small>
This will not be displayed if the template is being wrapped in {{tl|multiple issues}}.
 
=== ''cat'' ===
This parameter defines a monthly cleanup category. If {{para|cat|CATEGORY}} then:
* articles will be placed in '''Category:CATEGORY from DATE''' if  {{para|date|DATE}} is specified.
* articles will be placed in '''Category:CATEGORY''' if the date is not specified.
 
For example, {{Tl|No footnotes}} specifies {{Para|cat|Articles lacking in-text citations}} and so an article with the template {{Tlx|No footnotes|2=date=June 2010}} will be placed in [[:Category:Articles lacking in-text citations from June 2010]].
 
The ''cat'' parameter should not be linked, nor should the prefix <code>Category:</code> be used.
 
=== ''all'' ===
The ''all'' parameter defines a category into which all articles should be placed.
 
The ''all'' parameter should not be linked, nor should the prefix <code>Category:</code> be used.
 


=== <code>small=left</code> ===
{{Ambox{{\sandbox}}
| nocat = true
| type  = speedy
| text  = type=<u>speedy</u> — Speedy deletion issues, such as {{tl|speedy}}.
| small = left
}}
{{Ambox{{\sandbox}}
| nocat = true
| type  = delete
| text  = type=<u>delete</u> — Deletion issues, such as {{tl|delete}}.
| small = left
}}
{{Ambox{{\sandbox}}
| nocat = true
| type  = content
| text  = type=<u>content</u> — Content issues, such as {{tl|Update}} and {{tl|Expand}}.
| small = left
}}
{{Ambox{{\sandbox}}
| nocat = true
| type  = style
| text  = type=<u>style</u> — Style issues, such as {{tl|cleanup}} and {{tl|Documentation needed}}.
| small = left
}}
{{Ambox{{\sandbox}}
| nocat = true
| type  = notice
| text  = type=<u>notice</u> — Notices, such as {{tl|Extension exception}} and {{tl|Translating}}.
| small = left
}}
{{Ambox{{\sandbox}}
| nocat = true
| type  = move
| text  = type=<u>move</u> — Merge, split and transwiki proposals, such as {{tl|Merge}} and {{tl|Move to Commons}}.
| small = left
}}
{{Ambox{{\sandbox}}
| nocat = true
| type  = protection
| text  = type=<u>protection</u> — Protection notices, such as {{tl|Pp-cascading}} and {{tl|protectedinterface}}.
| small = left
}}


== See also ==
{{Mbox templates}}
Other pages:
* [[w:Template:Mbox]]
* [[w:Wikipedia:Ambox CSS classes]] — Describes how to use the ambox CSS classes directly in [[Help:Table|wikitable]]s and [[w:HTML element#Tables|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.


== TemplateData ==
<!--{{TemplateData header}}-->
{{Mbox/TemplateData}}
<!--templatedata>
{
"params": {
"type": {
"type": "line",
"suggestedvalues": [
"speedy",
"delete",
"content",
"style",
"notice",
"move",
"protection"
]
},
"text": {
"type": "string",
"suggested": true
}
},
"description": "This is a generic article message box."
}
</templatedata-->
<includeonly>{{Sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:Mbox templates{{#translation:}}]]
}}</includeonly>


{{collapse bottom}}
<noinclude>
[[Category:Template documentation|{{PAGENAME}}]]</noinclude>

Latest revision as of 03:40, 17 June 2022


Basic usage

The box below shows the most common parameters that are accepted by {{Ambox}}. The purpose of each is described below.

{{Ambox
| name  = 
| subst = <includeonly>{{subst:substcheck}}</includeonly>
| small = {{{small|}}}
| style=border-color:(purple; magenta; red; pink; orange; yellow; chartreuse; green; Cyan; violet; blue(default); brown; gray; black;)
| type  = 
| image = 
| sect  = {{{1|}}}
| issue = 
| talk  = {{{talk|}}}
| fix   = 
| date  = {{{date|}}}
| cat   = 
| all   = 
}}

Examples

{{ambox
| style=border-color:Cyan;
| text= this is text.<br>
| image = [[File:OOjs UI icon notice-warning.svg.png|50px]]
| info = '''this is info'''
}}

Default ambox

{{ambox
| info = '''this is info'''
}}

Common parameters

name

The name parameter specifies the name of the template, without the Template namespace prefix. For example {{Underlinked}} specifies |name=Underlinked.

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.
  • 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

The subst parameter allows the meta-template to detect whether the template has been incorrectly substituted, and give an appropriate warning. It will also add such pages to Category:Pages with incorrectly substituted templates. Just copy the code exactly as it appears in the box.

small

The small parameter should be passed through the template, as this will allow editors to use the small format by specifying |small=left on an article:

Otherwise the standard format will be produced:

Other variations:

  • For templates which should never be small, specify |small=no or do not pass the small parameter at all.
  • For templates which should always be small, just specify |small=left.
  • For templates which should default to small, try |small={{{small|left}}}. This will allow an editor to override by using |small=no on an article.

To use a small box that adjusts its width to match the text, use |style=width: auto; margin-right: 0px; and |textstyle=width: auto; together:

See § sect below for more information on how to limit |small= display to cases when the template is being used for a section instead of the whole article (recommended, to prevent inconsistent top-of-article display).


talk

Some article message templates include a link to the talk page, and allow an editor to specify a section heading to link directly to the relevant section. To achieve this functionality, simply pass the talk parameter through, i.e. |talk={{{talk|}}}

This parameter may then be used by an editor as follows:

  • |talk=SECTION HEADING – the link will point to the specified section on the article's talk page, e.g. |talk=Foo
  • |talk=FULL PAGE NAME – the template will link to the page specified (which may include a section anchor), e.g. |talk=Talk:Banana#Foo

Notes:

  • When this parameter is used by a template, the talk page link will appear on the template itself (in order to demonstrate the functionality) but this will only display on articles if the parameter is actually defined.
  • In order to make sure there is always a link to the talk page, you can use |talk={{{talk|#}}}.
  • If the talk page does not exist, there will be no link, whatever the value of the parameter.

date

Passing the date parameter through to the meta-template means that the date that the article is tagged may be specified by an editor (or more commonly a bot). This will be displayed after the message in a smaller font.

.

info

This parameter is for specifying additional information. Whatever you add here will appear after the date, and will not be displayed if the template is being wrapped in {{multiple issues}}.

removalnotice

If you specify |removalnotice=yes, then the following notice will be displayed after the date and after the info text:

This will not be displayed if the template is being wrapped in {{multiple issues}}.

cat

This parameter defines a monthly cleanup category. If |cat=CATEGORY then:

  • articles will be placed in Category:CATEGORY from DATE if |date=DATE is specified.
  • articles will be placed in Category:CATEGORY if the date is not specified.

For example, {{No footnotes}} specifies |cat=Articles lacking in-text citations and so an article with the template {{No footnotes|date=June 2010}} will be placed in Category:Articles lacking in-text citations from June 2010.

The cat parameter should not be linked, nor should the prefix Category: be used.

all

The all parameter defines a category into which all articles should be placed.

The all parameter should not be linked, nor should the prefix Category: be used.