Template:Ambox/doc: Difference between revisions

From Celeste Wiki
recat, removed some unnecessary Wikipedia links
m (1 revision imported: Importing general purpose templates)
(recat, removed some unnecessary Wikipedia links)
Line 4:
This is the {{Tl|Ambox}} or '''Article message box''' meta-template.
 
It is used to build ''article message box'' templates such as {{w|[[Template:underlinked|underlinked}}Changing]]. It offers several different colours, uses default images if no image parameter is given, and has some other features.
 
See [[wp:Template:Ambox]].
 
== Common parameters ==
The box on the right shows the most common parameters that are accepted byof {{tl|ambox}}. The purpose of each is described below.
{| class="wikitable" align="right" style="background:transparent; width=40%"
!Common parameters
Line 35:
 
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 {{w|[[:Category:Pages with incorrectly substituted templates}}. Just copy the code exactly as it appears in the box]].
 
=== ''small'' ===
Line 49:
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.
 
=== ''type'' ===
The ''type'' parameter defines the colour of the left bar, and the default image that is used by default. The type is chosen not on aesthetics butIt is based on the type of issue that the template describes. The seven available types and their default images are shown below.
{{Ambox
|nocat=true
| type = speedy
| text = type=<u>speedy</u> – Speedy deletion issues, such as {{w|Template:db-gl|db-g1}} and {{w|Template:db-g3|db-g3}}.
}}
{{Ambox
|nocat=true
| type = delete
| text = type=<u>delete</u> – Deletion issues, such as {{w|Template:afd|afd}} and {{w|Template:prod|prod}}.
}}
{{Ambox
|nocat=true
| type = content
| text = type=<u>content</u> – Content issues, such as {{tl|POV}} and {{w|Template:globalize|globalize}}.
}}
{{Ambox
|nocat=true
| type = style
| text = type=<u>style</u> – Style issues, such as {{tl|cleanup}} and {{w|Template:underlinked|underlinked}}.
}}
{{ambox
|nocat=true
| type = notice
| text = type=<u>notice</u> – Article notices, such as {{tl|current}} and {{w|Template:inuse|inuse}}.
}}
{{Ambox
|nocat=true
| type = move
| text = type=<u>move</u> – Merge, split and transwiki proposals, such as {{w|Template:split|split}} and {{w|Template:copy to wikitionary|copy to wiktionary}}.
}}
{{Ambox
|nocat=true
| type = protection
| text = type=<u>protection</u> – Protection notices, such as {{w|Template:pp-vandalism|pp-vandalism}} and {{w|Template:pp-semi-protected|pp-semi-protected}}.
}}
 
Line 93:
 
=== ''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]].) 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:
Line 104:
* 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 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'' ===
Line 127:
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 [[WP:ANCHOR|section anchor]]), e.g. {{para|talk|Talk:Banana#Foo}})
 
Notes:
Line 193:
 
=== ''class'' ===
A custom [[Cascading Style Sheets|CSS]] class to apply to the box.
 
=== ''style'' and ''textstyle'' ===
Line 210:
 
== Technical notes ==
* 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.
* If you need to use special characters in the text parameter then you need to escape them like this:
<pre>
Line 233:
* 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.
* 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 [[m:Help:ParserFunctions|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.
* 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||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Templates|*]]
[[Category:Mbox and messageboxAmbox templates]]
}}</includeonly>
2,338

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.