Template:WPBannerMeta

Revision as of 22:51, 3 February 2009 by Budlight (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:WPBannerMeta/core

[edit] Template-info.svg Template documentation

WPBannerMeta is a meta-template which can be used to create WikiProject banners, enabling new projects to easily create a banner to place on article talk pages, and ensuring standardisation between projects. While some WikiProjects, such as WikiProject Biography and WikiProject Military History, have extremely complicated banners which could not be easily converted into a meta-format, most small- to medium-sized projects may benefit from the quick setup that a meta-template provides.

A list of all WikiProject banners using this meta-template can be found here.

Syntax

Common parameters
{{WPBannerMeta
|PROJECT             = 
 |BANNER_NAME        = {{subst:FULLPAGENAME}}
 |small={{{small|}}}
 |category={{{category|¬}}}
 |listas={{{listas|}}}
|IMAGE_LEFT          = 
 |IMAGE_LEFT_SMALL   = 
 |IMAGE_LEFT_LARGE   = 
|QUALITY_SCALE       = 
 |class={{{class|}}}
 |FULL_QUALITY_SCALE = 
 |AUTO_ASSESS        = 
  |auto={{{auto|}}}
|IMPORTANCE_SCALE    = 
 |importance={{{importance|}}}
|ASSESSMENT_CAT      = 
|ASSESSMENT_LINK     = 
|MAIN_TEXT           = 
|MAIN_ARTICLE        = 
|PORTAL              = 
|PORTAL_IMG          = 
|MAIN_CAT            = 
|attention={{{attention|}}}
 |ATTENTION_CAT      = 
|infobox={{{needs-infobox|}}}
 |INFOBOX_CAT        = 
|COMMENTS            = 
 |COMMENT_CAT        = 
 |COMMENT_FORCE      = 
}}<noinclude>
{{documentation}}
</noinclude>

WPBannerMeta can be used at varying levels of complexity, from the very simple to the extremely complicated. Simple options are listed here first, with complexity increasing down the page.

WPBannerMeta takes two different types of parameters: formatting parameters and display parameters. The formatting parameters customise the meta-template for a particular project, defining link targets, categories, images and text. All formatting parameters use UPPERCASE and underscores (_) instead of spaces (|PROJECT=, |NOTE_1_CAT=, etc). Display parameters customise the template output for each individual article the banner is displayed on. These are the parameters which are entered on the talk page (|class=, |importance=, etc), and they must be 'passed through' the project banner to the meta-template underneath. To 'pass' the parameter foo, you need to include the code foo={{{foo|}}}.

In the examples below, a WikiProject banner will be constructed for the (currently) nonexistent WikiProject Tulips.

Simple options

  • PROJECT (Required) – the name of the WikiProject. Used in a variety of contexts; first letter should usually be capitalised. Eg: Tulips
    • small (Required) – the size parameter must be passed through the template to enable the correct display. Eg: small={{{small|}}}
    • category (Required) – the 'category' parameter must be passed through the template to enable category optout. Eg: category={{{category|¬}}}.
    • listas (Required) – the 'listas' parameter must be passed through the template. Eg: listas={{{listas|}}}
    • BANNER_NAME={{subst:FULLPAGENAME}} (Required) – the full page name of the banner.
  • PROJECT_LINK – it is assumed that the WikiProject is located at "Wikipedia:WikiProject <PROJECT>". If this is not the case, define the full link to the project pages in this parameter. Eg: Wikipedia:WikiProject Tulips
  • IMAGE_LEFT – the location of an image to use in the top-left corner of the banner. Do not include the Image: prefix. Images used on WikiProject banners must be free images - fair use images are not permitted. Eg: Tulip - floriade canberra.jpg
    • IMAGE_LEFT_LARGE – the size of IMAGE_LEFT in normal display. Default is 60px. Eg: 50px
    • IMAGE_LEFT_SMALL – the size of IMAGE_LEFT when the banner is displayed 'small style'. Default is 30px. Eg: 50px
  • IMAGE_RIGHT – the location of an image to use in the top-right corner of the banner. Do not include the Image: prefix. Images used on WikiProject banners must be free images - fair use images are not permitted. Eg: Tulip - floriade canberra.jpg
    • IMAGE_RIGHT_LARGE – the size of IMAGE_RIGHT in normal display. Default is 60px. Eg: 50px
    • IMAGE_RIGHT_SMALL – the size of IMAGE_RIGHT when the banner is displayed 'small style'. Default is 30px. Eg: 50px
  • MAIN_TEXT – the default text is "This article is within the scope of the [[{{{PROJECT} }} WikiProject]], a collaborative effort to improve the coverage of {{{PROJECT}}} articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the project and see a list of open tasks." An alternative message can be defined with this parameter.
    • MAIN_ARTICLE – alternatively, the article linked to can be set using this parameter. Accepts either a raw article title, or more complicated text. Eg: tulips"...the coverage of tulips on Wikipedia..." / [[tulips]], [[liliaceae]] and related articles"...the coverage of tulips, liliaceae and related articles on Wikipedia..."
  • PORTAL – if the WikiProject maintains a portal, define this parameter with the portal name. Eg: Tulips
    • PORTAL_IMG – the default 'puzzle-piece' image for the portal template can be overridden with this parameter. Eg: Icon tools.png to use Image:Icon tools.png
  • MAIN_CAT – if defined, all pages displaying the template will be sorted into this category. Eg: WikiProject Tulips articles → Category:WikiProject Tulips articles
  • BOTTOM_TEXT – if defined, contains text that will appear across the bottom of the banner (but above the collapsible section, if one is present). Please do not use this parameter to 'hook' extra code to the bottom of the template – see below for a better solution.


Example
{{WPBannerMeta
|PROJECT          = Tulips
 |small  = {{{small|}}}
 |category={{{category|¬}}}
 |listas = {{{listas|}}}
|PROJECT_LINK     = Wikipedia:Somewhere about tulips
|IMAGE_LEFT       = Tulip - floriade canberra.jpg
|IMAGE_LEFT_LARGE = 50px
|PORTAL           = Tulips
}}
Produces:
Template:WPBannerMeta/core

Assessment

Many projects use the Wikipedia 1.0 Assessment criteria to grade their articles by quality. Some projects also use the importance scale to place their articles in order of priority. In order to use the Wikipedia 1.0 assessment system, which uses a bot to automatically compile statistics tables, you need to follow the instructions at Wikipedia:Version 1.0 Editorial Team/Using the bot as well as those here.

  • QUALITY_SCALE – if defined, enables the 'standard' quality scale (FA, A, GA, B, Start, Stub, NA). Eg: yes
    • class (Required) – the class parameter must be passed through if the quality scale is used. Eg: class={{{class|}}}
    • FULL_QUALITY_SCALE – if defined, enables an 'extended' quality scale including definitions for templates, categories, disambiguation pages and redirects.
    • AUTO_ASSESS – if defined, allows use of the |auto= parameter. Projects which use bots to automatically categorise articles as stubs if they include a stub template can have the bot add |auto=yes to the project banner, which triggers the display of a small notice that the article was tagged by a bot rather than a human. Eg: yes
      • auto (Required) – the auto parameter must be passed through if AUTO_ASSESS is used. Eg: auto={{{auto|}}}
    • B_CHECKLIST – if defined, this parameter enables the use of a B-Class checklist similar to that used by the Military History wikiproject. There are six criteria which must be met (see the official descriptions); the pass/fail state of the article with respect to each criteria is passed as the parameters |b1= to |b6=. It is only possible to assess an article as B-Class when all six criteria are met; otherwise, it will be assessed as C-Class.
      • b# – the six B-Class criteria must be passed through if the B-Class checklist is used.
        • The standard parameters must be passed through as an alternative to any custom ones, eg: b1={{{B-Class-1|{{{b1|}}}}}}, etc.
        • If only the standard parameters are used, then eg: b1={{{b1|}}}, etc. is fine.
  • IMPORTANCE_SCALE – if defined, enables the standard importance scale (Top, Mid, Low, None). Eg: yes
    • importance (Required) – the importance parameter must be passed through if the importance scale is used. Eg: importance={{{importance|}}}
  • ASSESSMENT_LINK – it is assumed that the assessment department of the WikiProject is located at PROJECTLINK/Assessment. If this is not the case, a direct link can be defined with this parameter. Eg: Wikipedia:WikiProject Tulips/Article grading
  • ASSESSMENT_CAT – articles are sorted into categories based on their quality; so eg Featured Tulip articles would be categorised by default into Category:FA-Class Tulip articles. If this parameter is defined, Featured articles would instead be categorised into Category:FA-Class ASSESSMENT_CAT. Eg: Liliaceae articles → Category:FA-Class Liliaceae articles
  • COMMENTS – some projects use a subpage of the article talk page to post brief comments on the article or their assessment of it. If these comments are placed at {{FULLPAGENAME}}/Comments, then this parameter can be used to automatically display a note in the banner if such comments exist, or a request to add them if they don't already. Eg: yes
    • COMMENT_CAT – if this parameter is defined, articles which have comments are sorted into this category. By default, these pages are categorised into PROJECT articles with comments. Eg: Tulip articles with comments → Category:Tulip articles with comments
    • COMMENT_FORCE – by default, if a comments subpage does not exist, no message is displayed. If this parameter is defined, then a message will be displayed requesting viewers to create the comment subpage. Eg: yes
Example
{{WPBannerMeta
|PROJECT          = Tulips
 |small  = {{{small|}}}
 |category={{{category|¬}}}
 |listas = {{{listas|}}}
|IMAGE_LEFT       = Tulip - floriade canberra.jpg
|QUALITY_SCALE    = yes
 |class  = {{{class|}}}
|IMPORTANCE_SCALE = yes
 |importance = {{{importance|}}}
|ASSESSMENT_LINK  = Wikipedia:WikiProject Tulips/Article grading
}}
Produces:
Template:WPBannerMeta/core

Alerts and notes

Built in to WPBannerMeta is the ability to display a number of other fields to contain useful information about the article, or the task-forces to which it is affiliated. There is also a predefined 'attention' field to flag articles in need of immediate attention, and a 'needs infobox' field for flagging articles in need of an infobox.

  • attention – pass this parameter through to enable the use of the attention note. Eg: attention={{{attention|}}}
    • ATTENTION_CAT – if defined, all articles displaying the attention note will be categorised into Category:ATTENTION_CAT. By default, they are categorised into Category:PROJECT articles needing attention. Eg: Tulip taskforce hotlist → Category:Tulip taskforce hotlist
  • infobox – pass this parameter through to enable the use of the needs-infobox note. Eg: infobox={{{needs-infobox|}}}
    • INFOBOX_CAT – if defined, all articles displaying the needs-infobox note will be categorised into Category:INFOBOX_CAT. By default, they are categorised into Category:PROJECT articles needing infoboxes. Eg: Tulip taskforce hotlist → Category:Tulip taskforce hotlist
  • note 1 – pass this parameter through to trigger the note. By using the code Eg: note 1={{{needs-picture|}}}, then by including |needs-picture=yes on the article talk page, note 1 (which is about a picture being required) is triggered.
    • NOTE_1_TEXT (Required) – the text of note 1.
    • NOTE_1_IMAGE – an image can be defined for each note. Remember that all images must be free, not fair-use. Eg: Nuvola apps ksnapshot.png
    • NOTE_1_FORMAT – optional formatting (colour, etc) for the table cell which contains the image, if any, for the note. Eg: style="background:purple"
    • NOTE_1_CAT – if defined, adds all talk pages where the note is displayed to the category Category:NOTE_1_CAT. Eg: Tulip articles needing images → Category:Tulip articles needing images
Example
{{WPBannerMeta
|PROJECT          = Tulips
 |small  = {{{small|}}}
 |category={{{category|¬}}}
 |listas = {{{listas|}}}
|IMAGE_LEFT       = Tulip - floriade canberra.jpg
|QUALITY_SCALE    = yes
 |class  = {{{class|}}}
|note 1 = {{{audio-file|}}}
 |NOTE_1_TEXT     = An audio file has been created of this article.
 |NOTE_1_IMAGE    = Nuvola apps arts.png
 |NOTE_1_CAT      = Tulip articles with audio files
}}
Produces:
Template:WPBannerMeta/core

Collapsed section

WPBannerMeta includes the ability to create a collapsed section at the bottom of the template, which can be opened by clicking a "show" link. The collapsed section can contain notes in a similar style to the uncollapsed section described above. The collapsible section only appears when one of the notes is triggered.

  • COLLAPSED_HEAD – the default title for the collapsible section is "More information:"; an alternative title can be defined here
  • c note 1 – pass this parameter through to enable the collapsible note. By using the code Eg: c note 1={{{needs-picture|}}}, then by including |needs-picture=yes on the article talk page, collapsible note 1 (which is about a picture being required) is triggered.
    • C_NOTE_1_TEXT (Required) – the text of note 1.
    • C_NOTE_1_IMAGE – an image can be defined for each collapsible note. Remember that all images must be free, not fair-use. Eg: Nuvola apps ksnapshot.png
    • C_NOTE_1_FORMAT – optional formatting (colour, etc) for the table cell which contains the image, if any, for the collapsible note. Eg: style="background:purple"
    • C_NOTE_1_CAT – if defined, adds all talk pages where the collapsible note is displayed to the category Category:NOTE_1_CAT. Eg: Tulip articles needing images → Category:Tulip articles needing images

To add a To-Do list, you might want to look at an example over at the todo list hook page.

Example
{{WPBannerMeta
|PROJECT          = Tulips
 |small  = {{{small|}}}
 |category={{{category|¬}}}
 |listas = {{{listas|}}}
|IMAGE_LEFT       = Tulip - floriade canberra.jpg
|QUALITY_SCALE    = yes
 |class  = {{{class|}}}
|c note 1 = {{{audio-file|}}}
 |C_NOTE_1_TEXT   = An audio file has been created of this article.
 |C_NOTE_1_IMAGE  = Nuvola apps arts.png
 |C_NOTE_1_CAT    = Tulip articles with audio files
}}
Produces:
Template:WPBannerMeta/core

Taskforces

WPBannerMeta can accommodate up to five task forces, each with its own image, links and importance scale, if desired. The following parameters are available:

  • tf 1 – this parameter triggers the display of the taskforce, so it must be passed through to enable the taskforce section. Eg: tf 1={{{floridiae|}}}
    • TF_1_LINK – the full pagename of the taksforce's main page. Eg: Wikipedia:WikiProject Tulips/Taskforces/Floridiae
    • TF_1_NAME – the way the taskforce will appear in its piped link. Redundant when |TF_1_TEXT= is used. Eg: the Floridiae taksforce
    • TF_1_NESTED – if defined, a link of the form "/ [[{{{TF_1_LINK}}}|{{{TF_1_NESTED}}}]]" is added after the main project's name when the banner is collapsed using |nested=yes. Eg: Floridiae
    • TF_1_TEXT (Required) – if defined, replaces the default "This page is supported by..." text. Eg: This page is within the scope of the [[Wikipedia:WikiProject Tulips/Taskforces/Floridiae|Floridiae taksforce]]. New memebers are always welcome!
    • TF_1_IMAGE – an image can be defined for each taksforce. Remember that all images must be free, not fair-use. Eg: Nuvola apps ksnapshot.png
      • TF_1_SIZE – the size of the image used can be defined here; the default is 30px. Using a size greater than |IMAGE_LEFT_LARGE= will produce some... interesting... results. Eg: 40px
    • TF_1_QUALITY – if defined, enables the quality categorisations for the main project (eg Category:FA-Class Tulip articles) to be duplicated for the taskforce. The options given in |class= and |FULL_QUALITY_SCALE= will be re-used; it is not possible to use a parameter like |floridiae-class=. Requires |QUALITY_SCALE=. Eg: yes
    • TF_1_IMPORTANCE – if defined, enables the use of a separate importance scale for the taskforce. Does not require |IMPORTANCE_SCALE=. Eg: yes
      • tf 1 importance (Required) – if the separate importance scale is used, this parameter must be passed. Eg: tf 1 importance={{{floridiae-importance|}}}
      • TF_1_ASSESSMENT_CAT (Required) – the assessment category to be used for the taskforce-specific quality and importance assessments. Identical in syntax to |ASSESSMENT_CAT=. Eg: Floridiae articles → Category:FA-Class Floridiae articles
    • TF_1_MAIN_CAT – if defined, all pages displaying this taskforce will be sorted into this category. Eg: Floridiae articles → Category:Floridiae articles
Example
{{WPBannerMeta
|PROJECT          = Tulips
 |small  = {{{small|}}}
 |category={{{category|¬}}}
 |listas = {{{listas|}}}
|IMAGE_LEFT       = Tulip - floriade canberra.jpg
|QUALITY_SCALE    = yes
 |class  = {{{class|}}}
|tf 1 = {{{floridiae|}}}
 |TF_1_LINK       = Wikipedia:Wikiproject Tulips/Taskforces/Floridiae
 |TF_1_NAME       = the Floridiae taskforce
 |TF_1_NESTED     = Floridiae
 |TF_1_IMAGE      = Tulipa florenskyi 4.jpg
 |TF_1_IMPORTANCE = yes
  |tf 1 importance={{{floridiae-importance}}}
  |TF_1_ASSESSMENT_CAT=Floridiae articles
}}
Produces:
 This article is within the scope of the following WikiProjects:
Template:WPBannerMeta/core

Advanced features

Hooks

See Template:WPBannerMeta/hooks for more details

WPBannerMeta incorporates a number of 'hooks' where advanced or customised features can be added. These should take the form of a subtemplate passed to the relevant hook parameter. Any relevant parameters should then be passed to the hook template – it may be necessary to repeat parameters that are already passed to the main template (|category={{{category|¬}}} and |class={{{class|}}} are commonly used). If you write a hook that you think other projects could use, please copy or move it to a subpage of Template:WPBannerMeta/hooks and add it to the list on that page.

Custom masks

See Template:WPBannerMeta/class for more details

WPBannerMeta uses a mask to normalise the values given to the |class= parameter, to ensure that invalid inputs are discarded (eg |class=cheesecake) and that equivalent inputs appear the same (eg |class=FA and |class=fA). This mask effectivley controls which extended assessment scale values are accepted by the template (eg "Template-Class", "Redirect-Class", etc). Projects which want to use more obscure assessment classes (eg "Future-Class", "Bplus-Class", etc) or to not use all of the standard classes (eg not using "C-Class") can define their own custom mask, which will override WPBannerMeta's default.

Other details

The meta-template automatically categorises all instances (ie specific project banners) into Category:WikiProject banners. It is not necessary to include a category link in the documentation for each project banner.

Normal project banners which are substituted rather than transcluded, usually show up in Category:WikiProject banners, allowing for a periodic cleanout. Banners using WPBannerMeta do not appear in this category when substituted, making it easier for them to get lost.

To reduce the byte-count of banners which do not make full use of WPBannerMeta's features, most of the optional features are broken out into subpages:

See also

  • Template:B – a convenience tool for frequent users of {{WPBannerMeta}}'s B_CHECKLIST and b1 through b6 features