Template:Ambox/doc: Difference between revisions

From BoyWiki
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude> {{documentation subpage}}</noinclude>
<noinclude> {{Documentation subpage}}</noinclude>  
This template is used to create article management templates.


Use {{tl|ambox|...}} on a template page, filling in the various options. The created template is then used at the top of various wiki pages to notify the user of issues.


Article management boxes should be used sparingly, as it can get in the way of content.
==Basic usage==
The box below shows the most common parameters that are accepted by {{Tl|Ambox}}. The purpose of each is described below.
<pre style="overflow:auto;">
{{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  =
}}
</pre>


 
==Examples==
==Named parameters==
; |image=: image for use on the left, defaults to [[:Image:40px-Padlock.svg.png]]. Takes full image code, e.g. <code><nowiki>[[Image:40px-Padlock.svg.png|50px]]</nowiki></code>. The image box area has a limit of 60px width.
; |type=: top line text
; |info=: list of extra info
; |style=border-color:
'''Border color defaults to blue'''
 
== Examples ==
 
=== Default ===
<pre>
<pre>
{{ambox
{{ambox
| type = I am type
| style=border-color:Cyan;
| info = I am info
| text= this is text.<br>
| image = [[File:OOjs UI icon notice-warning.svg.png|50px]]
| info = '''this is info'''
}}
}}
</pre>
</pre>


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


=== Red + image ===
'''Default ambox'''
<pre>
<pre>
{{ambox
{{ambox
| image = [[Image:40px-Padlock.svg.png|50px]]
| info = '''this is info'''
| style=border-color:red;
| type = I am type
| info =
* I am info
}}
}}
</pre>
</pre>
{{ambox
{{ambox
| image = [[Image:40px-Padlock.svg.png|50px]]
| info = '''this is info'''
| style=border-color:red;
| type = I am type
| info =
* I am info
}}
}}


=== Other colors ===
==Common parameters==
==== Yellow ====
=== ''name'' ===
<nowiki>{{ambox
The ''name'' parameter specifies the name of the template, without the Template namespace prefix. For example {{Tl|Underlinked}} specifies {{Para|name|Underlinked}}.
| style=border-color:yellow;
 
| type = I am type
This parameter should be updated if the template is ever moved. The purpose of this parameter is twofold:
| info =
* 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.
* I am info
* 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.
}}</nowiki>
 
{{ambox
=== ''subst'' ===
| style=border-color:yellow;
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.
| type = I am type
 
| info =
=== ''small'' ===
* I am info
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.


==== Green ====
The ''all'' parameter should not be linked, nor should the prefix <code>Category:</code> be used.
<nowiki>{{ambox
| style=border-color:green;
| type = I am type
| info =
* I am info
}}</nowiki>
{{ambox
| style=border-color:green;
| type = I am type
| info =
* I am info
}}


==== Purple ====
<nowiki>{{ambox
| style=border-color:purple;
| type = I am type
| info =
* I am info
}}</nowiki>


{{ambox
| style=border-color:purple;
| type = I am type
| info =
* I am info
}}


==== Blue ====
{{ambox
| border = blue
| type = I am type
| info =
* I am info
}}


==== Orange ====
{{ambox
| style=border-color:orange;
| type = I am type
| info =
* I am info
}}


==== Gray ====
{{ambox
| style=border-color:gray;
| type = I am type
| info =
* I am info
}}
<bR>
<noinclude>
<noinclude>
[[Category:Template documentation|{{PAGENAME}}]]</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.