User:Tpt/Interproject

Here is a short proposal on how we should easily empower links between projects using Wikidata. The idea is to generate automatically a new sidebar section "Other projects" using Wikidata data as it's done for the "Other languages" section.

Current state edit

  • A lot of wikis like itwiki or frwikisource use currently a JavaScript gadget to add to there navigation bar an "Other project" section from the content of a template included in the page.
  • Wikivoyage wikis use the RelatedSites extension that creates a "Related sites" section that provides links to some other websites (Wikipedia, Open Directory...) based on interwiki links placed in the Wikitext (as example, the wikipedia link is created from the [[wikipedia:XXX]] link placed in the page).

Proposal edit

Here is a possible, but maybe not the best, solution to allows the creation of an "Other project" section based on Wikidata data that kept the retro-compatibility:

The WikibaseClient extension will provides the ability to create of the "Other project" section. This section will be configured by a list of site ids like array( 'frwiki', 'frwikisource', commonswiki', 'opendirectory' ). These siteids may be not supported by the Wikibase repository in order to allows retrocompatiblity with RelatedSites extension. For each siteid, the extension try to get the related sitelink from the Wikidata items. Then it calls an hook that allows other extensions (like the RelatedSites extension) to override values.

The section is output in html like:

<div id="p-otherprojects">
	<h3>Other project</a></h3>
	<div style="display: block;" class="body">
		<ul id="p-lang-list">
			<li class="otherproject-link otherproject-frwikisource"><a href="//fr.wikisource.org/wiki/Auteur:Test" title="Wikisource" hreflang="fr" lang="fr">Wikisource</a></li>
		</ul>
	</div>
</div>

The wb-otherprojects-SITEID i18n message is used to get the label of other project links.

The RelatedSites extension is modified to, if the WikibaseClient extension is installed and the other projects feature is activated, use the new WikibaseClient hook instead of outputting the "Related sites" section.

A new parser function, {{#setOtherProject:SITEID|LINK}} may be added to allow to customize the other project links directly in the wikitext content. If it's done the RelatedSites extension may be depreciated and removed in a long term scope.