Difference between revisions of "Template:Asbox/doc"

From LongTrailsWiki
Jump to navigation Jump to search
 
imported>Numbers
m (1 revision imported)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
=== Basic usage ===
+
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
 +
{{High-use| 2219684 |all-pages = yes}}
 +
{{lua|Module:Asbox}}
 +
{{Mbox templates (small)}}
 +
 
 +
This is the '''Asbox''' (['''A''']rticle ['''s''']tub ['''box''']) metatemplate. It is the standard template used for creating new or updating existing [[Wikipedia:Stubs|article stub]] box templates. It supports virtually all stub template styles.
 +
 
 +
==Usage==
 +
<pre>
 +
{{Asbox
 +
| image =
 +
| subject =
 +
| qualifier =
 +
| category =
 +
| name =
 +
}}
 +
</pre>
 +
 
 +
===''image''===
 +
Filename only and no prefix, e.g. "Image.png" (without quotemarks). Image will be sized at 40x30px.
 +
 
 +
===''subject''===
 +
Placed before the word "article" in the template (e.g. "biographical", producing "This biographical article is (...)").
 +
 
 +
===''qualifier''===
 +
Placed after the word "article" (e.g. "about a musician", producing "(...) article about a musician is (...)").
 +
 
 +
===''category''===
 +
Name only of category to which pages where this template used are added (e.g. "History stubs").
 +
 
 +
===''name''===
 +
Full name of the stub template itself (used for internal reference).
 +
 
 +
This simple usage should suffice for most stub templates. Additional parameters are described below for advanced use.
 +
 
 +
==Full syntax==
 
<pre>
 
<pre>
{{asbox
+
{{Asbox
| image     = just the name of the image, e.g. Image.png - will be sized at 40x30px
+
| image = Ambox style.png
| subject   = given before "article", e.g. "this *biographical* article is a stub"
+
| pix =
| qualifier = given after "article" e.g. "this article *about a musician* is a stub"
+
| subject =
| category = just the name of the category to place tagged pages in, e.g. History stubs
+
| article =
}}</pre>
+
| qualifier =
 +
| category =
 +
| tempsort =
 +
| category1 =
 +
| tempsort1 =
 +
| note =
 +
| name = {{subst:FULLPAGENAME}}
 +
}}
 +
</pre>
 +
 
 +
==Parameters==
 +
===<code>icon</code> or <code>image</code>===
 +
