Topic on Talk:Wikibase

Link local pages to items

2
Ash Crow (talkcontribs)

Hello, I have installed an instance of Mediawiki with both the Wikibase client and repo. I can create an item with no problem and add a link to Wikipedia or Wikidata, but I cannot find what "language code" to indicate the local Wiki (say I have a page "Hello World" that should be linked to the "Q1" on my test wiki.)

Ladsgroup (talkcontribs)

Hey, it's because the sites table is not populated to have the links to the client. I personally run eval.php and run this code:

$sites = [];
$langCode = 'en';
$site = new MediaWikiSite();
$site->setGlobalId( 'clientwiki' );
$site->setGroup( 'wikipedia' );
$site->setLanguageCode( $langCode );
$site->addInterwikiId( $langCode );
$site->addNavigationId( $langCode );
$site->setPath( MediaWikiSite::PATH_PAGE, "https://redis-dispatching-client.wmflabs.org/index.php/$1" );
$site->setPath( MediaWikiSite::PATH_FILE, "https://redis-dispatching-client.wmflabs.org/$1" );           
$sites[] = $site;
$sitesTable = SiteSQLStore::newInstance();
$sitesTable->clear();
$sitesTable->saveSites( $sites );
Reply to "Link local pages to items"