When you add a news to your newsfeed, it will be added in the list located in your chatbox. In this case, you might want your users to be aware about it without actually opening the chatbox.
By adding the class asktech-badge
to an element, a badge will be displayed in the top right corner of this element, showing the number of unread news. Your user will then be able to click on this element to open the news list, which will clear the badge for further visits until you release an additional news.
If you need a cutom solution, you can use the _polaria.unreadNewsIds
array along with the news_read
event. Here is a usage example:
window._polariaSettings = {
/* ... Your settings */
onInit: function(_polaria) {
_polaria.on('ready', function() {
if (_polaria.unreadNewsIds.length) {
// Add unread indicator
}
});
_polaria.on('news_read', function() {
// Clear indicator
});
}
};