Add an announcement bar underneath the search bar. This module was created as a demo to try adding an independent feature to Primo. Borrowed CSS to size the bar from NYUs primo-explore-search-bar-sub-menu.
- Make sure you've installed and configured primo-explore-devenv.
- Navigate to your template/central package root directory. For example:
- If you do not already have a
package.jsonfile in this directory, create one:
npm init -y
- Install this package:
npm install primo-explore-wrlc-announce --save-dev
Once this package is installed, start up the primo-explore-devenv. This will collect the code and insert it into your view. After this is done, you'll need to add configuration to your custom.js file:
wrlcAnnounce as a dependency for your custom module definition.
var app = angular
Configure your API calls to retrieve announcements. primo-explore-wrlc-announce has the following configuration options
||string||A url that can be used to fetch your announcement data.|
||function||A function that returns TRUE if you want to show your announcement banner.|
||function||A function that returns the message text you want to display.|
||function||A function that returns a link you want to add the the Message text.|
The following would be added to the custom.js file after the module installed. This example uses Google Sheets as the source for the announcement data.
var app = angular;app;