[Archivesspace_Users_Group] Embed search box on webpage?
Joel Marchesoni
jmarch at email.wcu.edu
Tue Jul 24 15:30:29 EDT 2018
Hi Laura,
You should be able to copy the search box form HTML from your ArchivesSpace homepage. You’d just need to add the URL of your instance before “/search” in the form’s action attribute.
Here’s a simplified version of ours for an example. The original HTML contains div tags they’ve used for layout and styling that I removed for brevity. ArchivesSpace seems to need most of the fields there for the search or it has errors, but you could change the dropdowns to hidden fields with a value of the options you want.
<form id="advanced_search" action="https://wcu.lyrasistechnology.org/search" accept-charset="UTF-8" method="get">
<input name="utf8" value="?" type="hidden">
<label class="sr-only" for="op0">Search operator</label>
<select name="op[]" id="op0" disabled="disabled" class="form-control hidden">
<option value="AND">And</option>
<option value="OR">Or</option>
<option value="NOT">Not</option>
</select>
<input name="op[]" id="op_" value="" type="hidden">
<label class="sr-only repeats" for="q0">Enter your search terms</label>
<input name="q[]" id="q0" placeholder="Enter your search terms" class="form-control repeats fill-column" type="text">
<label class="sr-only" for="limit">Limit to %{limit}</label>
<select name="limit" id="limit" class="form-control fill-column">
<option selected="selected" value="">Search all record types</option>
<option value="resource">Limit to collections</option>
<option value="digital_object">Limit to digital materials</option>
</select>
<label class="sr-only repeats" for="field0">Search field</label>
<select name="field[]" id="field0" class="form-control repeats">
<option value="">Keyword</option>
<option value="title">Title</option>
<option value="creators_text">Creator</option>
<option value="subjects_text">Subject</option>
<option value="notes">Notes</option>
<option value="identifier">Identifier</option>
</select>
<input name="commit" value="Search" class="btn btn-primary" id="submit_search" data-disable-with="Search" type="submit">
</form>
Thanks,
Joel Marchesoni
Tech Support Analyst
Hunter Library at Western Carolina University
828-227-2860
http://www.wcu.edu/hunter-library/
From: archivesspace_users_group-bounces at lyralists.lyrasis.org [mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org] On Behalf Of Uglean Jackson, Laura
Sent: Tuesday, July 24, 2018 15:02
To: archivesspace_users_group at lyralists.lyrasis.org
Subject: [Archivesspace_Users_Group] Embed search box on webpage?
Hi ASpace Community,
Is it possible to embed a basic ASpace search box onto a webpage? We’d like to include a search box on our department homepage. It would be very similar to the typical library catalog search bar on a library homepage. If anyone knows whether or not this is possible, I’d appreciate hearing from you.
Thank you!
Laura
Laura Uglean Jackson
Archives & Special Collections Librarian
University of Northern Colorado Library
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20180724/5021d4a0/attachment.html>
More information about the Archivesspace_Users_Group
mailing list