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>)

  • yasasY yasas has marked this topic as solved on


Suggested Topics


  • 0 Votes
    14 Posts
    652 Views
  • 0 Votes
    1 Posts
    394 Views
  • 0 Votes
    10 Posts
    341 Views
  • 0 Votes
    3 Posts
    946 Views
  • Custom PHP Page

    Plugin Development
    0 Votes
    30 Posts
    13559 Views