How to add forum icons in tabs added with listeners?


Well-known member
We use navtab icons for all navigation tabs in vB. I've put in place icons in the default navigation template to accomplish the same, but currently find myself wondering how to do that for tabs created by means of the event listeners?

What I want to accomplish is simple. Right before the phrase defining the title of the tab, I add an image tag, which I close after the phrase. However, I'm not certain that the array used in the dynamic code will allow me to do this.

Could anyone provide me with a pointer on how to accomplish this, please?

Here's sample code (Jaxel's XenMedio):

class EWRmedio_Listener_NavTabs
public static function listen(array &$extraTabs, $selectedTabId)
$permsModel = new EWRmedio_Model_Perms();
$perms = $permsModel->getPermissions();

$extraTabs['media'] = array(
'title' => new XenForo_Phrase('media'),
'href' => XenForo_Link::buildPublicLink('full:media'),
'position' => 'middle',
'linksTemplate' => 'EWRmedio_Navtabs',
'perms' => $perms,


Well-known member
I tried this and it can be done in a hacky way but I won't recommend that. The main reason is the tab title is escaped before output so your html code won't survive. I think you should post this as a feature request so XenForo team can add it later, it's pretty obvious and necessary I think