customizationdspacemirage

DSpace: how to modify the input box of advance search


I am a member of the ILS development team for the central library of Bangladesh University of Engineering and Technology (BUET). There we have installed DSpace as institutional repository. We are using XMLUI. We have included a new search filter "Department" in the advanced search filter. So the items can be searched by department. In the advanced search page, three fields appear in the search panel. First one is for filter, second one is for criteria (dropdown list containing options of "contains", "Equals", etc.), and the third box is the input box having type "text". My question is, how can we add dropdown list in the input box. I mean, the existing input box is of "text" type. But we want a dropdown list containing the department names to appear in the input box when the "Department" filter is selected, so that we don't need to input "Computer Science" by typing, instead, we can select the dept. name from the dropdown list to make it more user friendly. However, for other filters, say "Author", existing look is alright.


Solution

  • The short answer is, you can't do that. The longer answer is, you can probably rig something like this by querying solr directly in your theme xslt files (so you can store the list of departments somewhere hidden on the page), then writing custom JavaScript that switches out the text field for a drop-down box containing the list of departments.

    Might it be more helpful to add a facet for the department? Then people could restrict their searches by clicking on the corresponding department in the sidebar.