Page MenuHomePhabricator

API module for RelatedSites extension
Closed, DeclinedPublic


There should be a prop=relatedsites module which provides a list of all the related sites.

This will be extremely useful during the Wikidata migration when trying to connect a Wikivoyage page with the Wikidata one.

For some reason the original version of the mw documentation page claims it uses the API, but I can't find anything in the code to indicate that. (

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:50 AM
bzimport set Reference to bz50414.
bzimport added a subscriber: Unknown Object (MLST).
Legoktm created this task.Jun 29 2013, 5:08 AM

Unfortunately I have no experience with the API and how to work with the Git repository so I will give at least two ideas:

(1) The API function should be similar to prop=langlinks (ll)

(2) From the public function onSkinTemplateToolboxEnd( &$skinTpl ) (at the end of RelatedSites.class.php) you can learn how to access to the stored values:

$relatedSites = $this->getCustomData()->getSkinData( $skinTpl, 'RelatedSites' );

if ( count( $relatedSites ) == 0 ) {
return true;

$relatedSitesUrls = $this->getRelatedSitesUrls( $relatedSites );

foreach ( (array) $relatedSitesUrls as $url ) {
$href = htmlspecialchars( $url['href'] );
$text = $url['text'];

Now you can check for Wikipedia and Commons. $url['text'] should contain "Wikipedia", "Wikimedia Commons" and others.

Reedy set Security to None.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 29 2015, 1:56 PM

We can probably just make this a page property instead of extension data and that automatically gets us an API.

Legoktm reopened this task as Open.Aug 2 2018, 9:38 PM

Unless the plan is to archive the extension after removing its usage on Wikimedia sites, this task is still valid.