Koha ILS

Setting up the Koha Coverflow Plugin

In an earlier post Kyle showcased the functionality of his coverflow plugin. Since then it has become one of the most requested plugins on our partner’s sites. The plugin is very easy to setup and get going and provides a great amount of flexibility. In this post I want to highlight some of the things the plugin can do and some of the options for setting it up.

The three main things to decide are:

  1. What items the coverflow should show
  2. Where the coverflow should be placed
  3. How many coverflows you want

Choosing the items to display:

Kyle’s post mentions that the plugin chooses covers based on a report created in the Koha reports module. The standard report we use chooses 7 items acquired in the past 30 days:

[code language=”sql” wraplines=”true” toolbar=”true”]
SELECT b.biblionumber, SUBSTRING_INDEX(m.isbn, ‘ ‘, 1) AS isbn, b.title
FROM items i
LEFT JOIN biblioitems m USING (biblioitemnumber)
LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber)
WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= i.dateaccessioned AND m.isbn IS NOT NULL AND m.isbn != ”
ORDER BY rand()
LIMIT 7
[/code]

That report can be easily tweaked to select only items from given shelving locations, collection codes, etc.

At this time the plugin cannot look up covers by UPC, so we usually weed out things like DVDs that might not have an ISBN

Another option is to handpick the titles by adding them to a list, we then point the report to pull form that list:

[code language=”sql” wraplines=”true” toolbar=”true”]
SELECT biblionumber, SUBSTRING_INDEX(isbn, ‘ ‘, 1) AS isbn, title
FROM virtualshelfcontents
LEFT JOIN biblio USING (biblionumber)
LEFT JOIN biblioitems USING (biblionumber)
WHERE shelfnumber=2673
[/code]

This gives the ability to add or remove items whenever you wish, and create custom coverflows by topic (Summer reading, holiday themed, what have you)

Another advantage to using lists is that the coverflow can’t currently exclude items without covers. What we can do is replace the generic ‘Cover Image Not Available’ with a custom image for you library, lists allow you to simply remove titles that have no cover

Note that with whatever option you choose you can have the results ordered or random and you can display as many or few items as you wish (though too many might impact performance)

Where to display:

Generally the plugin goes in the OpacMainUserBlock, either above or below other content: http://demo.bywatersolutions.com/

There are other options though, SWITCH splits the main user block and pushes the coverflow off to the side: https://topcat.switchinc.org/

You can put the coverflow into any HTML area of Koha, it can be used in a footer and displayed on every page throughout the OPAC.

Multiple Coverflows:

Another option available is to choose to have several coverflows active on your site. You can see on CIN’s website that hey have several deifferent coverflows, it also highlights the flexibility of the reports that can be created (and you can see their custom ‘loading’ image): http://cin.bywatersolutions.com/

HMCPL libraries also wanted multiple coverflows, but rather than displaying them all at once, they setup a dropdown menu to allow selection of coverflows by topic: http://catalog.hmcpl.org/.

The first example is done simply by choosing more reports, adding them to the plugin configuration, and adding html divs for the coverflows as explained in Kyle’s post. The second example uses custom js to change the coverflows. It requires setting up one coverflow in the plugin and then adding the code below:

In opacuserjs:

[code language=”javascript” wraplines=”true” toolbar=”true”]
//Allow for coverflow dropdown change
$(‘#cfdrop’).change( function(){
$(‘.cfw’).hide();
var foo = this.value;
if ( !$(‘#cf’+foo+’ .flip-content’).length ) {
$.getScript(‘/plugin/Koha/Plugin/Com/ByWaterSolutions/CoverFlow/jquery-flipster/src/js/jquery.flipster.min.js’,function(data,textStatus,jqxhr){$(‘#cflow’+foo).load(‘/coverflow.pl?id=’+foo,function(){$(‘.coverTest img’).on(‘load’,function(){if(this.naturalHeight==1){$(this).attr(‘src’,’http://media.bywatersolutions.com/Model/NoImage.png’);}});var opt={‘items’:’.item’,’minfactor’:15,’distribution’:1.5,’scalethreshold’:0,’staticbelowthreshold’:false,’titleclass’:’itemTitle’,’selectedclass’:’selectedItem’,’scrollactive’:true,’step’:{‘limit’:4,’width’:10,’scale’:true}};$(‘#cflow’+foo).flipster({buttons:’true’,style:’coverflow’,});});
});//END OF getscript
} //END OF if
$(‘#cf’ + foo).show();
}); //END OF change function
[/code]

In OpacMainUserBlock:

[code language=”html” wraplines=”true” toolbar=”true”]
<select id=’cfdrop’>
<option value=’432′>New York Times Best Sellers Fiction</option>
<option value=’433′>New York Times Best Sellers Nonfiction</option>
<option value=’436′>New Science Fiction Titles</option>
<option value=’437′>New Graphic Novel Titles</option>
<option value=’434′>New Young Adult Titles</option>
<option value=’435′>New Picture Book Titles</option>
<option value=’472′>June is Audiobook Month</option>
<option value=’464′>Downloadable Project Gutenberg e-books</option>
</select>
[/code]

Those are the main current features and abilities, but let us know what you are looking for and we can see what can be done, or what might be a good development to fund t improve the coverflow for all. I look forward to hearing what other ways people have used the coverflow, or what creative things you ask us to do next.

There is also a current patch in the works to build the coverflow in to Koha, so make sure to add comments there and let the developers know what features you want to see brought over and where you might like to see improvements: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10756

One last note, the coverflow has had some upgrades, the current version is 2.1 – this includes a fix for unicode characters in titles displayed so make sure to get the new version or ask for an upgrade if you are using an earlier version. https://github.com/bywatersolutions/koha-plugin-coverflow

Read more by Nick Clemens

Tags opac tutorial