Editing Template:Ambox/doc
From Guild of Archivists
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 6: | Line 6: | ||
This is the {{tl|Ambox}} (['''A''']rticle ['''m''']essage ['''box''']) metatemplate. | This is the {{tl|Ambox}} (['''A''']rticle ['''m''']essage ['''box''']) metatemplate. | ||
It is used to build ''article message box'' templates such as {{tl| | It is used to build ''article message box'' templates such as {{tl|Underlinked}}. It offers several different colours, uses default images if no image parameter is given, and has some other features. | ||
== Common parameters == | == Common parameters == | ||
Line 28: | Line 28: | ||
=== ''name'' === | === ''name'' === | ||
The ''name'' parameter specifies the name of the template, without the Template namespace prefix. For example {{Tl| | 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: | 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. | * 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 | * 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'' === | ||
Line 48: | Line 48: | ||
* 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. | ||
See | See {{sectionlink||sect}}, below, for 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). | ||
=== ''type'' === | === ''type'' === | ||
Line 55: | Line 55: | ||
|nocat=true | |nocat=true | ||
| type = speedy | | type = speedy | ||
| text = type=<u>speedy</u> – Speedy deletion issues. | | text = type=<u>speedy</u> – Speedy deletion issues, such as {{tl|db-g1}} and {{tl|db-g3}}. | ||
}} | }} | ||
{{Ambox | {{Ambox | ||
|nocat=true | |nocat=true | ||
| type = delete | | type = delete | ||
| text = type=<u>delete</u> – Deletion issues, such as {{tl|proposed deletion}}. | | text = type=<u>delete</u> – Deletion issues, such as {{tl|article for deletion}} and {{tl|proposed deletion}}. | ||
}} | }} | ||
{{Ambox | {{Ambox | ||
|nocat=true | |nocat=true | ||
| type = content | | type = content | ||
| text = type=<u>content</u> – Content issues, such as {{tl| | | text = type=<u>content</u> – Content issues, such as {{tl|POV}} and {{tl|globalize}}. | ||
}} | }} | ||
{{Ambox | {{Ambox | ||
|nocat=true | |nocat=true | ||
| type = style | | type = style | ||
| text = type=<u>style</u> – Style issues, such as {{tl|cleanup}}. | | text = type=<u>style</u> – Style issues, such as {{tl|cleanup}} and {{tl|underlinked}}. | ||
}} | }} | ||
{{ambox | {{ambox | ||
|nocat=true | |nocat=true | ||
| type = notice | | type = notice | ||
| text = type=<u>notice</u> – Article notices, such as {{tl| | | text = type=<u>notice</u> – Article notices, such as {{tl|current}} and {{tl|in use}}. | ||
}} | }} | ||
{{Ambox | {{Ambox | ||
|nocat=true | |nocat=true | ||
| type = move | | type = move | ||
| text = type=<u>move</u> – Merge and | | text = type=<u>move</u> – Merge, split and transwiki proposals, such as {{tl|split}} and {{tl|copy to Wiktionary}}. | ||
}} | }} | ||
{{Ambox | {{Ambox | ||
|nocat=true | |nocat=true | ||
| type = protection | | type = protection | ||
| text = type=<u>protection</u> – Protection notices, such as {{tl|pp-protected}}. | | text = type=<u>protection</u> – Protection notices, such as {{tl|pp-vandalism}} and {{tl|pp-protected}}. | ||
}} | }} | ||
Line 103: | Line 103: | ||
{{em|If using this feature, be sure to remove the first two words ("This article") from the template's text, otherwise it will be duplicated.}} | {{em|If using this feature, be sure to remove the first two words ("This article") from the template's text, otherwise it will be duplicated.}} | ||
A common way to facilitate this functionality is to pass {{para|sect|<nowiki>{{{1|}}}</nowiki>}}. This will allow editors to type <kbd>section</kbd>, for example, as the first unnamed parameter of the template to change the wording. For example, {{tlx| | A common way to facilitate this functionality is to pass {{para|sect|<nowiki>{{{1|}}}</nowiki>}}. This will allow editors to type <kbd>section</kbd>, for example, as the first unnamed parameter of the template to change the wording. For example, {{tlx|Advert|section}} produces: | ||
{{ | {{Advert|section|date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}}} | ||
Another approach is to pass {{para|sect|<nowiki>{{{section|{{{sect|}}}}}}</nowiki>}} to provide a named value. Another is to use {{tlx|Yesno}} to parse the value for a positive, and pass {{para|sect|section}} if true. | Another approach is to pass {{para|sect|<nowiki>{{{section|{{{sect|}}}}}}</nowiki>}} to provide a named value. Another is to use {{tlx|Yesno}} to parse the value for a positive, and pass {{para|sect|section}} if true. | ||
Line 115: | Line 115: | ||
It is also advisable to restrict use of the {{para|small}} parameter so that it is made contingent upon the template being applied to a section (or whatever) rather than the whole article, to prevent the small version of the template being used at the top of the article where it would be inconsistent with other article-wide cleanup/dispute banners: | It is also advisable to restrict use of the {{para|small}} parameter so that it is made contingent upon the template being applied to a section (or whatever) rather than the whole article, to prevent the small version of the template being used at the top of the article where it would be inconsistent with other article-wide cleanup/dispute banners: | ||
{{block indent|1=<code><nowiki>| small = {{#if:{{{sect|{{{section|{{{1|}}}}}}}}}|{{#if:{{{small|{{{left|}}}}}}|left}} }}</nowiki></code>}} | {{block indent|1=<code><nowiki>| small = {{#if:{{{sect|{{{section|{{{1|}}}}}}}}}|{{#if:{{{small|{{{left|}}}}}}|left}} }}</nowiki></code>}} | ||
(In this case, any value of {{para|small}} or {{para|left}} will trigger the small, left display, as long as some value of {{para|sect}} or one of its aliases in that template has also been provided.) This code can be copy-pasted and used with the above code block. See, e.g., [[Template: | (In this case, any value of {{para|small}} or {{para|left}} will trigger the small, left display, as long as some value of {{para|sect}} or one of its aliases in that template has also been provided.) This code can be copy-pasted and used with the above code block. See, e.g., [[Template:Trivia]] and its [[Template:Trivia/testcases]] to observe the combined functionality. | ||
=== ''issue'' and ''fix'' === | === ''issue'' and ''fix'' === | ||
Line 122: | Line 122: | ||
The ''fix'' parameter contains some text which describes what should be done to improve the article. It may be longer than the text in ''issue'', but should not usually be more than two sentences. | The ''fix'' parameter contains some text which describes what should be done to improve the article. It may be longer than the text in ''issue'', but should not usually be more than two sentences. | ||
When the template is in its compact form (when placed inside {{tl|multiple issues}}) or small form (when using {{para|small|left}}), the ''issue'' is the only text that will be displayed. For example, {{Tl| | When the template is in its compact form (when placed inside {{tl|multiple issues}}) or small form (when using {{para|small|left}}), the ''issue'' is the only text that will be displayed. For example, {{Tl|Citation style}} defines | ||
* <code>|issue=<nowiki>This article ''' | * <code>|issue=<nowiki>This article '''has an unclear citation style'''.</nowiki></code> | ||
* <code>|fix=<nowiki> | * <code>|fix=<nowiki>The references used may be made clearer with a different or consistent style of [[Wikipedia:Citing sources|citation]], [[Wikipedia:Footnotes|footnoting]], or [[Wikipedia:External links|external linking]].</nowiki></code> | ||
When used stand-alone it produces the whole text: | When used stand-alone it produces the whole text: | ||
{{ | {{Citation style|date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}}} | ||
But when used inside {{Tl|Multiple issues}} or with {{Para|small|left}} it displays only the issue: | But when used inside {{Tl|Multiple issues}} or with {{Para|small|left}} it displays only the issue: | ||
{{Multiple issues <!-- Even though there's only one "issue", please don't remove this {{Multiple issues}} template. It is a demonstration of the formatting. --> |{{ | {{Multiple issues <!-- Even though there's only one "issue", please don't remove this {{Multiple issues}} template. It is a demonstration of the formatting. --> |{{Citation style|date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}}} | ||
{{ | {{Citation style|small=left|date={{CURRENTMONTHNAME}} {{CURRENTYEAR}}}} | ||
=== ''talk'' === | === ''talk'' === | ||
Line 148: | Line 148: | ||
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 [[Wikipedia:Bots|bot]]). This will be displayed after the message in a smaller font. | 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 [[Wikipedia:Bots|bot]]). This will be displayed after the message in a smaller font. | ||
Passing this parameter also enables monthly cleanup | Passing this parameter also enables [[:Category:Wikipedia maintenance categories sorted by month|monthly cleanup categorisation]] when the ''cat'' parameter is also defined. | ||
=== ''cat'' === | === ''cat'' === | ||
Line 220: | Line 220: | ||
Customised text for the small format can be defined using ''smalltext''. | Customised text for the small format can be defined using ''smalltext''. | ||
=== Additional | === Additional categorisation parameters === | ||
* ''cat2'' and ''cat3'' provide additional monthly categories; see [[#cat]]. | * ''cat2'' and ''cat3'' provide additional monthly categories; see [[#cat]]. | ||
* ''all2'' and ''all3'' provide additional categories into which all articles are placed, just like [[#all]]. | * ''all2'' and ''all3'' provide additional categories into which all articles are placed, just like [[#all]]. | ||
== 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 [[Help: | * This meta-template uses the ambox CSS classes in [[MediaWiki:Common.css]]. The classes can also be used directly in a [[m:Help:Table|wikitable]] if special functionality is needed. See the [[Wikipedia:Ambox 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> |