Basic Customization Tutorial ​
This tutorial shows how to customize a corpus in the BlackLab Frontend by adding a custom JavaScript file and changing the displayed title of your documents.
Steps ​
Create the config directory for your corpus.
By default, this is/etc/projectconfigs/. If your corpus is calledexample, your config directory will be/etc/projectconfigs/example/. Use your custom paths if necessary.Copy the default
search.xmlinto your corpus directory.
You can find the default atsrc/main/resources/interface-default/search.xml.
Copy it to:/etc/projectconfigs/example/search.xmlAdd a config option to include a custom script on the
searchpage.
Edit yoursearch.xmland add:xml<CustomJs page="search">${request:corpusPath}/static/js/custom.search.js</CustomJs>Create a matching JavaScript file.
Create the file:/etc/projectconfigs/example/static/js/custom.search.jsAdd the following snippet to your
custom.search.js:jsvuexModules.ui.getState().results.shared.getDocumentSummary = function(metadata, specialFields) { return 'This is everything we know about the document: ' + JSON.stringify(metadata); }Restart your server and perform a search in your corpus to see the changes.
For example: http://localhost:8080/blacklab-frontend/example/search/docs?patt=""NOTE: You don't need to restart the application constantly. Simply set
cache=falsein the mainblacklab-frontend.propertiesconfig file to disable caching of files by the server.