/primo-syndetics-unbound-widget

Custom code for loading the Syndetics Unbound widget on the Primo start page.

Primary LanguageJavaScript

Primo Syndetics Unbound Widget

The code included in this repository was developed to help integrate book display widgets from Syndetics Unbound on the ExLibris Primo start page.

Syndetics widgets rely on an external script injected on Primo pages. The code provided by the vendor appears however not to load reliably on subsequent visits to the Primo start page and as users navigate back and forth between search results and the start page. The code included in this repository attempts to resolve this issue by detecting page location changes and reloading the widget script when this happens. It also prevents the script from being injected multiple times.

For this code to work, you have to add the contents of syndetics-unbound-widget.js to your Primo view's custom.js file. Be sure to replace YOURID with your Sydetics client ID and make sure you add the code inside the (function () {...})(); block.

You will also need to add the following to your homepage_en.html page (and other languages, if using):

<syndetics-widget-component></syndetics-widget-component>

The exact location doesn't matter, this is just to enable the module to be called whenever the homepage template is being displayed. This does not replace the widget code generated by Syndetics.