AutosuggestSitelink
This page is currently a draft. More information pertaining to this may be available on the talk page. Translation admins: Normally, drafts should not be marked for translation. |
AutosuggestSitelink is a gadget that suggests Wikidata items for possible linking with a Wikimedia site page, using interwiki linking. It was created by the Community Tech Wishathon, based on the Community Wishlist Survey 2022 proposal Autosuggest linking Wikidata item after creating an article. It is ultimately intended to be usable with all Wikimedia sites that can be linked with Wikidata (e.g., Wikipedia, Wikinews, Wikiquote, Wikisource, Wikivoyage, Wikibooks, and Wikimedia Commons), but has been tested only with Wikipedia.
Overview of functionality edit
As explained in Wikidata:Wikipedia and Help:Sitelinks, Wikidata sitelinks are used in the maintenance of interlanguage links, the insertion of Wikidata information into Wikipedia infoboxes, and in other ways. AutosuggestSitelink exists to facilitate the creation of these sitelinks.
AutosuggestSitelink searches Wikidata for items that might be appropriate for linking to a Wikipedia article (or other site page). The search is based on the title of the page just edited. If candidate items are found, AutosuggestSitelink allows quick creation of a new link with an item chosen by the contributor. If none are found, AutosuggestSitelink offers to provide a link allowing for the creation of a new Wikidata item.
Important: AutosuggestSitelink does not determine the appropriateness of any Wikidata item for linking to the article. Before linking to an item, it is important for the contributor to verify its appropriateness. If appropriateness cannot verified, it is better not to make the link. This is true even if AutosuggestSitelink returns just a single candidate item.
Before creating a new Wikidata item, the contributor should verify that an appropriate item does not already exist. This should be done even if AutosuggestSitelink has reported that no matches were found.
Some general guidelines for Wikidata sitelinks are given in Help:Sitelinks.
Usage edit
AutosuggestSitelink is triggered when a contributor publishes changes to a content page in a wiki (e.g. a Wikipedia article). If no changes are made (i.e. a null edit) then it is not triggered. On being triggered, the following logic is followed:
- If the article is already linked with a Wikidata item, AutosuggestSitelink does nothing.
- Otherwise, AutosuggestSitelink searches for candidate Wikidata items for linking.
- If no search matches are found, the contributor is given an opportunity to create a new Wikidata item corresponding to the article just edited. Before doing this, the contributor should determine that no such Wikidata item currently exists, as discussed above.
- If search matches are found, they are presented in a list. Before making a selection, the contributor should determine which, if any, of the listed items represents the main subject of the article, as discussed above. Once an appropriate Wikidata item has been identified in the list, the contributor can link to that item by selecting it and then clicking
Publish
.- Linking to an item is optional. If the contributor prefers not to create a link, they may simply close the dialog.
Installation edit
Installing globally (recommended) edit
- First, make sure you are registered and logged in. Only logged-in users can install user scripts.
- Click here to edit your global.js file.
- Add the following lines (This code will check if the local wiki has a gadget also named AutosuggestSitelink):
if ( mw.loader.getState( 'ext.gadget.AutosuggestSitelink' ) !== null ) { mw.loader.load( 'ext.gadget.AutosuggestSitelink' ); } else { mw.loader.load( 'https://meta.wikimedia.org/w/load.php?modules=ext.gadget.AutosuggestSitelink' ); }
- Save the page and bypass your cache to make sure the changes take effect.
Installing as a gadget edit
Individual wikis may install AutosuggestSitelink as a local gadget, but this is not yet recommended while we add finishing touches. Installing globally is always recommended for individual users, so that the tool is available on all wikis.
If you are an interface administrator and would like to install AutosuggestSitelink as a gadget on your wiki, follow these steps:
- Create
MediaWiki:Gadget-AutosuggestSitelink-local.js
with the following:mw.loader.load('https://meta.wikimedia.org/w/load.php?modules=ext.gadget.AutosuggestSitelink');
- Add the following to
MediaWiki:Gadgets-definition
:AutosuggestSitelink-local[ResourceLoader|dependencies=mediawiki.action.view.postEdit,mediawiki.ForeignApi,mediawiki.Title,oojs-ui-core,oojs-ui-windows]|AutosuggestSitelink.js
- Add a description for the gadget at
MediaWiki:Gadget-AutosuggestSitelink-local
, preferably linking to this page ([[meta:AutosuggestSitelink]]
)
Issues edit
Please report any issues either on the talk page here, or on Phabricator with the #AutosuggestSitelink project.
Contributing edit
User interface messages are stored in MediaWiki:Gadget-AutosuggestSitelink-messages and can be translated in the normal way of wiki pages.
The source code for the gadget is maintained on GitLab at gitlab:repos/commtech/autosuggest-sitelink.
See the README for more information about how to contribute.