[Koha] Question re: NPL OPAC icons & ItemTypes

Steven F.Baljkas baljkas at mts.net
Thu Jun 16 15:43:58 NZST 2005


Wednesday, June 15, 2005    22:10 CDT

Hi, Owen, Chris and assorted cognoscenti,

Thanks for the responses, guys.

Chris, symlinks?! <zoom: right over top of head>

Owen, I think I understood your explanation.

Otherwise, if I am understanding what you wrote, we would pretty much have to define 45 ItemTypes just to cover all the possibilities for books in the library (14 core genres accepted in principle x 3 levels + 3 levels non-fiction: each genre or non-fiction at each level is slightly different so as to be distinct) let alone the other GMDs and equipment ItemTypes.

In discussing this stuff with Chris Jones, I had referred to IF...THEN statements -- something familiar to me from way back in highschool programming, when we played with Fortran, Pascal and the like -- so that I could work out flowcharts for what decision processes would be needed.

I don't know how Chris planned to execute this, but what he and I were discussing was building in code (he has experience coding; I don't) to assess an item -- a book, say --, and determine what icon should be displayed.

Anyway, I have been working on these awful/awesome flowcharts for what would have to be checked. For most of the GMDs, it was pretty straightforward.
For text (books), videorecordings and motion pictures it is truly frightening.

Without getting into it too much, the basic breakdown would be a list something like this:
· Check textstring from GMD (245 $h) -- will be null for books
· Check other-instruction -- if null, check value at 008-22
· Check value at Target Audience (008-22) -- 1 of 3 possibilities
· Check value at Literary Form (008-32: Fiction vs Non-Fiction; also would
                                  yield one specific genre CJ wanted, Humor)
· Check textstring from Genre (655) -- 1 of 13 possibilities (14th = Humor)
· Check ItemType code (952 $a)
Following the different branches of decisions made yields icon displayed.

At this point, I started hoping there might be a much simpler way, defining another variable, in the MARC record, that would instruct what icon to use. If I understand correctly, that is really part of what ItemType is doing in the NPL template anyway.

There would still be a bank of images in one directory, and there would only be one copy of each, but the one displayed would be called/determined by another textstring variable.

To use the code line you provided (thanks much!), I imagined it might be possible to have something like this:

<img src="/includes/images/<!-- TMPL_VAR NAME='icontype' -->.gif">

since, when cataloguing, we have to describe the works in hand anyway, what's one more subfield in MARC.

However, if I understand properly, we would have to map where this new variable 'icontype' is coming from (suggestions were another 952 subfield or a 09x field $a).

Would something like that be possible? Is there a better way?

Steven F. Baljkas
library tech at large
Koha neophyte
Winnipeg, MB, Canada

============================================================
From: Owen Leonard <oleonard at athenscounty.lib.oh.us>
Date: 2005/06/15 Wed PM 09:20:36 CDT
To: koha at lists.katipo.co.nz
Subject: Re: [Koha] Question re: NPL OPAC icons & ItemTypes

> I assume there is a line of code that tells Koha if ItemType = X then icon = X'.

No, there's no such line of code.  The icons work because their file names
are the same as the item's itemtype code or itemtype description.  So if
the itemtype code is 'AF', then the template says:

<img src="/includes/images/<!-- TMPL_VAR NAME='itemtype' -->.gif">

...And in your images directory, you have AF.gif, AV.gif, AC.gif, SF.gif,
etc.  This is a clumsy system, but it's what worked given the framework
that now exists.  Paul has talked about building a better
database/preference-based system, but that hasn't come to pass yet.

The interim solution is to have multiple copies of the same image with
different file names.  So, if you have one book icon but several book item
types, you just copy and rename the file for each item type.

Would that work?

  -- Owen
_______________________________________________
Koha mailing list
Koha at lists.katipo.co.nz
http://lists.katipo.co.nz/mailman/listinfo/koha
============================================================




More information about the Koha mailing list