Release status: stable
|Description||Enables the designation of disambiguation pages with a magic word|
|Author(s)||Ryan Kaldari (Kaldaritalk)|
Translate the Disambiguator extension if possible
|Check usage and version matrix; code metrics|
|Bugs: list open list all report|
The Disambiguator extension is designed to make disambiguation pages easier to work with programmatically. It allows you to designate all disambiguation pages with the __DISAMBIG__ magic word (or an equivalent alias), which then marks them as such in the database. This allows other extensions to handle disambiguation pages as a separate class of page.
Installation[edit | edit source]
- Download and extract the files in a directory called
extensions/folder. If you're a developer and this extension is in a Git repository, then instead you should clone the repository.
- Add the following code at the bottom of your LocalSettings.php:
require_once( "$IP/extensions/Disambiguator/Disambiguator.php" );
- Done – Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.
Usage[edit | edit source]
Once Disambiguator is installed, the best way to use it is to add the __DISAMBIG__ magic word to a template that is then included in all of your disambiguation pages.
Once the magic word is in place, your disambiguation pages will all have the 'disambiguation' page property assigned to them in the database. This property resides in the page_props table.
You will also have two new special pages:
- Special:DisambiguationPages, which lists all the disambiguation pages on your wiki.
- Special:DisambiguationPageLinks, which lists all of the pages on your wiki that link to disambiguation pages. (This is a replacement for the old Special:Disambiguations page which is deprecated.)
API usage[edit | edit source]
To list all the disambiguation pages:
To list all the disambiguation page links:
Note that on wikis running in MiserMode (all WMF wikis), both the special page and API interface for DisambiguationPageLinks are limited to a certain number of results (typically 1000–5000).
To see if an individual page is a disambiguation page:
If it is a disambiguation page it will include 'disambiguation' in its pageprops. Note that the disambiguation pageprop, if present, will have its value set to an empty string, so be careful about testing it as a boolean.
Possible future plans[edit | edit source]
- Add an option to color code links to disambiguation pages
- Remove disambiguation pages from Special:Random (bug #7937) and Special:LonelyPages (bug #3483)
- Add an option to hide disambiguation pages from Special:AllPages (bug #7936), Special:PrefixIndex (bug #9319) and Special:WhatLinksHere (bug #7935)
- Consider extending link dialog in editor with ability to detect disambigs in search results and pull a list of links
- Complete list of bugs for this extension
|This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page.|