MediaWiki extension to customize the Wikibase on OSM Wiki.
- Style sitelink section to only show "other" section without the header and the edit links at at the top right, adjusted for multiple skins
- Overrides default ItemId to use
Y
instead ofQ
prefix
This turned out to be much more difficult than anticipated. The work has been moved to the customPrefix
branch. The proposed solution works for creating and editing items, but it breaks when a sitelink needs to be resolved into a Wikibase ID.
To customize site link normalization, use OsmWikibase\OsmSite
instead of Site
object. This code assumes you want wiki
as the site ID.
.../mediawki$ php maintenance/shell.php
>>>
$site = new OsmWikibase\OsmSite();
$site->setGlobalId( 'wiki' );
$site->setGroup( 'osm' );
$site->setPath( Site::PATH_LINK, "https://wiki.openstreetmap.org/wiki/$1" );
// If updating, make sure to keep internal ID
$store = SiteSQLStore::newInstance();
$oldSite = $store->getSite( $site->getGlobalId() );
if ( $oldSite ) $site->setInternalId( $oldSite->getInternalId() );
$store->saveSites( [ $site ] );