Q. How can I put an banner announcement in OneSearch?

Answer

We can put dismissable banner announcements in OneSearch on a per-view basis using the Primo VE customization package. The banner shows under the search bar. The file that we need to edit is top-announcement.html in the html directory.

Looking at what is currently in the file, it should be fairly clear how to edit the banner message.

To customize various aspects of the banner you can add properties to the $ctrl.showAnnounce function located in the ng-if attribute. All properties are optional. If you omit a property, default values are used.

showAnnounce() properties
Property data type default value notes
startDate string none

m-d-yyyy

Banner will start showing on the date indicated here.

endDate string none

m-d-yyyy

The banner will stop showing the day after the date you set. Recommended!

cookieID string lrHideOSAnnce-[college acronym] Setting a distinct cookie name is recommended to ensure that if you change the announcement, the new one won't be hidden for users who dismissed a previous banner. To ensure that cookies are view-specific, the college acronym associated with the Primo VE view will be automatically appended to the cookie ID you set here.
daysToHide integer 14 This number sets the expiration date of the cookie that prevents the banner from reappearing.

Here's an example of what showAnnounce might look like:

<md-content id="top-announce" ng-class="$ctrl.fade" ng-if="$ctrl.showAnnounce({ startDate: '4-22-2021', endDate: '5-5-2021', cookieID: 'end-of-semester', daysToHide: 30 });">

Make sure that each property except the last ends in a comma.

Styling

You may want to tweak the the background of #top-announce in custom1.css. If you choose a dark background, more changes will be needed for font colors.

  • Last Updated Apr 30, 2021
  • Views 7
  • Answered By Jeff Karlsen

FAQ Actions

Was this helpful? 0   0