[Koha] search form

Owen Leonard oleonard at myacpl.org
Thu Oct 1 02:14:15 NZDT 2009


>  i want to change place of searchform from header to opacmainuserblock
> how can i do that?

There are a couple of ways you could do it:

You could use a little jQuery, by adding this to your opacuserjs system pref:

$(document).ready(function(){
  $("#searchform").prependTo("#opacmainuserblock");
});

Of course that only works for javascript-capable browsers, and it also
moves the Cart and Lists buttons. That may or may not be acceptable.

The other choice is to duplicate the HTML of the search form in
opacmainuserblock and use CSS to hide the form in the search bar.
These are the essentials of the form:

<form action="/cgi-bin/koha/opac-search.pl" method="get" name="searchform">
    <label for="masthead_search"> Search </label>
	 <select id="masthead_search" name="idx">
	        <option value="">Library Catalog</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 type="text" name="q" />
      <input type="submit" value="Go"/>
</form>

Add this to your OpacUserCSS system pref:

#searchform label,
#searchform input,
#searchform select {
display: none;
}

I don't know what the reasons are for your request, but I would
recommend that you don't do it at all. The search form is where it is
for a reason: so users can access the search function from wherever
they are. Why make them go back to the OPAC's main page to start
another search?

  -- Owen

--
Web Developer
Athens County Public Libraries
http://www.myacpl.org


More information about the Koha mailing list