Get DSpace 7.6 search box code and use it to other web pages

72 views
Skip to first unread message

Lewatle Johannes Phaladi

unread,
Jan 26, 2024, 4:20:50 AM1/26/24
to DSpace Technical Support
Dear All, 

How to get code for DSpace search box and use it on any website.
dspace 7 search.png
Regards,
Lewatle 

DSpace Technical Support

unread,
Jan 26, 2024, 11:21:11 AM1/26/24
to DSpace Technical Support
Hi Lewatle,

At this time, DSpace does not have a custom Javascript "widget" which allows you to embed the searchbox in another page.  It would be possible to write though, as that widget would just need to make the same REST API calls (to the DSpace backend) that are made from the search box in the DSpace user interface.  Those REST API endpoint calls can be seen in your browser's DevTools as described here: https://wiki.lyrasis.org/display/DSDOC7x/REST+API#RESTAPI-FindingwhichRESTAPIEndpointtouse

So, someone who has a little expertise with Javascript could write a small tool that makes those same REST API calls to run a search in DSpace.  It isn't possible though to just copy the existing searchbox out of DSpace into a different website (as the existing searchbox code is written in Angular and would only work on another site that uses Angular).

Tim

Lewatle Johannes Phaladi

unread,
Jan 29, 2024, 7:25:42 AM1/29/24
to DSpace Technical Support
Hello Tim,

Thanks a lot for the reply, one wish that this can be included on DSpace 8, I will check if there is place where wishes can be posted for the upcoming version. Much appreciated for clear reply.

Regards,
Lewatle 

Reply all
Reply to author
Forward
0 new messages