https://github.com/nyurik/osmwikibase
Wikibase customizations for OpenStreetMap
https://github.com/nyurik/osmwikibase
Last synced: about 1 month ago
JSON representation
Wikibase customizations for OpenStreetMap
- Host: GitHub
- URL: https://github.com/nyurik/osmwikibase
- Owner: nyurik
- License: mit
- Created: 2018-08-25T16:11:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-21T04:40:21.000Z (almost 2 years ago)
- Last Synced: 2025-03-07T16:09:55.428Z (about 2 months ago)
- Language: Less
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MediaWiki extension to customize the Wikibase on OSM Wiki.
* See [OSM Wikibase project info page](https://wiki.openstreetmap.org/wiki/OpenStreetMap:Wikibase)
* See [Installation instructions](https://wiki.openstreetmap.org/wiki/OpenStreetMap:Wikibase/Technical_Site_Configuration)### Implemented
- Style sitelink section to only show "other" section without the header and the edit links at at the top right, adjusted for multiple skins### Work in progress
- Overrides default ItemId to use `Y` instead of `Q` prefixThis 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.
### Custom Site object
To customize site link normalization, use `OsmWikibase\OsmSite` instead of `Site` object. This code assumes you want `wiki` as the site ID.```php
.../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 ] );
```