Template:Quality mask/doc

From Wikibooks, open books for an open world
Jump to navigation Jump to search

This template is designed for use in WikiProject banners, and provides an easy way to construct a bespoke class mask. The class parameter must be passed to the template as the first unnamed parameter.

Implementation in Template:WPBannerMeta[edit source]

The template provides the default classification masks for a WikiProject's quality scales, and is also used by the majority of projects which use a custom quality mask. It can be used in two different ways:

  • with |QUALITY_SCALE=subpage and placed on the /quality subpage of the WikiProject's banner template. In this case, specific guidance on how the template works with the chosen parameters is displayed on this page.
  • with |QUALITY_SCALE=inline and placed directly inside the quality parameter. However this method is not suitable for projects which use either of the following:

Use on subpages[edit source]

When used on a /quality subpage (e.g. with |QUALITY_SCALE=subpage) the template should be called in the following way:

{{quality mask<noinclude>/templatepage</noinclude> | {{{quality|}}}
 |topic=
 |optional parameters
}}

This allows the /templatepage to be displayed which provides useful documentation and category prompts on the subpage.

  • the topic parameter defines the main naming scheme of the assessment categories used by the project and is used to check the existence of the categories that are required. For example, if your project uses categories such as Category:B-Class mathematics pages, etc. then set |topic=mathematics.
    • if the template uses taskforces, parameters topic1, topic2, topic3, topic4 and topic5 can be used to check for the necessary categories.

Neither of the above are required for the |QUALITY_SCALE=inline version.

Inline use[edit source]

When used "inline" (e.g. with |QUALITY_SCALE=inline), the call to /templatepage and the topic parameters are not required, and the template should be called in the following way:

{{quality mask | {{{quality|}}} | optional parameters }}

Bear in mind that if the banner uses any hooks, you will need to set the options each time quality is used. Therefore the subpage method may be more useful in these cases.

Optional parameters[edit source]

  • FQS - if set to "yes", switches on the following additional classifications. Individual classifications may then be switched off by setting their respective lowercase parameters (see below) to "no".
    • Project
    • Category
    • Subject
    • Template
  • forceNB - if set to "yes", will automatically classify pages tagged as |quality=NB depending on the namespace of the page. The default setting is "no".

The lowercase parameter syntax[edit source]

Add a classification in lowercase as the name of a parameter followed by the value "yes". For example

|project=yes

would add the Project-classification. This is the simplest way of adding a classification but has the following two limitations:

  • The name of the classification must have an initial capital letter and all following letters in lowercase. In other words, the capitalization must be of the form Xxxxxx.
  • It is not possible to use this method to add a shortcut or alternative alias for a different classification, for example "Sub" for Subject-class.

If either of these are required, the upperclass parameter syntax must be used (see below).

If |FQS=yes is used, then a value of "no" may be used to switch off that individual classification. Thus

{{quality mask|{{{quality|}}}
 |topic=physics
 |FQS=yes
 |subject=no
}}

would support all of the additional classifications listed above except Subject-class.

The UPPERCASE parameter syntax[edit source]

Add a classification in uppercase as the name of a parameter followed by the exact name of the classification (including the required case) as the value of the parameter. For example

|SL=SL

would add SL-class and

|CHEESECAKE=CheeseCake

would add CheeseCake-class.

You can use this method to add a shortcut or alias for a classification. For example

|bplus = yes
|B+ = Bplus

would have the effect that an input of either B+ or Bplus would result in Bplus-class.

Example 1: subpage[edit source]

The following code is placed in the banner template:

|QUALITY_SCALE = subpage
 |quality = {{{quality|}}}

and on the /quality subpage, the following code is used:

{{quality mask<noinclude>/templatepage</noinclude> | {{{quality|}}}
 |topic=Zimbabwe
 |FQS=yes
 |redirect=yes
}}

In this case all of the "extended" quality classifications are used, plus the additional Redirect-class. Because the |topic= parameter is set, specific documentation will be displayed on the /quality subpage.

Example 2: inline[edit source]

The following code is placed in the banner template:

|QUALITY_SCALE = inline
 |quality = {{quality mask | {{{quality|}}} | category=yes }}

Now the standard quality classifications are used, plus the additional Category-class.

Subtemplates[edit source]

See also[edit source]