Extension:PageTriage

From MediaWiki.org
Jump to: navigation, search

Other languages:
català • ‎Deutsch • ‎English • ‎español • ‎suomi • ‎français • ‎italiano • ‎日本語 • ‎polski • ‎português • ‎português do Brasil • ‎sicilianu • ‎中文
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
PageTriage

Release status:Extension status stable

PagesFeedInfoFlyout.png
ImplementationTemplate:Extension#type Special page, User interface
DescriptionTemplate:Extension#description Facilitates reviewing and approving new pages
Author(s)Template:Extension#username Ryan Kaldari, Benny Situ
MediaWikiTemplate:Extension#mediawiki 1.27+ . PageTriage master should only be used with core's master; otherwise, use matching branches (e.g. PageTriage REL1_27 with core REL1_27, or matching WMF release branches).
Database changesTemplate:Extension#needs-updatephp Yes
LicenseTemplate:Extension#license MIT License
Download
ExampleTemplate:Extension#example Special:NewPagesFeed on the English Wikipedia
Hooks usedTemplate:Extension#hook
LoadExtensionSchemaUpdatesManual:Hooks/LoadExtensionSchemaUpdates
SpecialMovepageAfterMoveManual:Hooks/SpecialMovepageAfterMove
NewRevisionFromEditCompleteManual:Hooks/NewRevisionFromEditComplete
ArticleInsertCompleteManual:Hooks/ArticleInsertComplete
ArticleSaveCompleteManual:Hooks/ArticleSaveComplete
UnitTestsListManual:Hooks/UnitTestsList
GetPreferencesManual:Hooks/GetPreferences
ArticleViewFooterManual:Hooks/ArticleViewFooter
ArticleDeleteCompleteManual:Hooks/ArticleDeleteComplete
MarkPatrolledCompleteManual:Hooks/MarkPatrolledComplete
BlockIpCompleteManual:Hooks/BlockIpComplete
ResourceLoaderGetConfigVarsManual:Hooks/ResourceLoaderGetConfigVars
BeforeCreateEchoEventManual:Hooks/BeforeCreateEchoEvent
EchoGetDefaultNotifiedUsers

Translate the PageTriage extension if it is available at translatewiki.net

Check usage and version matrix.

IssuesPhabricator

Open tasks · Report a bug

PageTriage is an extension that aims to provide a feature-rich interface for triaging newly-created articles. It is intended to replace the new page patrol core function while adding additional functionality for reviewing, tagging, and improving new articles. It adds a Special:NewPagesFeed page, and a page curation toolbar to new pages for those with the 'patrol' permission. It was developed by the Wikimedia Foundation's Features Engineering team. For additional details see Page Curation.

An important note is that some of the configuration and code is specific to the English-language Wikipedia's workflows and as it's constructed now the extension is pretty much impossible to internationalize. (See Phabricator:T50552.)

Download[edit source]

The extension can be retrieved directly from Git [?]:

  • Browse code
  • Some extensions have tags for stable releases.
  • Each branch is associated with a past MediaWiki release. There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).

Extract the snapshot and place it in the extensions/PageTriage/ directory of your MediaWiki installation.

If you are familiar with git and have shell access to your server, you can also obtain the extension as follows:

cd extensions/
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/PageTriage.git

Installation[edit source]

  • Download and place the file(s) in a directory called PageTriage in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/PageTriage/PageTriage.php";
    
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To actually see the extension working:

The new page should appear, flagged as "No categories", "Orphan", etc. To see the page curation toolbar:

  • Login as a user with the 'sysop' permission, or add a group with the "patrol" permission, and add some user to that group, and login as that user.
  • Visit Special:NewPagesFeed
  • Now you should see a "Review" button next to the new page.
  • Click this and you should see the page curation toolbar on the new page.

Extension configuration[edit source]

The extension is based on the 'patrol' right. For more information about configuring patrolling, see Manual:PatrollingManual:Patrolling.

The following configuration variables can be set from your LocalSettings.php file:

  • $wgPageTriageEnableCurationToolbar: Set to false to disable the curation toolbar (default is true)
  • $wgPageTriageInfiniteScrolling: Whether or not to use infinite scrolling in the new pages feed (default is true)
  • $wgPageTriageNoIndexUnreviewedNewArticles: Set this to true if new, unreviewed articles should be set to noindex. In other words, if they should not be indexed by search engines until they are reviewed. (default is false)

