Jump to content


From mediawiki.org

MediaWiki 1.28.0 and later


According to RFC "Future of magic links" ISBNs will no longer be linking automatically to Special:BookSources by default. Templates like {{ISBN}} should be used instead to create the respective links. To restore the automatic linking use configuration parameter $wgEnableMagicLinks .

Customizing the search via ISBN on Special:BookSources did not change in 1.28.0 and later; thus, customizing continues to work as described below for MediaWiki 1.20.0 to 1.27.x.

MediaWiki 1.20.0 to 1.27.x


To customize Special:BookSources, edit the page "Book sources" (not done on this wiki) in the project namespace as defined with configuration parameter $wgMetaNamespace, e.g. "Project:Book sources" or the equivalent page name as defined by system message MediaWiki:Booksources.

In the wikitext of page "Project:Book sources", use the MAGICNUMBER variable wherever you want the ISBN to be included. For instance, to link to an Amazon.com search by ISBN, enter this wikitext:

[https://www.amazon.com/s?search-alias=stripbooks&field-keywords=MAGICNUMBER Amazon.com]

For an example, see Wikipedia:Book sources.

MediaWiki 1.16.0 to 1.19.x


Mediawiki recognizes inline ISBNs; for example: the wikitext ISBN 0-12-345678-9 becomes ISBN 0-12-345678-9 (the dashes are optional), which corresponds to Special:Booksources/0123456789. This is a link to a special booksource page, generated on-the-fly by the script includes/specials/SpecialBook/SpecialBooksources.php. You can influence the appearance of that generated page by putting your custom text into the pages

  • MediaWiki:Booksources
  • MediaWiki:Booksources-text
  • MediaWiki:Booksources-search-legend‎
  • MediaWiki:Booksources-go‎

Sadly, however, this only changes the text on the page, but not the list of shops. That shop list currently comes hard-coded from the file languages/messages/MessagesXXX.php, where XXX is the current language of your Wiki. For example, the default Mediawiki installation in MessagesEn.php assigns:

$bookstoreList = array(
	'AddALL'         => 'http://www.addall.com/New/Partner.cgi?query=$1&type=ISBN',
	'PriceSCAN'      => 'http://www.pricescan.com/books/bookDetail.asp?isbn=$1',
	'Barnes & Noble' => 'http://search.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=$1',
	'Amazon.com'     => 'http://www.amazon.com/exec/obidos/ISBN=$1'

And there sadly is no possibility to override this in LocalSettings.php. It would already be better if the above assignment would be done only if LocalSettings.php has not already assigned a value. The only 2 ways to currently change that list are:

  1. You patch that file directly with your custom shop list.
  2. You patch that file a little to only assign that value when LocalSettings.php has not done so already.

Both changes sadly will be overwritten with your next MediaWiki software upgrade. For Germany, this could for example be changed to

bookstoreList = array(
	'amazon.de'  => 'http://www.amazon.de/s/ref=nb_sb_noss?field-keywords=$1',
	'amazon.com' => 'http://www.amazon.com/s/ref=nb_sb_noss?field-keywords=$1',
	'thalia.de'  => 'http://www.thalia.de/shop/tha_homestartseite/suche/?sswg=ANY&sq=$1'


Further reading


See also: Markup spec/BNF/Magic links#ISBN numbers