Installing the Koha Coverflow Plugin from Bywater Solutions

The Coverflow plugin, developed by Bywater Solutions, showcases new book arrivals in your Koha library system.

Downloading

Download the appropriate *.kpz file from the release page.

Installing

Koha’s Plugin System allows you to extend Koha’s functionality with tools and reports tailored to your library. Plugins are installed by uploading KPZ (Koha Plugin Zip) packages, which are zip files containing Perl files, templates, and other necessary files.

  1. Enable the Koha plugin system:

    • Open the koha-config.xml file: sudo vim /etc/koha/sites/library/koha-conf.xml
    • Change 0 to 1 in your koha-conf.xml file.
    • Confirm the plugin path exists (in this example, it’s /var/lib/koha/library/plugins).
    • Restart the web server and Memcached: sudo systemctl restart apache2 memcached koha-common
  2. Upload the plugin:

    • For Koha version 19.05 and earlier, adjust the UseKohaPlugins system preference.
    • From version 20.05 onward, go to Administration –> Plugins –> Manage Plugins and upload the plugin.

Generate a Public Report

Create one or more public reports (e.g., “New Arrivals”) to define the content for your coverflow widget(s). Each report needs three columns: title, biblionumber, and ISBN. A valid ISBN is crucial for fetching covers.

Example: Finding items added in the last 30 days

1
2
3
4
5
6
7
8
9
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

For new arrivals under specific branch libraries:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 != ''
AND i.homebranch = <>
GROUP BY biblionumber
HAVING isbn != ""
ORDER BY rand()
LIMIT 30

For Local Cover Images:

1
2
3
4
5
6
7
8
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 cover_images c ON (items.biblionumber=c.biblionumber)
WHERE biblioitems.isbn IS NOT NULL AND biblioitems.isbn !=''
ORDER BY RAND()
LIMIT 15;

Configure the Plugin

  1. Go to Administration –> Plugins –> Manage Plugins.
  2. Select the installed plugin and click “Configure.”
  3. Replace the “New Arrival” public report ID in the code below:
1
2
3
4
5
6
7
---
- id: 5 
  selector: "#coverflow"
  options:
    buttons: true
    autoplay: 4000
    loop: true

Note: id: 5 represents the public report ID.

  1. Add the following HTML tag to Koha Tools –> News (from v20.05) in OpacMainUserBlock:
1
2
3
4
<div id="coverflow">
New Arrivals
Loading...
</div>
  1. Check your OPAC page to view the Coverflow.

Other Styles and Configurations

You can customize the style and behavior of the Coverflow plugin. Examples:

Coverflow Style:

1
2
3
4
5
6
7
8
---
- id: 50
  selector: "#coverflow"
  options:
    style: coverflow
    buttons: true
    autoplay: 4000
    loop: true

Carousel Style:

1
2
3
4
5
6
7
8
---
- id: 59
  selector: "#carousel"
  options:
    style: carousel
    buttons: true
    autoplay: 4000
    loop: true

Wheel Style:

1
2
3
4
5
6
7
8
---
- id: 44
  selector: "#wheel"
  options:
    style: wheel
    buttons: true
    autoplay: 4000
    loop: true

Flat Style:

1
2
3
4
5
6
7
8
---
- id: 133
  selector: "#flat"
  options:
    style: flat
    buttons: true
    autoplay: 4000
    loop: true

To use these styles, replace the relevant HTML tag content with the appropriate loading message:

  • Loading Coverflow…
  • Loading Carousel…
  • Loading Wheel…
  • Loading Flat…

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

Licensed under CC BY-NC-SA 4.0
Last updated on Jul 23, 2023 00:55 +0100