Difference between revisions of "Template:Class mask/doc"

From blackwiki
Jump to navigation Jump to search
imported>Chiefwei
m (interwiki)
imported>MSGJ
(update)
Line 9: Line 9:
 
**the [[Template:WPBannerMeta/hooks/taskforces|taskforce hook]].
 
**the [[Template:WPBannerMeta/hooks/taskforces|taskforce hook]].
  
=== Syntax ===
+
Typically this template should be placed on the /class subpage of a WikiProject banner template. There are two compulsory parameters, plus the optional parameters which control the class mask.
Typically this template should be placed on the /class subpage of a WikiProject banner template.
+
 
 +
=== Required parameters ===
 +
* The first unnamed parameter should be <code><nowiki>{{{class|}}}</nowiki></code>.
 +
* ''topic'' - this parameter defines the main naming scheme of the assessment categories used by the project. For example, if your project uses categories such as [[:Category:B-Class mathematics articles]], etc. then set {{para|topic|mathematics}}. This parameter is used to check the existence of the categories that are required.
 +
 
 +
=== Optional parameters ===
 +
* ''FQS'' - if set to "yes", switches on the following six additional classes. Individual classes may then be switched off by their respective lowercase parameters (see below) to "no".
 +
** Category
 +
** Disambig
 +
** Image
 +
** Portal
 +
** Template
 +
** Project
 +
* ''forceNA'' - if set to "yes", will automatically classify pages tagged as {{para|class|NA}} depending on the namespace of the page. The default setting is "no".
 +
* ''b'' - if the B-class checklist is used, this parameter must be passed through.
 +
 
 +
=== The lowercase parameter syntax ===
 +
Add a class in '''lowercase''' as the name of a parameter followed by the value "yes". For example
 +
<pre>|redirect=yes</pre>
 +
would add the Redirect-class. This is the simplest way of adding a class but has the following two limitations:
 +
* The name of the class must have an initial capital letter and all following letters in lowercase. In other words, the capitalisation must be of the form Xxxxxx.
 +
* It is not possible to use this method to add a shortcut or alternative alias for a different class, for example "Cur" for Current-class.
 +
If either of these are required, the upperclass parameter syntax must be used (see below).
 +
 
 +
If {{para|FQS|yes}} is used, then a value of "no" may be used to switch off that individual class. Thus
 
<pre>{{class mask|{{{class|}}}
 
<pre>{{class mask|{{{class|}}}
  |topic=
+
  |topic=physics
  |FQS=
+
  |FQS=yes
|forceNA=
+
  |portal=no
|b={{{b|B}}}
 
|category=
 
|disambig=
 
  |portal=
 
|redirect=
 
|template=
 
|project=
 
|future=
 
|current=
 
|needed=
 
|merge=
 
 
}}</pre>
 
}}</pre>
 +
would support all of the six additional classes listed above ''except'' Portal-class.
 +
 +
=== The UPPERCASE parameter syntax ===
 +
Add a class in '''uppercase''' as the name of a parameter followed by the ''exact name'' of the class (including the required case) as the value of the parameter. For example
 +
<pre>|SL=SL</pre>
 +
would add SL-class and
 +
<pre>|CHEESECAKE=CheeseCake</pre>
 +
would add CheeseCake-class.
  
=== Parameters ===
+
You can use this method to add a shortcut or alias for a class. For example
* ''topic'' - set this parameter so that the documentation on the /class subpage links to the WikiProject's quality categories, e.g. if your quality categories are of the form [[:Category:B-Class mathematics articles]], etc. then set {{para|topic|mathematics}}.
+
<pre>|blpus = yes
* ''class'' - this parameter must be passed as the first unnamed parameter in all cases.
+
|B+ = Bplus</pre>
* ''FQS'' - if set to "yes", switches on the six additional classes Category, Disambig, Image, Portal, Template & Project. Individual classes may then be switched off by their respective parameters to "no".
+
would have the effect that an input of either B+ or Bplus would result in Bplus-class.
* ''forceNA'' - if set to "yes", will automatically classify pages tagged as {{para|class|NA}} depending on the namespace of the page. The default setting is "no".
 
* ''category'', ''disambig'', ''portal'', ''redirect'', ''template'', ''project'', ''future'', ''current'', ''needed'', ''merge'' - if set to "yes", enables this quality class. The default for each is "no", unless ''FQS'' is set.
 
* ''b'' - if the B-class checklist is used, this parameter must be passed through.
 
  
 
=== Example 1: subpage ===
 
=== Example 1: subpage ===

Revision as of 23:13, 23 November 2009


This template is used by Template:WPBannerMeta to provide the default class masks for WikiProject's quality scales. It also allows the easy implementation of customised class masks for WikiProject bannersm, and is suitable for projects which require a slightly different mask to the default one, and can be used in two different ways:

  • with |QUALITY_SCALE=subpage and placed on the /class 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 class parameter. However this method is not suitable for projects which use either of the following:

Typically this template should be placed on the /class subpage of a WikiProject banner template. There are two compulsory parameters, plus the optional parameters which control the class mask.

Required parameters

  • The first unnamed parameter should be {{{class|}}}.
  • topic - this parameter defines the main naming scheme of the assessment categories used by the project. For example, if your project uses categories such as Category:B-Class mathematics articles, etc. then set |topic=mathematics. This parameter is used to check the existence of the categories that are required.

Optional parameters

  • FQS - if set to "yes", switches on the following six additional classes. Individual classes may then be switched off by their respective lowercase parameters (see below) to "no".
    • Category
    • Disambig
    • Image
    • Portal
    • Template
    • Project
  • forceNA - if set to "yes", will automatically classify pages tagged as |class=NA depending on the namespace of the page. The default setting is "no".
  • b - if the B-class checklist is used, this parameter must be passed through.

The lowercase parameter syntax

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

|redirect=yes

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

  • The name of the class must have an initial capital letter and all following letters in lowercase. In other words, the capitalisation must be of the form Xxxxxx.
  • It is not possible to use this method to add a shortcut or alternative alias for a different class, for example "Cur" for Current-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 class. Thus

{{class mask|{{{class|}}}
 |topic=physics
 |FQS=yes
 |portal=no
}}

would support all of the six additional classes listed above except Portal-class.

The UPPERCASE parameter syntax

Add a class in uppercase as the name of a parameter followed by the exact name of the class (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 class. For example

|blpus = yes
|B+ = Bplus

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

Example 1: subpage

The following code is placed in the banner template:

|QUALITY_SCALE = subpage
 |class = {{{class|}}}

and on the /class subpage (for example Template:WikiProject Zimbabwe uses the subpage Template:WikiProject Zimbabwe/class), the following code is used:

{{class mask | {{{class|}}}
 |topic=Zimbabwe
 |FQS=yes
 |redirect=yes
}}

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

Example 2: inline

The following code is placed in the banner template:

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

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

  • Reminder: this method is not suitable is the template uses the B-class checklist or the taskforce hook.

Subpages

Uses

  • This shows all /class subpages which use this template.