Template:Ambox/doc: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
m (1 revision imported: Importing general purpose templates) |
(recat, removed some unnecessary Wikipedia links) |
||
Line 4: | Line 4: | ||
This is the {{Tl|Ambox}} or '''Article message box''' meta-template. |
This is the {{Tl|Ambox}} or '''Article message box''' meta-template. |
||
It is used to build ''article message box'' templates such as |
It is used to build ''article message box'' templates such as [[Template:Changing]]. It offers several different colours, uses default images if no image parameter is given, and has some other features. |
||
See [[wp:Template:Ambox]]. |
See [[wp:Template:Ambox]]. |
||
== Common parameters == |
== Common parameters == |
||
The box on the right shows the most common parameters |
The box on the right shows the most common parameters of {{tl|ambox}}. The purpose of each is described below. |
||
{| class="wikitable" align="right" style="background:transparent; width=40%" |
{| class="wikitable" align="right" style="background:transparent; width=40%" |
||
!Common parameters |
!Common parameters |
||
Line 35: | Line 35: | ||
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 |
* 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. |
* 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'' === |
||
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 |
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]]. |
||
=== ''small'' === |
=== ''small'' === |
||
Line 49: | Line 49: | ||
Other variations: |
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 ''never'' be small, specify {{para|small|no}} or do not pass the small parameter at all. |
||
* For templates which should ''always'' be small, |
* For templates which should ''always'' be small, 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. |
* 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. |
||
=== ''type'' === |
=== ''type'' === |
||
The ''type'' parameter defines the colour of the left bar |
The ''type'' parameter defines the colour of the left bar and the default image. It is based on the type of issue that the template describes. The seven available types and their default images are shown below. |
||
{{Ambox |
{{Ambox |
||
|nocat=true |
|nocat=true |
||
| type = speedy |
| type = speedy |
||
| text = type=<u>speedy</u> – Speedy deletion issues |
| text = type=<u>speedy</u> – Speedy deletion issues. |
||
}} |
}} |
||
{{Ambox |
{{Ambox |
||
|nocat=true |
|nocat=true |
||
| type = delete |
| type = delete |
||
| text = type=<u>delete</u> – Deletion issues |
| text = type=<u>delete</u> – Deletion issues. |
||
}} |
}} |
||
{{Ambox |
{{Ambox |
||
|nocat=true |
|nocat=true |
||
| type = content |
| type = content |
||
| text = type=<u>content</u> – Content issues |
| text = type=<u>content</u> – Content issues. |
||
}} |
}} |
||
{{Ambox |
{{Ambox |
||
|nocat=true |
|nocat=true |
||
| type = style |
| type = style |
||
| text = type=<u>style</u> – Style issues |
| text = type=<u>style</u> – Style issues. |
||
}} |
}} |
||
{{ambox |
{{ambox |
||
|nocat=true |
|nocat=true |
||
| type = notice |
| type = notice |
||
| text = type=<u>notice</u> – Article notices |
| text = type=<u>notice</u> – Article notices. |
||
}} |
}} |
||
{{Ambox |
{{Ambox |
||
|nocat=true |
|nocat=true |
||
| type = move |
| type = move |
||
| text = type=<u>move</u> – Merge, split and transwiki proposals |
| text = type=<u>move</u> – Merge, split and transwiki proposals. |
||
}} |
}} |
||
{{Ambox |
{{Ambox |
||
|nocat=true |
|nocat=true |
||
| type = protection |
| type = protection |
||
| text = type=<u>protection</u> – Protection notices |
| text = type=<u>protection</u> – Protection notices. |
||
}} |
}} |
||
Line 93: | Line 93: | ||
=== ''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 |
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. 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: |
||
Line 104: | Line 104: | ||
* 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 |
* If an icon is purely decorative and also in the public domain, accessibility can be improved by suppressing the link to the file page by adding "{{para|link}}{{para|alt}}" as seen above. |
||
=== ''sect'' === |
=== ''sect'' === |
||
Line 127: | Line 127: | ||
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 link will point to the specified section on the article's talk page, e.g. {{para|talk|Foo}} |
* {{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 |
* {{para|talk|FULL PAGE NAME}} - the template will link to the page specified (which may include a section anchor, e.g. {{para|talk|Talk:Banana#Foo}}) |
||
Notes: |
Notes: |
||
Line 193: | Line 193: | ||
=== ''class'' === |
=== ''class'' === |
||
A custom |
A custom CSS class to apply to the box. |
||
=== ''style'' and ''textstyle'' === |
=== ''style'' and ''textstyle'' === |
||
Line 210: | Line 210: | ||
== Technical notes == |
== Technical notes == |
||
* This meta-template uses the ambox CSS classes in [[MediaWiki:Common.css]]. The classes can also be used directly in a |
* This meta-template uses the ambox CSS classes in [[MediaWiki:Common.css]]. The classes can also be used directly in a wikitable if special functionality is needed. See the [[Wikipedia:Ambox CSS classes|how-to guide]] for that. |
||
* 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> |
||
Line 233: | Line 233: | ||
* 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}} or {{w|Template:ambox/small|ambox/small}} which holds most of the code for {{Tl|Ambox}}, while {{Tl|Ambox}} itself does parameter preprocessing. |
* This template calls {{Tl|Ambox/core}} or {{w|Template:ambox/small|ambox/small}} 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 meta-templates are made, since wikimarkup has several drawbacks. For instance, it makes it harder to use |
* Internally, this meta-template uses HTML markup instead of wikimarkup for the table code. That is the usual way meta-templates are made, since wikimarkup has several drawbacks. For instance, it makes it harder to use parser functions and some special characters in parameters. |
||
* 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 {{w|Template:Tmbox|Tmbox}}, {{w|Template:Imbox|Imbox}}, {{w|Template:Cmbox|Cmbox}} and {{w|Template:Ombox|Ombox}} their talk pages and related pages might also contain more details. |
|||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| |
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| |
||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> |
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> |
||
[[Category:Templates|*]] |
[[Category:Templates|*]] |
||
[[Category: |
[[Category:Ambox templates]] |
||
}}</includeonly> |
}}</includeonly> |