[Alma小知識] 37.其他網頁嵌Primo VE查詢框

可以在其他網頁上,如圖書館的入口網嵌入Primo VE的查詢框,即輸入查詢詞後會顯示Primo VE的查詢結果。


以下是基礎版查詢框,可以再依需求調整程式


1.   <html>

2.   <head>

3.   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

4.   <!-- Script that converts the query string into valid parameter -->

5.   <script type="text/javascript">

6.   function searchPrimo() {

7.   document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value;

8.   document.forms["searchForm"].submit();

9.   }

10. </script>

11. </head>

12. <body>

13. <!-- Fill in Highlighted Parameters -->

14. <form id="simple" name="searchForm" method="get" target="_self" action="https://單位代碼.primo.exlibrisgroup.com/discovery/search" enctype="application/x-www-form-urlencoded; charset=utf-8" onsubmit="searchPrimo()">                                                                        ---注意

15. <input type="hidden" name="vid" value=" Alma視圖代碼">                    ---注意

16. <input type="hidden" name="lang" value="zh-tw">

17. <!-- Fixed parameters -->

18. <input type="hidden" name="query" id="primoQuery">

19. <input type="text" id="primoQueryTemp" value="" size="35">

20. <!-- Search Button -->

21. <input id="go" title="Search" onclick="searchPrimo()" type="button" value="Search" alt="Search" style="height: 22px; font-size: 12px; font-weight: bold; background: #DE6E17; color: #ffffff; border: 1px solid;">

22. </form>

23. </body>

24. </html>

原廠文件:Creating a Search Box with Deep Links to Primo VE