1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to add forum icons in tabs added with listeners?

Discussion in 'XenForo Development Discussions' started by SchmitzIT, Apr 9, 2011.

  1. SchmitzIT

    SchmitzIT 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,
  2. xfrocks

    xfrocks 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
  3. SchmitzIT

    SchmitzIT Well-Known Member

    Will do, xfrocks. Thanks. I also messed around with it for a bit, but couldn't get it to work.
  4. SchmitzIT

    SchmitzIT Well-Known Member

Share This Page