Setting up the Koha Coverflow Plugin (Bywater Solutions)

Coverflow plugin allows you to display new arrival books of your koha library system. The plugin is developed by Bywater solution

Downloading

From the release page you can download the relevant *.kpz file

Installing

Koha's Plugin System allows for you to add additional tools and reports to Koha that are specific to your library. Plugins are installed by uploading KPZ ( Koha Plugin Zip ) packages. A KPZ file is just a zip file containing the perl files, template files, and any other files necessary to make the plugin work.


First you will need to turn on the koha plugin system

Open the koha-config.xml file

sudo vim /etc/koha/sites/library/koha-conf.xml

Change <enable_plugins>0<enable_plugins> to 

<enable_plugins>1</enable_plugins> in your koha-conf.xml file

Confirm that the path to <pluginsdir> exists, in my case the path is  <pluginsdir>/var/lib/koha/library/plugins</pluginsdir>

Restart web server and memcached

sudo systemctl restart apache2 memcached

Once set up is complete you will need to alter your UseKohaPlugins system preference. On the Tools page you will see the Tools Plugins and on the Reports page you will see the Reports Plugins.

Setup

Once the plugin is installed you can find it under Admin->Manage plugins, currently the coverflow is neither a tool or report plugin, you can also select 'Show all plugins' after following the 'Plugins' link in reports or tools


The steps to get your coverflow to show up are as follows:


Generate a public report

First, you need to create one or more public reports for your coverflow widget or widgets to be based on. This is how the plugin knows what the content of your widget should contain. Each report needs only three columns; title, biblionumber, and isbn. It is important that you have a good and valid isbn, as that is the datum used to actually fetch the cover. Example finding items added in the last 30 days:


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 != ''
  GROUP BY biblionumber
  HAVING isbn != ""
  ORDER BY rand()
  LIMIT 30



Note: You can add an additional column 'localcover' - this should be blank if the biblio doesn't have a localcover and can contain any other data if it does. If this column is populated a local cover will be used. Example below:

SELECT DISTINCT biblio.title, biblio.biblionumber,  SUBSTRING_INDEX(biblioitems.isbn, ' ', 1) AS isbn, c.imagenumber AS localcover
FROM items
LEFT JOIN biblioitems USING (biblioitemnumber)
LEFT JOIN biblio ON (items.biblionumber=biblio.biblionumber)
LEFT JOIN biblioimages c ON (items.biblionumber=c.biblionumber)
WHERE biblioitems.isbn IS NOT NULL AND biblioitems.isbn !=''
ORDER  BY RAND()
LIMIT  15



Configure the plugin

---
- id: 5
  selector: "#coverflow"
  options:
  style: coverflow
- id: 6
  selector: ".coverflow_class"
  options:
  style: flat

 Here id: 5 is the public report that we created


 

Now go to Koha Global System Preference and in OpacMainUserBlock add the following html tag

<b><h2><center><u><font color="red">New Arrivals</font></h2></b></u>

<span id="coverflow">Loading...</span></center>

Now check you OPAC page to view the coverflow.

 

 

Reference: https://github.com/bywatersolutions/koha-plugin-coverflow

0 Komentar