Unread Count on Custom Navigation Item Icon
Solved
Plugin Development
-
Hi all,
Greetings!
I have created a custom Unread topics page for a plugin that I am developing.
I wanted to get the unread topic count on the Icon on the navigation bar just like the default Unread page icon has.
I tried quite a bit but couldn't find any direction on how do get this done.
Any help would be appreciated!
Thanks
-
Update:
Was able to sort this with a client script.
Example usage:
plugin.json ->{ "hook": "filter:navigation.available", "method": "addNavigation" }
plugin.json ->"scripts": [ "static/lib/client-script.js",... ],
library.js addNavigation:
append the following to the hookData object:{ route: '<some route>', title: <some title>, id: 'unread-count', iconClass: '<some icon> custom-class-name', text: <some title> }
client-script.js:
$("#unread-count .custom-class-name").attr("data-content",<unread count>)
-
Copyright © 2024 NodeBB | Contributors