Jump to content

Manual:ISBN

From mediawiki.org

This page describes how to handle ISBNs on your wiki and how to set up Special:BookSources for searching publications and books.

MediaWiki 1.28.0 and later

[edit]

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 the 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

[edit]

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

[edit]

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 be better if the above assignment were 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 only to assign that value when LocalSettings.php has not done so already.

Your next MediaWiki software upgrade will overwrite both changes. 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'
);

etc.

Further reading

[edit]

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