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 optionally handle disambiguation pages as a separate class of page, although they are still considered "normal" pages.
Disambiguator
folder to your extensions/
directory.cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Disambiguator
wfLoadExtension( 'Disambiguator' );
The following configuration variables can be set from your LocalSettings.php
file.
Disambiguator provides the following features:
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 :
To list all the disambiguation pages:
api.php?action=query&list=querypage&qppage=DisambiguationPages
To list all the disambiguation page links:
api.php?action=query&list=querypage&qppage=DisambiguationPageLinks
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:
api.php?action=query&titles=Bug&prop=pageprops&ppprop=disambiguation
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.
For wikis with Scribunto installed, Disambiguator adds a isDisambiguationPage
property to mw.title objects.
To see if an individual page is a disambiguation page, check the page_props
table for the presence of a pp_propname = 'disambiguation'
. Pages that are not disambiguation pages will not have this pp_propname
. The pp_value
isn't important.
SELECT page_title, pp_propname FROM page LEFT JOIN page_props ON pp_page = page_id AND pp_propname = 'disambiguation' WHERE page_namespace = 0 AND page_title IN ('John', 'COVID-19') -- John is a disambiguation page on enwiki, COVID-19 is notPossible future plans[edit]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4