Wordpress "Search this site/Search our catalog" code
Hello everyone, Does anyone have any code for creating a single search box on a Word Press site that can switch between "Search our website" and "Search our catalog?" If you have any code to do that, could you share it with us? George -- George Williams Next Search Catalog Coordinator Send NEXT support e-mails to nexthelp@nekls.org
Does anyone have any code for creating a single search box on a Word Press site that can switch between "Search our website" and "Search our catalog?"
This is what we have in our modified Wordpress template (https://www.myacpl.org/): https://gitlab.com/snippets/1890638 The <script> section is actually in a different file, but GitLab doesn't support multiple "files" in a snippet. The HTML is from the modified Wordpress template, so you can see that it calls the Wordpress search form directly: <?php get_search_form(); ?> Please let me know if I can provide more details. -- Owen -- Web Developer Athens County Public Libraries https://www.myacpl.org
This is what we have. It's a simple bit of html that is used on the page where you want the search box to be. You have to change opacbaseurl for your own. Let me know if it works :) <form name="searchform" method="get" action="https://opacbaseurl/cgi-bin/koha/opac-search.pl" id="searchform"> <input id="transl1" name="q" type="text"><p> <select name="idx" id="masthead_search"> <option value="kw">Keyword</option> <option value="ti">Title</option> <option value="au">Author</option> <option value="su">Subject</option> <option value="nb">ISBN</option> <option value="se">Series</option> <option value="callnum">Call number</option> </select> <input value="Search" id="searchsubmit" type="submit"></p> </form> On 19-08-30 09 h 02, Owen Leonard wrote:
Does anyone have any code for creating a single search box on a Word Press site that can switch between "Search our website" and "Search our catalog?" This is what we have in our modified Wordpress template (https://www.myacpl.org/):
https://gitlab.com/snippets/1890638
The <script> section is actually in a different file, but GitLab doesn't support multiple "files" in a snippet.
The HTML is from the modified Wordpress template, so you can see that it calls the Wordpress search form directly:
<?php get_search_form(); ?>
Please let me know if I can provide more details.
-- Owen
-- Caroline Cyr La Rose, M.L.I.S. Librarian | Product Manager Phone: 1-833-465-4276, ext. 221 Caroline.Cyr-La-Rose@inLibro.com <mailto:caroline.cyr-la-rose@inLibro.com> INLiBRO | Document Technologies Specialists | www.inLibro.com <http://www.inLibro.com>
participants (3)
-
Caroline Cyr-La-Rose -
George -
Owen Leonard