Wikipedia:WikiProject Council/Guide/Technical notes
From Wikipedia, the free encyclopedia
Contents |
[edit] Advanced project banners
As a WikiProject grows and adopts various processes, it becomes necessary for its project banner template to do more than merely marking an article as being within the project's scope. For example, article assessments and peer reviews all generate metadata about an article; the most obvious place to store and display such information is in the banner of the relevant project.
Browsing through Category:WikiProject banners shows that there are a variety of different optional features that are added to banners by various projects, This section aims to present an annotated example banner that, while relatively simple, demonstrates the most common and useful coding options for such templates. It is not, of course, an exhaustive overview of all the possibilities; some extremely complicated banners (such as {{WPBeatles}}, {{WPMILHIST}}, or {{WPBiography}}) include dozens of optional fields and other advanced features, and projects that need them are advised to peruse existing banners for ideas. The case presented here, however, should be sufficient for the majority of WikiProjects, at least initially.
The banner is constructed for the hypothetical Tulips WikiProject, and includes a number of features:
- Variable-size display
- Article assessment support, including auto-assessments
- A show/hide block for additional fields
- Optional fields for a peer review department
The code for the banner is given below, followed by an annotated explanation of how each feature is implemented:
{| class="messagebox {{#ifeq:{{{small|}}}|yes|small-talk|standard-talk}}" |- | [[Image:Tulip-blossom.jpg|{{#ifeq:{{{small|}}}|yes|30px|45px}}]] | This {{#ifeq:{{{class|}}}|NA|non-article page|article}} is within the scope of the '''[[Wikipedia:WikiProject Tulips|Tulips WikiProject]]'''. {{#ifeq:{{{small|}}}|yes||If you would like to participate, please visit the project page, where you can join the project and see a list of open tasks.}} |- {{#if:{{{class|}}} | {{#ifeq:{{{class|}}}|NA| {{!}} {{{{{class}}}-Class}} {{!}} This page is not an article and does not require a [[Wikipedia:WikiProject Tulips/Assessment|rating]]. | {{!}} {{{{{class}}}-Class|category={{{class}}}-Class tulips articles}} {{!}} This article has been [[Wikipedia:WikiProject Tulips/Assessment|rated]] as {{{class}}}-Class on the [[Wikipedia:WikiProject Tulips/Assessment#Quality scale|quality scale]]. }} | {{!}} {{-Class}} {{!}} This article has not yet [[Wikipedia:WikiProject Tulips/Assessment|received a rating]] on the [[Wikipedia:WikiProject Tulips/Assessment#Quality scale|quality scale]]. }} |- {{#ifeq:{{{class|}}}|Stub| {{#ifeq:{{{auto|}}}|yes| {{!}} style="background: red;" {{!}} [[Image:Diamond-caution.svg|18x18px|center]] {{!}} This article has been ''automatically'' rated as '''Stub-Class''' because it uses a [[Wikipedia:Stub|stub template]]. * If you '''agree''' with the assessment, please remove <code>{{!}}auto=yes</code> from this template. * If you '''disagree''' with the assessment, please change it by editing the <code>{{!}}class=</code> parameter in this template and removing the stub template from the article.<includeonly>[[Category:Automatically assessed tulips articles|{{PAGENAME}}]]</includeonly> }} }} |- {{#if:{{{peer-review|}}} {{{old-peer-review|}}}| {{!}} colspan="2" {{!}} {{{!}} class="collapsible collapsed" style="width: 100%; background: transparent;" {{!}}- ! colspan="2" style="text-align: left;" {{!}} More information: {{!}}- {{!}} style="width: 43px;" {{!}} {{!}} {{!}}- {{#ifeq:{{{peer-review|}}}|yes| {{!}} style="background: gainsboro;" align="center" {{!}} '''[[Wikipedia:WikiProject Tulips/Peer review|PEER]]''' {{!}} This {{#ifeq:{{{class|}}}|NA|page|article}} is [[Wikipedia:WikiProject Tulips/Peer review/{{ARTICLESPACE}}{{PAGENAME}}|currently]] being [[Wikipedia:WikiProject Tulips/Peer review|peer reviewed]].<includeonly>[[Category:Requests for tulips peer review|{{PAGENAME}}]]</includeonly> }} {{!}}- {{#ifeq:{{{old-peer-review|}}}|yes| {{!}} style="background: gainsboro;" align="center" {{!}} '''[[Wikipedia:WikiProject Tulips/Peer review|PEER]]''' {{!}} This {{#ifeq:{{{class|}}}|NA|page|article}} has had a [[Wikipedia:WikiProject Tulips/Peer review|peer review]] which is now [[Wikipedia:WikiProject Tulips/Peer review/{{ARTICLESPACE}}{{PAGENAME}}|archived]].<includeonly>[[Category:Old requests for tulips peer review|{{PAGENAME}}]]</includeonly> }} {{!}}} }} |}<includeonly>{{#switch:{{{class}}} |FA=[[Category:FA-Class tulips articles|{{PAGENAME}}]] |A=[[Category:A-Class tulips articles|{{PAGENAME}}]] |GA=[[Category:GA-Class tulips articles|{{PAGENAME}}]] |B=[[Category:B-Class tulips articles|{{PAGENAME}}]] |Start |start=[[Category:Start-Class tulips articles|{{PAGENAME}}]] |Stub |stub=[[Category:Stub-Class tulips articles|{{PAGENAME}}]] |NA = [[Category:Non-article tulips pages|{{PAGENAME}}]] |#default=[[Category:Unassessed tulips articles|{{PAGENAME}}]] }}</includeonly>
[edit] Basic framework
{| class="messagebox {{#ifeq:{{{small|}}}|yes|small-talk|standard-talk}}" ... |}
The basic framework of the banner is a table that uses one of two CSS classes, depending on the value of the small
parameter. Normally, the banner is shown with class="messagebox standard-talk"
(which displays a full-size banner across the top of the talk page) set; when the banner is included with small=yes
, however, it uses class="messagebox small-talk"
, which displays it at a smaller size, floating on the right margin.
|- | [[Image:Tulip-blossom.jpg|{{#ifeq:{{{small|}}}|yes|30px|45px}}]] | This {{#ifeq:{{{class|}}}|NA|non-article page|article}} is within the scope of the '''[[Wikipedia:WikiProject Tulips|Tulips WikiProject]]'''. {{#ifeq:{{{small|}}}|yes||If you would like to participate, please visit the project page, where you can join the project and see a list of open tasks.}}
The familiar main message of the banner has been enhanced by making some of the text only display in the full-size banner, and changing the term used for the page when a non-article rating (see below) is selected.
[edit] Assessment support
Support for article assessments is typically implemented in two parts: code within the body of the banner to display the assessment, and code outside it to add the needed categories. While it's possible to combine the two, this often results in less readable code.
|- {{#if:{{{class|}}} | {{#ifeq:{{{class|}}}|NA| {{!}} {{{{{class}}}-Class}} {{!}} This page is not an article and does not require a [[Wikipedia:WikiProject Tulips/Assessment|rating]]. | {{!}} {{{{{class}}}-Class|category={{{class}}}-Class tulips articles}} {{!}} This article has been [[Wikipedia:WikiProject Tulips/Assessment|rated]] as {{{class}}}-Class on the [[Wikipedia:WikiProject Tulips/Assessment#Quality scale|quality scale]]. }} | {{!}} {{-Class}} {{!}} This article has not yet [[Wikipedia:WikiProject Tulips/Assessment|received a rating]] on the [[Wikipedia:WikiProject Tulips/Assessment#Quality scale|quality scale]]. }} |- {{#ifeq:{{{class|}}}|Stub| {{#ifeq:{{{auto|}}}|yes| {{!}} style="background: red;" {{!}} [[Image:Diamond-caution.svg|18x18px|center]] {{!}} This article has been ''automatically'' rated as '''Stub-Class''' because it uses a [[Wikipedia:Stub|stub template]]. * If you '''agree''' with the assessment, please remove <code>{{!}}auto=yes</code> from this template. * If you '''disagree''' with the assessment, please change it by editing the <code>{{!}}class=</code> parameter in this template and removing the stub template from the article.<includeonly>[[Category:Automatically assessed tulips articles|{{PAGENAME}}]]</includeonly> }} }}
The in-banner code checks the class
parameter and displays one of three lines, depending on whether the parameter's value is a non-article assessment (NA
), an article assessment, or blank. If the value indicates that the article has been rated as "Stub-Class", and the auto
parameter is set to yes
, another line is shown, indicating that the article has been automatically assessed and providing instructions on changing the assessment.
<includeonly>{{#switch:{{{class}}} |FA=[[Category:FA-Class tulips articles|{{PAGENAME}}]] |A=[[Category:A-Class tulips articles|{{PAGENAME}}]] |GA=[[Category:GA-Class tulips articles|{{PAGENAME}}]] |B=[[Category:B-Class tulips articles|{{PAGENAME}}]] |Start |start=[[Category:Start-Class tulips articles|{{PAGENAME}}]] |Stub |stub=[[Category:Stub-Class tulips articles|{{PAGENAME}}]] |NA = [[Category:Non-article tulips pages|{{PAGENAME}}]] |#default=[[Category:Unassessed tulips articles|{{PAGENAME}}]] }}</includeonly>
The out-of-banner code is a #switch
statement that adds the appropriate category based on which value is selected for the class
parameter.
[edit] Show/hide blocks
|- {{#if:{{{peer-review|}}} {{{old-peer-review|}}}| {{!}} colspan="2" {{!}} {{{!}} class="collapsible collapsed" style="width: 100%; background: transparent;" {{!}}- ! colspan="2" style="text-align: left;" {{!}} More information: {{!}}- {{!}} style="width: 43px;" {{!}} {{!}} ... {{!}}} }}
The optional fields of the banner are enclosed within a table that acts as a show/hide block, only displaying the output of the optional fields when the [show] button is clicked by a user. The #if
statement at the top lists all the possible optional fields; if none of them are given values, the show/hide block will not appear at all. If additional fields are added to the banner, they should be copied into the list as well.
[edit] Optional fields
{{!}}- {{#ifeq:{{{peer-review|}}}|yes| {{!}} style="background: gainsboro;" align="center" {{!}} '''[[Wikipedia:WikiProject Tulips/Peer review|PEER]]''' {{!}} This {{#ifeq:{{{class|}}}|NA|page|article}} is [[Wikipedia:WikiProject Tulips/Peer review/{{ARTICLESPACE}}{{PAGENAME}}|currently]] being [[Wikipedia:WikiProject Tulips/Peer review|peer reviewed]].<includeonly>[[Category:Requests for tulips peer review|{{PAGENAME}}]]</includeonly> }} {{!}}- {{#ifeq:{{{old-peer-review|}}}|yes| {{!}} style="background: gainsboro;" align="center" {{!}} '''[[Wikipedia:WikiProject Tulips/Peer review|PEER]]''' {{!}} This {{#ifeq:{{{class|}}}|NA|page|article}} has had a [[Wikipedia:WikiProject Tulips/Peer review|peer review]] which is now [[Wikipedia:WikiProject Tulips/Peer review/{{ARTICLESPACE}}{{PAGENAME}}|archived]].<includeonly>[[Category:Old requests for tulips peer review|{{PAGENAME}}]]</includeonly> }}
There are two optional fields, peer-review
and old-peer-review
, that add support for a WikiProject peer review. Each one, when set to yes
, displays an additional row in the banner, and adds the corresponding category.
The choice of a peer review for this example is arbitrary. Any other optional fields (such as collaborations, portal queue links, etc.) can be added identically to them, merely by changing the field name, displayed text, and category name within the code.
[edit] Using the banner
The full syntax of the resulting banner when used on a talk page is:
{{WPTULIPS |class= |small= |auto= |peer-review= |old-peer-review= }}
Thus, to display a small banner on an article rated as "B-Class" with a current peer review, an editor would add
{{WPTULIPS |class=B |small=yes |peer-review=yes }}
to the talk page. It is considered polite to trim any blank fields when including the banner, as, for very complicated ones, the large number of unused fields tends to be rather messy.
[edit] Internal navigation templates
- This section discusses internal navigation templates for WIkiProjects; for navigational templates used in articles, see Wikipedia:Navigational templates.
As a WikiProject grows, it begins to acquire large numbers of subpages for various specialized purposes (such as assessment and peer review work or task forces); the largest projects can have dozens of subpages. The best way to ensure that all of these subpages can be easily located is to create a navigational template linking to them.
Most projects follow a fairly standard design for the template. It is placed as a right-floating bar, listing subpages (and usually corresponding talk pages), one per line. Here, for example, is part of the code for the navigational template used by the Lithuania WikiProject:
{| cellpadding="0" cellspacing="0" style="float: right; clear: right; border: 1px solid #aaa; padding: 5px; margin: 0em 0em 1em 1em; max-width: 300px; background: white;" ! style="background: #99FF66; padding:5px; text-align: center;" | [[Image:Lietuvos-Lithuania 5.png|left|50px]] [[Wikipedia:WikiProject Lithuania|Lithuania<br/> WikiProject]] |- | {| cellpadding="3" cellspacing="0" style="font-size: 90%; width: 100%; background: ivory;" |- style="background: #CCFF99; " ! colspan="2" style="text-align: center; border-top: 1px solid black; " | General information |- | [[Wikipedia:WikiProject Lithuania|Main project page]] | [[Wikipedia talk:WikiProject Lithuania|talk]] |- | [[Template:WikiProject Lithuania|Project banner]] | [[Template talk:WikiProject Lithuania|talk]] |- | [[Wikipedia:WikiProject Lithuania/Tips|Top 10 tips]] | [[Wikipedia talk:WikiProject Lithuania/Tips|talk]] |- | [[:Category:Extremely short Lithuania articles|Extremely short articles]] | [[Category talk:Extremely short Lithuania articles|talk]] |- ! colspan="2" style="text-align: center; border-top: 1px solid black; background: #CCFF99; " | [[Wikipedia:WikiProject Lithuania/Assessment|Assessment]] |- | [[Wikipedia:WikiProject Lithuania/Assessment/Summary|Summary]] | [[Wikipedia talk:WikiProject Lithuania/Assessment/Summary|talk]] |} |}
Another common feature for on navigational templates can be seen at the bottom of the navigational template used by the Military history WikiProject:
... |- | colspan="2" | <small class="editlink noprint plainlinksneverexpand"> [{{SERVER}}{{localurl:Template:WPMILHIST Navigation|action=edit}} edit] ยท [[Special:Recentchangeslinked/Template:WPMILHIST Navigation|changes]] </small>
The key is the "changes" link; when the template is properly constructed, Special:Recentchangeslinked can be used to view, at a glance, any changes made to any of a WikiProject's pages.
The visual layout of project navigational templates tends to vary by project, with three stripe colors, two stripe colors, or colored boxes being common.
[edit] Task list templates
[edit] {{todo}}
The simplest way of creating separate task lists is {{todo}}, which can be placed directly on any WikiProject page to generate a /to_do
subpage whose contents can be separately edited (via the "edit" link at the top right of the box); this subpage can contain an arbitrary list of tasks. One example is the subpage used by the Melbourne WikiProject. Once the subpage is created, the to-do list can be placed onto any other page using the template {{todo|target=Talk:Foo}}.
[edit] Custom templates
A more sophisticated approach is to create a separate, custom template for the WikiProject's open task list. For example, the Tulips project could create {{WikiProject Tulips Tasks}}, which could then be transcluded where needed. Common places to include the template are the project pages themselves, and sometimes inside of a show/hide block in the project banner. Interested project members can also transclude the template on their user pages.
In many cases, the premade {{tasks}} template can be used inside the custom template to efficiently organize a WikiProject's open task list:
{{tasks |requests= |copyedit= |wikify= |merge= |cleanup= |expand= |verify= |disambiguation= |stubs= |update= |npov= |other= }}
Each parameter can be filled with a list of the relevant articles for each type of work needed; for examples, see the lists maintained by the Israel and Films WikiProjects.
The open task templates can become arbitrarily complex, including features such as sub-templates for particular task forces; see, for example, the template used by the Military history WikiProject.