[Koha] Case for selecting Item types preference in Koha OPAC search module

schnydszch eugenegf at yahoo.com
Tue Jun 10 16:58:49 NZST 2014


Hi! We have the same query, I posted this two weeks ago:
http://koha.1045719.n5.nabble.com/koha-item-types-dropdown-instead-of-library-dropdown-td5798062.html

I was actually able to implement this in the Koha ILS project I am working,
I just follow the lead of Fridolin Somers. I came up with this jquery:

$("#select_library
option[value='branch:LastLibraryInMastHeadPullDown']").after("<option
value=\'mc-itype,phr:BK\'>Books</option>");

$("#select_library
option[value='mc-itype,phr:BK']").attr("selected","selected"); 

$("#select_library option[value='mc-itype,phr:BK']").after("<option
value=\'mc-itype,phr:RETRATO\'>Images (Retrato)</option>");

$("#select_library option[value='mc-itype,phr:RETRATO']");

$("#select_library option[value='mc-itype,phr:RETRATO']").after("<option
value=\'mc-itype,phr:HIMIG\'>Himig (Songs)</option>");

$("#select_library option[value='mc-itype,phr:HIMIG']");

$("#select_library option[value='mc-itype,phr:HIMIG']").after("<option
value=\'mc-itype,phr:HIMIGALBUMS\'>Himig (Albums) </option>");

$("#select_library option[value='mc-itype,phr:HIMIGALBUMS']");

$("#select_library option[value='mc-itype,phr:HIMIGALBUMS']").after("<option
value=\'mc-itype,phr:MAPS-RARE\'>Maps - Rare </option>");

$("#select_library option[value='mc-itype,phr:MAPS-RARE']");

$("#select_library option[value='mc-itype,phr:MAPS-RARE']").after("<option
value=\'mc-itype,phr:MAPS-US\'>Maps - US Army </option>");

$("#select_library option[value='mc-itype,phr:MAPS-US']");

$("#select_library option[value='mc-itype,phr:MAPS-US']").after("<option
value=\'mc-itype,phr:AV\'>Audio-visuals</option>");

$("#select_library option[value='mc-itype,phr:AV']");

$("#select_library option[value='mc-itype,phr:AV']").after("<option
value=\'mc-itype,phr:MANUSCRIPT\'>Manuscripts</option>");

$("#select_library option[value='mc-itype,phr:MANUSCRIPT']");

$("#select_library option[value='mc-itype,phr:MANUSCRIPT']").after("<option
value=\'mc-itype,phr:MICROFICHE\'>Microfiche</option>");

$("#select_library option[value='mc-itype,phr:MICROFICHE']");

$("#select_library option[value='mc-itype,phr:MICROFICHE']").after("<option
value=\'mc-itype,phr:PAMPHLET\'>Pamphlet</option>");

$("#select_library option[value='mc-itype,phr:PAMPHLET']");

$("#select_library option[value='mc-itype,phr:PAMPHLET']").after("<option
value=\'mc-itype,phr:SER\'>Serials</option>");

$("#select_library option[value='mc-itype,phr:SER']");

$("#select_library option[value='mc-itype,phr:SER']").after("<option
value=\'branch:FHL\'>All Item Types</option>");

$("#select_library option[value='branch:FHL']");


So what this does is: 1) the first two codes adds a dropdown with search for
item type Books after the Last Library in the MastHead Search, 2) And then
add further other item types, you can get the itemtypes in your Authorized
values, 3) Last two codes are for all item types, and this one is actually
using the value for the only Library in our Koha ILS project, which is FHL.
This last code I feel, there could be a better jquery script, but it works
for us since we only have one library. 

Hope this helps. Cheers! 



--
View this message in context: http://koha.1045719.n5.nabble.com/Case-for-selecting-Item-types-preference-in-Koha-OPAC-search-module-tp5800494p5800566.html
Sent from the Koha-general mailing list archive at Nabble.com.


More information about the Koha mailing list