-
Notifications
You must be signed in to change notification settings - Fork 25
Koha & EDS Integration without the plugin
Cam Blair Wu edited this page May 19, 2020
·
10 revisions
If you'd like to have the dropdown search option for EDS, without the actual plugin you can add the below code to OPACUserJS setting with Koha.
Note: The plugin should not be installed if you are using this script!
"EDS Dropdown Text": The text for the EDS option in the dropdown.
"EDS Default": Can be true or false. Defines whether EDS is the default option in the search dropdown.
"EDS URL": Your EDS access URL.
Don't forget to replace the placeholder values in edsSettings -> EDS URL your account and access details
var edsSettings = {
"EDS Dropdown Text": "Discovery",
"EDS URL": "https://search.ebscohost.com/login.aspx?authtype=__AUTHTYPE__&custid=__CUSTID__&groupid=__GROUP__&profile=__PROFILE__",
"EDS Default": true
}
var selectE,selectL="beforeEnd";edsSettings["EDS Default"]&&(selectL="afterBegin"),document.querySelector("#searchform")&&((selectE=document.querySelector("#searchform select[name='idx']")).insertAdjacentHTML(selectL,'<option value="_eds">'+edsSettings["EDS Dropdown Text"]+"</option>"),document.querySelector("body#opac-main")&&(selectE.value="_eds"),document.querySelector("#searchform").onsubmit=function(e){"_eds"==selectE.value&&(e.preventDefault(),window.location=edsSettings["EDS URL"]+"&direct=true&bquery="+encodeURIComponent(document.querySelector("#searchform input[name='q']").value))});