See PageTriage.php for the full list of config variables.

On-wiki configuration[edit source]

It is possible to configure much of PageTriage on-wiki via the pages MediaWiki:PageTriageExternalDeletionTagsOptions.js and MediaWiki:PageTriageExternalTagsOptions.js, although the structure of the configuration may change in the future (to better accommodate wikis besides English Wikipedia).

You can get a general idea of how the configuration works by looking at the following:

Toolbar section Default file English Wikipedia customization
Curation Bar Icon Add Tags Blue.png Add tags modules/ext.pageTriage.defaultTagsOptions/ext.pageTriage.defaultTagsOptions.js en:MediaWiki:PageTriageExternalTagsOptions.js
Curation Bar Icon Trash Blue.png Nominate for deletion modules/ext.pageTriage.defaultDeletionTagsOptions/ext.pageTriage.defaultDeletionTagsOptions.js en:MediaWiki:PageTriageExternalDeletionTagsOptions.js

Both of these files operate in much the same way.

There are two top-level jQuery variables that define the curation templates that are listed in the curation toolbar under the Curation Bar Icon Add Tags Blue.png (add tags) and Curation Bar Icon Trash Blue.png (nominate for deletion) buttons. These are:

$.pageTriageTagsOptions = {};
$.pageTriageDeletionTagsOptions = { Main: {}, User: {} };

The 'Main' and 'User' refer to the namespace of the page being curated. Each sub-item in the three sets above defines the tabs shown at the left side of the toolbar, and has the following form:

{
    label: 'Short title',
    desc: 'A longer description.', // Text only, no HTML or Wikitext markup
    multiple: false, // Whether more than one of the tags can selected at once.
    tags: { tag1 = {}, tag2 = {} }
}

Then the actual templates that are listed are defined under the above tags variable. Each deletion template has the following form:

{
    tag: 'Actual_template_name', // Without the 'Template:' prefix.
    label: 'Friendly template title',
    desc: 'A longer description.', // Text only, no HTML or Wikitext markup
    code: '',
    params: {},
    anchor: '',
    talkpagenotiftopictitle: 'message-name', // The message name (e.g. pagetriage-del-tags-speedy-deletion-nomination-notify-topic-title) used as the section/topic title when posting to the editing user's talk page.  Usually, you can reuse one of the existing messages (currently pagetriage-del-tags-speedy-deletion-nomination-notify-topic-title, pagetriage-del-tags-prod-notify-topic-title, pagetriage-del-tags-xfd-notify-topic-title).  If you need a new one, file a task so $wgPageTriageDeletionTagsOptionsContentLanguageMessages or the PageTriage repository can be updated.
    talkpagenotiftpl: 'Template_name' // The template that will be added to the editing user's talk page, not including the talk page heading (handled by talkpagenotiftopictitle).
}

At the moment, some tags must be present:

  1. $.pageTriageDeletionTagsOptions.Main.xfd.tags.articlefordeletion

Example[edit source]

So, if you don't want to use any of the built-in deletion templates (which can be imported from NewPagesFeed_Templates.xml, by the way) then you can replace them all with a single one by adding the following at the bottom of your MediaWiki:PageTriageExternalDeletionTagsOptions.js page:

var deletionSection = {
    label: 'Deletion',
    desc: 'Nominate for deletion.',
    multiple: false,
    tags: {
        articlefordeletion: {
            tag: 'delete',
            label: 'Delete',
            desc: 'Nominate this page for deletion.',
            code: '',
            params: {},
            anchor: '',
            talkpagenotiftopictitle: 'pagetriage-del-tags-xfd-notify-topic-title',
            talkpagenotiftpl: 'Deletion notification'
        }
    }
};
$.pageTriageDeletionTagsOptions = { Main: { xfd: deletionSection }, User: { xfd: deletionSection } };


API[edit source]

PageTriage adds 5 API endpoints which can be used:

  • api.php?action=pagetriagestats
  • api.php?action=pagetriageaction
  • api.php?action=pagetriagelist
  • api.php?action=pagetriagetagging
  • api.php?action=pagetriagetemplate

See also[edit source]