3

I have a local version of Wikipedia and Wikidata running. I would like to have an association between an article and wikidata object in the sidebar like in the standard installation.

But in my version, the field Wikidata item is not shown under Tool in the sitebar. What should I do in order to have that?

Edit:

Added the LocalSetting part. I can also see the toolbox and Addlink, just the wikidata link is not there

# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtensions('ExtensionName');
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'Babel' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'ParserFunctions' );
require_once "$IP/extensions/PdfExport/PdfExport.php";
wfLoadExtension( 'Poem' );
wfLoadExtension( 'Renameuser' );
wfLoadExtension( 'UniversalLanguageSelector' );
require_once "$IP/extensions/Wikibase/Wikibase.php";
wfLoadExtension( 'WikibaseQuality' );
wfLoadExtension( 'WikibaseQualityConstraints' );
wfLoadExtension( 'WikiEditor' );
#wfLoadExtension( 'Mpdf' );
wfLoadExtension( 'TextExtracts' );
#require_once("$IP/extensions/PageSummariesAPI/PageSummariesAPI.php");
# End of automatically generated settings.
# Add more configuration options below.

#Configuration to enable Wikibase client and Repo

$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = true;
require_once "$IP/extensions/Wikibase/repo/Wikibase.php";
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
require_once "$IP/extensions/Wikibase/client/WikibaseClient.php";
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";
Loredra L
  • 1,485
  • 2
  • 16
  • 32

1 Answers1

1

This feature is provided by the Wikibase Client MediaWiki extension. You can see that it is added in the extension's source code, where it is added through onBaseTemplateToolbox. According to MediaWiki's documentation, onBaseTemplateToolbox is "Called by BaseTemplate when building the toolbox array and returning it for the skin to output."

The Wikibase Client extension's documentation only mentions the other projects sidebar and I could find no information whether the Wikidata item link is created by default.

From the English Wikipedia's sidebar configuration you can see that the link resides in the TOOLBOX section, which you will need to add to your sidebar if it is not already there.

IonicSolutions
  • 2,559
  • 1
  • 18
  • 31
  • Sorry, I think you are right, but I do not understand clearly about the last step. Does it mean I should put the config somethingn like this: $wgWBClientSettings['TOOLBAR'] => array( 'wikidata' ); – Loredra L Apr 11 '19 at 16:29
  • No, that's not what I meant. You need to make sure that your *MediaWiki:Sidebar* has a `TOOLBOX` section. Otherwise, there obviously will be no *Tools* section in the sidebar. – IonicSolutions Apr 11 '19 at 16:32
  • I added some more information I found with regard to how the link ends up in the toolbox. I assume that it works right out-of-the-box if you add the Wikibase Client extension to your MediaWiki instance. If it doesn't, you should ensure that the onBaseTemplateToolbox hook of the Wikibase Client extension is registered. – IonicSolutions Apr 11 '19 at 16:36
  • I do have an toolbox section, but the wikidata link is missing from there.Might be my mistake but I think the link should be there if the wikidata object itself has the link to an article – Loredra L Apr 12 '19 at 00:24
  • Can you show the relevant part of your LocalSettings.php, where you include the WikibaseClient extension? Do you see the *Add Links* link as described [here](https://www.mediawiki.org/wiki/Wikibase/Installation#Wikibase_Client)? – IonicSolutions Apr 12 '19 at 05:22
  • I edited my question to include the information. I can see the toolbox and the addlink – Loredra L Apr 12 '19 at 08:09
  • Have you confirmed that the hook is active/configured? – IonicSolutions Apr 13 '19 at 13:40