Jaxel Well-known member Dec 6, 2017 #1 In XF1, we were able to add a "count" to each tab in the navbar through code. Is this still a thing?
Mike XenForo developer Staff member Dec 7, 2017 #2 If the nav entry data has a "counter", it will be used like that.
Jaxel Well-known member Dec 7, 2017 #3 Mike said: If the nav entry data has a "counter", it will be used like that. Click to expand... In the extra attributes section, I put data-counter 2, but no alert bubble is showing up.
Mike said: If the nav entry data has a "counter", it will be used like that. Click to expand... In the extra attributes section, I put data-counter 2, but no alert bubble is showing up.
Chris D XenForo developer Staff member Dec 7, 2017 #4 You would usually add it programmatically to the nav entry using the navigation_setup event using the counter value as described above.
You would usually add it programmatically to the nav entry using the navigation_setup event using the counter value as described above.
Jaxel Well-known member Dec 7, 2017 #5 Chris D said: You would usually add it programmatically to the nav entry using the navigation_setup event using the counter value as described above. Click to expand... Of course. But I'm trying to do it manually first, just to make sure it works. Any examples of a navigation setup event?
Chris D said: You would usually add it programmatically to the nav entry using the navigation_setup event using the counter value as described above. Click to expand... Of course. But I'm trying to do it manually first, just to make sure it works. Any examples of a navigation setup event?
Jaxel Well-known member Dec 7, 2017 #6 I got it... thanks. Code: <?php namespace EWR\Rio\Listener; class Navigation { public static function setup(\XF\Pub\App $app, array &$navigationFlat, array &$navigationTree) { $navigationTree['EWRrio']['counter'] = 2; } }
I got it... thanks. Code: <?php namespace EWR\Rio\Listener; class Navigation { public static function setup(\XF\Pub\App $app, array &$navigationFlat, array &$navigationTree) { $navigationTree['EWRrio']['counter'] = 2; } }