When you're rendering your template, register the notification variables to your template, like:
Code:
$templater->register('notifications_menubits', $notifications_menubits);
$templater->register('notifications_total', $notifications_total);
Then look at the original navbar template and copy the parts that display notifications_menubits and notifications_total (unless that's the part you were asking about, in which case this doesn't help

).