.. include:: images.rst
.. _extending-koha-label:
Extending Koha
==================
This chapter shows how you can add various enhancements and customizations
in and around Koha by using mostly the existing configuration options.
.. _amazon-lookup-script-for-koha-libraries-label:
Amazon lookup script for Koha libraries
--------------------------------------------------------
We order most of our materials from Amazon, so I've been looking for a
convenient way to tell if a book under consideration is in our catalog
already.
Greasemonkey & a custom user script fit the bill nicely:
- https://addons.mozilla.org/en-US/firefox/addon/748
- http://userscripts.org/scripts/show/56847
A few caveats:
- Like most scripts, this one was designed to work with Firefox; I
haven't explored getting it to work with other browsers.
- I'm not a JavaScript programmer -- this was adapted from others'
work. Just a few lines would have to be changed to get the script to
work with your catalog.
- It depends on the existence of ISBN for the item in question, so
movies, older books, etc. would not work.
Others have added all sorts of bells & whistles: custom messages based on the status of items (on
order, on hold, etc.), ... just search the UserScripts site for Amazon +
library. For a later date!
.. _keyword-clouds-label:
Keyword clouds
-----------------------------------------
In addition to the traditional tag cloud available in Koha, there is a
way to generate clouds for popular subjects within Koha.
The :ref:`Author/Subject Cloud cron job ` is used to help with this process. This cron job sends its output to files.
- /home/koha/mylibrary/koharoot/koha-tmpl/cloud-author.html
- /home/koha/yourlibrary/koharoot/koha-tmpl/cloud-subject.html
This means that you can produce clouds for authors, collective author,
all kind of subjects, classifications, etc. And since it works on zebra
indexes, it is quick, even on large DBs. Tags clouds are sent to files.
It's up to library webmaster to deal with those files in order to
include them in :ref:`OPACMainUserBlock `, or include
them into their library CMS.
Some libraries even send the file into a Samba shared folder where
webmaster take them, eventually clean them a little bit before
integrating them into navigation widgets or pages.
.. _newest-titles-pulldown-label:
Newest titles pulldown
---------------------------------------------
Often we want to add a way for our patrons to do searches for the newest
items. In this example I'll show you how to create a pull down menu of
the newest items by item type. These tips will work (with a couple
changes) for collection codes or shelving locations as well.
First, it's important to note that every link in Koha is a permanent
link. This means if I do a search for everything of a specific item type
sorted by the acquisitions date and bookmark that URL, whenever I click
it I'll see the newest items of that type on the first few pages of the
results.
I took this knowledge and wrote a form takes this functionality in to
consideration. It basically just does a search of your Koha catalog for
a specific item type and sorts the results by acquisitions date.
The first thing I did was write a MySQL statement to generate a list of
item types for me - why copy and paste when you can use the power of
MySQL?
::
select concat('') from itemtypes
The above looks at the itemtypes table and slaps the necessary HTML
around each item type for me. I then exported that to CSV and opened it
in my text editor and added the other parts of the form.
::
New Items
Now, what does all of that mean? The important bits are these:
First the starting of the form.
::