[Koha] Linking the bibliographic record to Wikipedia

Stefano Bargioni bargioni at pusc.it
Wed Feb 12 03:42:31 NZDT 2014


Try this script in opac-detail.pl, following http://wiki.koha-community.org/wiki/JQuery_Library:

var names = $('h5.author a').not('.authlink');
for (var i=0; i < names.length; i++) {
	var name_string = $(names[i]).text(); // mostly surname, name
	var fs = name_string.split(', ');
	var H = new Array;
	H.push(' <span class="W_link">');
	H.push('<a target="_blank" href="http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search=');
	H.push(encodeURIComponent(fs[1]+' '+fs[0]));
	H.push('">[W]</a>');
	H.push('</span>');
	$(names[i]).after(H.join(''));
};

It adds a link to the right of each name. Links are searches on Wikipedia, but if the search is exact, W redirects the browser to the article.
Change [W] with an icon of your choice.
HTH. Stefano

On 09/feb/2014, Haik Zargaryan wrote:

> Dear list,
> 
> I know that koha has a feature to link the biblio record to the authority record by creating a "magnifying glass" icon near the author name. ?Once you click the icon, which is actually a link, the authority record is opened. Furthermore, you can link the authority record to Wikipedia.
> 
> I would like to know whether koha has a feature to add an icon (similar o the aforementioned one) that links the bibliographic record's authot to the respective Wikipedia article. ?If no, are there plans to develop such a feature in the future releases?
> 
> Thanks in advance,
> haik.



More information about the Koha mailing list