Vložení vyhledávacího widgetu na web knihovny

Z Alma WiKi
Skočit na navigaci Skočit na vyhledávání

Pokud chcete do stránek knihovny vložit vyhledávací widget, který umožní uživatelům zadat dotaz a odvést je na výsledky v UKAŽ, postupujte následovně.

1) Do hlavičky stránky vložte následující skript:

<!-- Script that converts the query string into valid parameter -->
<script type="text/javascript">
function searchPrimo() {
document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value.replace(/[,]/g, " ");
document.forms["searchForm"].submit();
}
</script>

2) Do těla stránky vložte následující formulář:

<form id="simple" name="searchForm" method="get" target="_self" action="https://cuni.primo.exlibrisgroup.com/discovery/search" enctype="application/x-www-form-urlencoded; charset=utf-8" onsubmit="searchPrimo()">
<!-- Customizable Parameters -->
<input type="hidden" name="vid" value="420CKIS_INST:CKIS">
<input type="hidden" name="tab" value="Everything">
<input type="hidden" name="search_scope" value="MyInst_and_CI">
<input type="hidden" name="lang" value="cs">
<input type="hidden" name="mode" value="basic">
<!-- Fixed parameters -->
<input type="hidden" name="query" id="primoQuery">
<input type="hidden" name="pcAvailabiltyMode" value="true">
<input type="text" id="primoQueryTemp" value="" size="35">
<!-- Search Button -->
<input id="go" title="Hledat" onclick="searchPrimo()" type="button" value="Hledat" alt="Hledat" style="height: 22px; font-size: 12px; font-weight: bold; background: #D22D40; color: #ffffff; border: 1px solid;">
</form>


Oficiální dokumentace: ExLibris Knowledge Center