Skip to content

Auto-Suggest integration (integration/linked)

Created by: ema-om

Integration of auto-suggest feature has been completed. It uses the autocomplete.js jQuery plugin shipped with VuFind. The AutoSuggest component has been implemented using TypeScript and the generated output is part of the swissbib.ts.js file which now is integrated into the layout.phtml template to be served on each page.

The auto-suggest configuration can be changed in the searches.ini and is extensible by any number of auto-suggest sections. The whole configuration is merged into the global swissbib object in the layout.phtml so it becomes available on the client-side in JavaScript.

Translations for section labels can be added to the according language ini-files and the localization keys must then be used in the searches.ini for the according section's label configuration.

Furthermore the AutoSuggest section in the searches.ini makes the search interface configurable through some URL template strings with placeholders filled automatically when the auto-suggest drop-down menu is generated.

Finally for TypeScript integration the API of the autocomplete.js as been declared in a the themes/sbvfrd/ts/types/jquery.vufind.autocomplete.d.ts file so everything can be type-checked automatically during development and in continuous integration processes.

Merge request reports