Template:WPBannerMeta/doc

WPBannerMeta is a meta-template, which can be used to create WikiProject banners, enabling new projects to easily create a banner to place on book talk pages, ensuring standardization between projects. A list of all WikiProject banners using this meta-template can be found at What links here: WPBannerMeta

Syntax
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 and display. 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 (eg.  and  ). Display parameters customize the template output for each individual page that the banner is displayed on. These are the parameters which are entered on the talk page (, , etc.) and they must be 'passed through' the project banner to the meta-template underneath. To 'pass' the parameter, you need to include the code.

In the examples below, a WikiProject banner will be constructed for the WikiProject Languages.

Simple options

 * (Required) – the name of the project without the word "WikiProject", used in a variety of contexts; first letter should usually be capitalized. Eg:
 * – this allows the template to detect if it has been substituted instead of transcluded and give an error message.  
 * (Required) – the size parameter must be passed through the template to enable the correct display. Eg:
 * (Required) – the 'category' parameter must be passed through the template to enable category optout. Eg:  .
 * (Required) – the 'listas' parameter must be passed through the template. Eg:
 * ' (Required)'' – the full page name of the banner. Eg:
 * – it is assumed that the project is located at  . If this is not the case, then define the full link to the project page in this parameter. Eg:
 * – the location of an image to use in the top-left corner of the banner. Do not include the "File:" prefix. Images used on WikiProject banners must be free images – fair use images are not permitted. Eg:
 * – the size of, when the banner is displayed in 'small style'. Default is 40px. Eg:
 * – the size of  in normal display. Default is 80px. Eg:
 * – the location of an image to use in the top-right corner of the banner. Do not include the "File:" prefix. Images used on WikiProject banners must be free images – fair use images are not permitted. Eg:
 * – the size of, when the banner is displayed in 'small style'. Default is 40px. Eg:
 * – the size of  in normal display. Default is 80px. Eg:
 * – the default text is "This page is within the scope of  WikiProject , a collaborative effort to improve the coverage of    books on Wikibooks. If you would like to participate, please visit the project page, where you can join the  Talk:  discussion and see a list of open tasks." If defined, the alternate message will be displayed.
 * – the default above is ; alternatively, the linked page can be changed to either a raw book title or more complicated text. Eg: (default)   &rarr; "...the coverage of languages on Wikibooks..." or (alternate)   &rarr; "...the coverage of language pages on Wikibooks..."
 * – if the WikiProject maintains a subject page, define this parameter with the subject name. Eg:
 * – the default is no main category created; if defined, all pages displaying the template will be sorted into Category: . Eg:  → Category:WikiProject Languages pages
 * – if defined, contains text that will appear across the bottom of the banner and above the collapsed section (if one is present). Please do not use this parameter to 'hook' extra code to the bottom of the template – see the hooks section below for a better solution.


 * Example


 * Produces:

Assessment
Many projects use an assessment schema to grade their pages by quality and a corresponding priority scale to place their pages in order of priority.
 * (Required)– the quality parameter must be passed through, if the quality scale is used. Eg:
 * – configures the quality scale; possible options are:
 * standard – enables the 'standard' quality scale (FB, A, B, C, Start, Stub, NB). (This is the default behavior, if the quality parameter is used.)
 * extended – enables the 'standard' quality scale plus some additional values (Category, Subject, Project and Template).
 * inline – allows for a simple custom quality scale to be used, generally used with Quality mask.
 * subpage – allows for a more complex custom quality scale to be used using a subpage called /quality. See custom masks below for further details.
 * – if defined, enables the standard priority scale (Top, High, Mid, Low, NB, Unknown). Eg:
 * – if defined, enables the standard importance scale (Top, High, Mid, Low, NB, Unknown). Eg:  Only one of the priority/importance parameters should be used.
 * – configures the priority/importance scale, if used. The possible options are:
 * standard – enables the 'standard' priority scale (Top, High, Mid, Low, Bottom, NB and Unknown). (This is the default behavior.)
 * inline – allows for a simple custom priority or importance scale to be defined, generally with Priority mask.
 * subpage – allows for a more complex custom priority/importance scale to be used using a subpage called /priority.
 * – the link to a WikiProject-specific quality (and/or priority) scale. If there is a page at   then this will be used by default. To override this, you can set this parameter to no.
 * – pages are sorted into categories based on their quality; so pages in featured books on languages would be categorized by default into Category:FB-quality languages pages. If this parameter is defined, featured pages would instead be categorized into Category:FB-quality . Eg:   → Category:FB-quality language pages
 * – some projects may want to use a subpage of the page's talk page to post brief, assessment-related comments about the page. If these comments are placed in a " " subpage, then this parameter will cause the banner to automatically display. Eg:
 * – if this parameter is defined, pages which have comments are sorted into Category: . By default, these pages are categorized into Category: PROJECT pages with comments. Eg: (alternate)  → Category:Language pages with comments. A value of   results in no categorization.


 * Example
 * Produces:

Alerts and notes
Built into WPBannerMeta is the ability to display a number of other fields that contain useful information about the page. There are also three predefined fields for: The parameters are:
 * 1) pages in need of immediate attention;
 * 2) pages in need of an |infobox.
 * – pass this parameter through to enable the use of the attention note. Eg:, then by including   on the talk page.
 * – if defined, all pages displaying the attention note will be categorized into Category: . By default, they are categorized into Category: pages needing attention. Eg:   → Category:Language pages needing attention. A value of   results in no categorization.
 * – pass this parameter through to enable the use of the needs-infobox note. Eg:, then by including   on the talk page.
 * – if defined, all pages displaying the needs-infobox note will be categorized into Category: . By default, they are categorized into Category: pages needing infoboxes. Eg:   → Category:Language pages needing infoboxes. A value of   results in no categorization.
 * – pass this parameter through to trigger any defined note. Eg:, then by including   on the talk page. Up to ten notes can be specified in the core banner.
 * – the text of note 1. Eg: This page needs a sound bite from a native speaker. If this is left blank there is no visual output.
 * – an image can be defined for each note. Remember that all images must be free, not fair-use. Eg:
 * – optional formatting (color, etc.) for the table cell which contains the image, if any, for the note. Eg:
 * – if defined, all pages displaying note 1 will be categorized into Category: . Eg:  → Category:Language pages needing sound bites
 * – when more than a threshold number of notes and alerts are triggered on a page, they are automagically collapsed into a show/hide box. The threshold number can be customized by setting this parameter to the maximum number of notes on a page that will not trigger the collapse.  The default is 3, so if three notes are triggered on a page, they will not be collapsed, but if a fourth is also triggered, the collapse box appears.  So setting 0 will always create a collapse box (if there are any notes to fill it), while 999 will never trigger a collapse box. See also the /notecounter hook. Eg:
 * – the size of the image used for the icons. (It is recommended to precede the size with "x" as this specifies the height of the image instead of the width, which results in a neater banner because all rows have equal height.) The default is a height of 25px. Eg:


 * Example


 * Produces:

Task forces
WPBannerMeta can accommodate up to five task forces, each with its own image, links and importance scale, if desired. The following parameters are available:
 * – this parameter must be passed through to enable and trigger the display of the task force section. Eg:
 * – the full page name of the task force's project page. Eg:
 * – the way the task force's name will appear in its piped link; redundant when TF_1_TEXT is used. Eg:
 * – if defined, a link of the form "/ | " is added after the main project's name when the banner is collapsed inside a WikiProjectBannerShell. Eg:
 * – if defined, replaces the default "This page is supported by..." text. Eg:   If defined to be "none", then no output will be displayed, although appropriate categories will still be added.
 * – an image can be defined for each task force. Remember that all images must be free, not fair-use. Eg:
 * – if defined, enables the quality categorizations for the main project (eg: Category:FB-quality language pages) to be duplicated for the task force. The quality arising from quality and QUALITY_SCALE will be used; Eg:
 * – if defined, enables the use of a separate priority (or importance, if used) scale for the task force.Eg:
 * (Required if quality or priority assessments are used) – the assessment category to be used for the task force-specific quality and priority assessments. Identical in syntax to ASSESSMENT_CAT. Eg:  → Category:FB-quality French language pages
 * – if defined, all pages displaying "tf 1" will be categorized into Category: . Eg:  → Category:French language pages
 * – the size of the taskforce icons. (It is recommended to precede the size with "x" as this specifies the height of the image instead of the width, which results in a neater banner because all rows have equal height.) The default is a height of 25px. Eg:


 * Example
 * Produces:

Hooks
WPBannerMeta incorporates a number of 'hooks' where advanced or customized 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 and quality 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
WPBannerMeta uses a mask to normalize the values given to the quality parameter, to ensure that invalid inputs are discarded (e.g. cheesecake) and that equivalent inputs appear the same (eg FB and fB). This mask effectively controls which extended assessment scale values are accepted by the template (eg "Template-quality", "Project-quality", etc). Projects which want to use more obscure assessment qualities or to not use all of the standard qualities (e.g. not using "C-quality") can define their own custom mask, which will override WPBannerMeta's default.

Other details
This meta-template automatically categorizes all instances (i.e. specific project banners) into a subcategory of Category:WikiProject banners. It is not necessary to include a category link in the documentation for each project banner.

The core WPBannerMeta template:
 * /core

To reduce the byte-count of banners that do not make full use of WPBannerMeta's features, most of the optional features are broken out into subpages:
 * /comments – the message which is displayed when yes is defined.
 * /doc – the documentation you are now reading.
 * /priorityscale – the priority classification system.
 * /priority – used in conjunction with Template:Priority mask to normalize the value of the priority parameter.
 * /istemplate – tests the type of the current page (i.e. book talk page, templatepage, or demonstration).
 * /locwarning – warns when the banner template is used on a non-talk page.
 * /substwarning – warns when a banner template is substituted.
 * /note – an individual note.
 * /taskforce – the code for each task force display.
 * /templatepage – the categories and notes that only appear on the template page.
 * /qualityscale – the quality classification system.
 * /quality – used in conjunction with Template:Quality mask to normalize the quality input.