If the image is called with an icon template, <code>icon</code> is set to the full syntax of the template; that's the name of the template, plus any arguments (separated with '''|''' ), including the <code>{{</code> and <code>}}</code> around it. Icon can also be used to provide the full image markup (include the opening and closing square brackets), if special image settings such as "border" are to be used. If the image is called explicitly <code>image</code> is the name of the image :- <code>pix</code> will likely be required as well, the default value for <code>pix</code> is 40x30.
 +
 
 +
<code>imagealt</code> may be used to override the default [[WP:Alternate text for images|alt text]] which is set to "Stub icon".
 +
 
 +
===<code>pix</code>===
 +
The size of the image in pixels (no need to append px). Only ''required'' if <code>image</code> is used and this image requires a size different from the default maximum of 40x30 pixels. (Note that in the interests of standardising the formats of stub messages, images of size 40x30 are much preferred.)
 +
 
 +
===<code>subject</code> and <code>qualifier</code>===
 +
This <code>subject</code> article <code>qualifier</code> is a stub ...
 +
 
 +
Examples:
 +
* This '''geography''' article '''about a place in Rohan''' is a stub ...
 +
* This '''elementary physics''' article is a stub ...
 +
* This  article '''about Rudolph the Red-nosed reindeer''' is a stub ...
 +
 
 +
===Other parameters===
 +
{| class="wikitable"
 +
! scope=col | Parameter
 +
! scope=col | Description
 +
|-
 +
| category  || The [[:Category:Stub categories|stub category]] the articles should go in.
 +
|-
 +
| tempsort  || If exists the stub template [?] (and any other templates) will be put in its own category sorted as "&nbsp;" (space) followed by <code>tempsort</code>, otherwise it will be sorted with the value of "&nbsp;" (space) followed by the template name.
 +
|-
 +
| category1 || An optional second stub category the articles should go in.
 +
|-
 +
| tempsort1 || If exists the stub template [?] (and any other templates) will be put in its own category sorted as "&nbsp;" (space) followed by <code>tempsort1</code>, otherwise it will be sorted with the value of "&nbsp;" (space) followed by the template name.
 +
|-
 +
| category# || {{Red|New}} (Jan 2015): Since the release of [[Module:Asbox|Asbox's module]], this template now supports an unlimited number of categories. Just replace '#' with a number, e.g. {{para|category2|Normal stubs}}, {{para|category99|Over-categorized stubs}}, etc. Traditionally, category2 was the max, so please only use more than 3 if the additional categories are unique, i.e. not sub or parent categories of the others.
 +
|-
 +
| tempsort# || {{Red|New}} (Jan 2015): Similar to the category params, you can have any number of tempsort params.
 +
|-
 +
| note      || If exists the value [?] will be added, as a "small" note, to the stub template.
 +
|-
 +
| name      || The full page name of the template itself.
 +
|-
 +
| demo      || Has no effect in article space. Prevents category output. Set to anything to enable. (Even 'no' or 'false' will enable it!)<br>{{Red|New}} (Jan 2015): If demo is set, it will show pseudo-categories. If {{para|demo|art}} then the pseudo-cats shown will only be those visible in article space (i.e. no error/hidden cats). Set {{para|demo|doc}} to preview the documentation page as well (and all cats). See:&nbsp;[[Template:Asbox/testcases]]
 +
|}
 +
 
 +
==Examples==
 +
===Using <code>image</code>===
 +
Based on {{tl|Østfold-geo-stub}}:
 +
{{demo|br=produces:|demo_kill_categories=yes
 +
|<nowiki>{{Asbox
 +
| image = Østfold_våpen.svg
 +
| pix = 30
 +
| subject = [[Østfold]] location
 +
| name = Template:Østfold-geo-stub
 +
| category = Østfold geography stubs
 +
| tempsort = *
 +
}}
 +
</nowiki>}}
 +
 
 +
===Using <code>icon</code> and <code>category1</code>===
 +
Using <code>icon</code> allows more flexibility in some circumstances than <code>image</code> and <code>pix</code>, since it can be used with templates. Based on {{tl|Wales-footy-bio-stub}}:
 +
{{demo|br=produces:|demo_kill_categories=yes
 +
|<nowiki>{{Asbox
 +
| icon = {{soccer icon|Wales|50}}
 +
| subject = biographical
 +
| qualifier = related to Welsh association football
 +
| category = Welsh football biography stubs
 +
| tempsort = *  
 +
| name = Template:Wales-footy-bio-stub
 +
}}
 +
</nowiki>}}
 +
 
 +
==WhatLinksHere==
 +
The page [{{fullurl:Special:WhatLinksHere/Template:Asbox|hideredirs=1&namespace=10&hidelinks=1}} here] should have a complete list of all templates using this template.  This list can be compared with existing list of stub templates to identify new stub templates created out of process. '''The last entries will also be the most recently created items.'''
 +
 
 +
==Navbar==
 +
This template contains...
 +
<nowiki>{{Navbar |{{{name}}} |mini=yes |style=position:absolute;right:15px;font-size:smaller;display:none;}}</nowiki>
 +
...which allows the specification (with CSS) of the three stub-template links provided (see [{{fullurl:w:Template_talk:Asbox|oldid=313089738#Navbar}}]). A side effect is that a non-existing talk page of the stub template may appear on [[Special:WantedPages]].
 +
 
 +
==TemplateData==
 +
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
"description": "Standard template used for creating new or updating existing article stub box templates.",
 +
"params": {
 +
"category": {
 +
"label": "Stub category",
 +
"type": "wiki-page-name",
 +
"description": "The category into which this stub template puts pages.",
 +
"required": true
 +
},
 +
"subject": {
 +
"label": "Subject",
 +
"description": "The subject of the stub template's category.",
 +
"suggested": true
 +
},
 +
"qualifier": {
 +
"label": "Qualifier",
 +
"description": "The sub-subject of the stub template's category."
 +
},
 +
"image": {
 +
"label": "Icon image",
 +
"type": "wiki-file-name",
 +
"description": "Image to use as an icon in the template.",
 +
"suggested": true
 +
},
 +
"imagealt": {
 +
"label": "Icon at text",
 +
"description": "Alt text for the icon, especially for screen readers.",
 +
"default": "Stub icon",
 +
"suggested": true
 +
},
 +
"pix": {
 +
"label": "Icon size",
 +
"description": "Size at which to display the icon."
 +
},
 +
"icon": {
 +
"label": "Icon",
 +
"description": "Icon to show in the template.",
 +
"suggested": true
 +
},
 +
"article": {
 +
"label": "Page name",
 +
"description": "Different term instead of 'article' to use in the template."
 +
},
 +
"note": {
 +
"label": "Note",
 +
"description": "A small note about the stub shown underneath the main text."
 +
},
 +
"name": {
 +
"label": "Template name",
 +
"description": "The name of the template.",
 +
"type": "string",
 +
"autovalue": "{{subst:FULLPAGENAME}}"
 +
},
 +
"category1": {
 +
"label": "Secondary stub category",
 +
"type": "wiki-page-name",
 +
"description": "A secondary category into which this stub template puts pages."
 +
},
 +
"category#": {
 +
"label": "Tertiary stub category",
 +
"type": "wiki-page-name",
 +
"description": "A tertiary category into which this stub template puts pages."
 +
},
 +
"tempsort": {
 +
"label": "Stub category sort prefix",
 +
"description": "If set to a value other than 'no', a prefix for sorting pages in the category."
 +
},
 +
"tempsort#": {
 +
"label": "Tertiary stub category sort prefix",
 +
"description": "If set to a value other than 'no', a prefix for sorting pages in the tertiary category."
 +
}
 +
}
 +
}
 +
</templatedata>
 +
 
 +
==See also==
 +
* [[Wikipedia talk:WikiProject Stub sorting/Archive11#Stub template standardisation]]
 +
 
 +
{{Mbox templates see also}}
  
<includeonly>
+
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox |
[[Category:Stub Templates| ]]
+
| <!-- Categories below this line, please; interwikis at Wikidata -->
</includeonly>
+
[[Category:Mbox and messagebox templates]]
 +
[[Category:Stub message templates| ]]
 +
}}</includeonly>

Latest revision as of 01:08, 2 December 2019

Lua error in package.lua at line 80: module 'Module:Transclusion_count/data/A' not found.

Template:Mbox templates (small)

This is the Asbox ([A]rticle [s]tub [box]) metatemplate. It is the standard template used for creating new or updating existing article stub box templates. It supports virtually all stub template styles.

Usage

{{Asbox
| image = 
| subject = 
| qualifier = 
| category = 
| name = 
}}

image

Filename only and no prefix, e.g. "Image.png" (without quotemarks). Image will be sized at 40x30px.

subject

Placed before the word "article" in the template (e.g. "biographical", producing "This biographical article is (...)").

qualifier

Placed after the word "article" (e.g. "about a musician", producing "(...) article about a musician is (...)").

category

Name only of category to which pages where this template used are added (e.g. "History stubs").

name

Full name of the stub template itself (used for internal reference).

This simple usage should suffice for most stub templates. Additional parameters are described below for advanced use.

Full syntax

{{Asbox
| image = Ambox style.png
| pix = 
| subject = 
| article = 
| qualifier = 
| category = 
| tempsort = 
| category1 = 
| tempsort1 = 
| note = 
| name = {{subst:FULLPAGENAME}}
}}

Parameters

icon or image

If the image is called with an icon template, icon is set to the full syntax of the template; that's the name of the template, plus any arguments (separated with | ), including the {{ and }} around it. Icon can also be used to provide the full image markup (include the opening and closing square brackets), if special image settings such as "border" are to be used. If the image is called explicitly image is the name of the image :- pix will likely be required as well, the default value for pix is 40x30.

imagealt may be used to override the default alt text which is set to "Stub icon".

pix

The size of the image in pixels (no need to append px). Only required if image is used and this image requires a size different from the default maximum of 40x30 pixels. (Note that in the interests of standardising the formats of stub messages, images of size 40x30 are much preferred.)

subject and qualifier

This subject article qualifier is a stub ...

Examples:

  • This geography article about a place in Rohan is a stub ...
  • This elementary physics article is a stub ...
  • This article about Rudolph the Red-nosed reindeer is a stub ...

Other parameters

Parameter Description
category The stub category the articles should go in.
tempsort If exists the stub template [?] (and any other templates) will be put in its own category sorted as " " (space) followed by tempsort, otherwise it will be sorted with the value of " " (space) followed by the template name.
category1 An optional second stub category the articles should go in.
tempsort1 If exists the stub template [?] (and any other templates) will be put in its own category sorted as " " (space) followed by tempsort1, otherwise it will be sorted with the value of " " (space) followed by the template name.
category# Template:Red (Jan 2015): Since the release of Asbox's module, this template now supports an unlimited number of categories. Just replace '#' with a number, e.g. |category2=Normal stubs, |category99=Over-categorized stubs, etc. Traditionally, category2 was the max, so please only use more than 3 if the additional categories are unique, i.e. not sub or parent categories of the others.
tempsort# Template:Red (Jan 2015): Similar to the category params, you can have any number of tempsort params.
note If exists the value [?] will be added, as a "small" note, to the stub template.
name The full page name of the template itself.
demo Has no effect in article space. Prevents category output. Set to anything to enable. (Even 'no' or 'false' will enable it!)
Template:Red (Jan 2015): If demo is set, it will show pseudo-categories. If |demo=art then the pseudo-cats shown will only be those visible in article space (i.e. no error/hidden cats). Set |demo=doc to preview the documentation page as well (and all cats). See: Template:Asbox/testcases

Examples

Using image

Based on {{Østfold-geo-stub}}: Template:Demo

Using icon and category1

Using icon allows more flexibility in some circumstances than image and pix, since it can be used with templates. Based on {{Wales-footy-bio-stub}}: Template:Demo

WhatLinksHere

The page here should have a complete list of all templates using this template. This list can be compared with existing list of stub templates to identify new stub templates created out of process. The last entries will also be the most recently created items.

Navbar

This template contains...

{{Navbar |{{{name}}} |mini=yes |style=position:absolute;right:15px;font-size:smaller;display:none;}}

...which allows the specification (with CSS) of the three stub-template links provided (see [1]). A side effect is that a non-existing talk page of the stub template may appear on Special:WantedPages.

TemplateData

Template:TemplateData header <templatedata> { "description": "Standard template used for creating new or updating existing article stub box templates.", "params": { "category": { "label": "Stub category", "type": "wiki-page-name", "description": "The category into which this stub template puts pages.", "required": true }, "subject": { "label": "Subject", "description": "The subject of the stub template's category.", "suggested": true }, "qualifier": { "label": "Qualifier", "description": "The sub-subject of the stub template's category." }, "image": { "label": "Icon image", "type": "wiki-file-name", "description": "Image to use as an icon in the template.", "suggested": true }, "imagealt": { "label": "Icon at text", "description": "Alt text for the icon, especially for screen readers.", "default": "Stub icon", "suggested": true }, "pix": { "label": "Icon size", "description": "Size at which to display the icon." }, "icon": { "label": "Icon", "description": "Icon to show in the template.", "suggested": true }, "article": { "label": "Page name", "description": "Different term instead of 'article' to use in the template." }, "note": { "label": "Note", "description": "A small note about the stub shown underneath the main text." }, "name": { "label": "Template name", "description": "The name of the template.", "type": "string", "autovalue": "{{subst:FULLPAGENAME}}" }, "category1": { "label": "Secondary stub category", "type": "wiki-page-name", "description": "A secondary category into which this stub template puts pages." }, "category#": { "label": "Tertiary stub category", "type": "wiki-page-name", "description": "A tertiary category into which this stub template puts pages." }, "tempsort": { "label": "Stub category sort prefix", "description": "If set to a value other than 'no', a prefix for sorting pages in the category." }, "tempsort#": { "label": "Tertiary stub category sort prefix", "description": "If set to a value other than 'no', a prefix for sorting pages in the tertiary category." } } } </templatedata>

See also

Template:Mbox templates see also