Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Icon in Tab

edited March 2007 in Vanilla 1.0 Help
Where are the actual tabs constructed?
I want to replace the word "Search" in the tab with an icon. pic

Posted: Friday, 23 March 2007 at 3:20PM (AEDT)


  • Options
    That would be Themes/Menu.php. You would need to put an IF in that while loop to check for the search tab and replace it with the icon source.

    Or I suppose you could add an class or ID attribute to it and style the tab with CSS.
  • Options
    Thanks WallPhone I did see this in themes/menu.php...
    while (list($Key, $Tab) = each($this->Tabs)) { echo '<li'.$this->TabClass($this->CurrentTab, $Tab['Value']).'> <a href="'.$Tab['Url'].'" '.$Tab['Attributes'].'>'.$Tab['Text'].'</a></li>';}
    I thought there was a more expanded bit somewhere that was more human-readable.
    I can usually hack PHP to achieve my needs but this is too complex for me.
    Like a dog with a bone, I'll bury it soon.

    Posted: Friday, 23 March 2007 at 3:39PM (AEDT)

  • Options
    edited March 2007
    try this
    while (list($Key, $Tab) = each($this->Tabs)) { echo '<li'.$this->TabClass($this->CurrentTab, $Tab['Value']).' id="icon-'.$Tab['Text'].'"> <a href="'.$Tab['Url'].'" '.$Tab['Attributes'].'>'.$Tab['Text'].'</a></li>'; }

    then u can add the icons using css

    #icon-Discussions {}
    #icon-Categories {}
  • Options
    Thanks mate but I think I've done it!

    It even hides the account icon pic for guests and only shows the settings icon pic for me.

    Not as neatly as your suggestion I'm sure but it seems to work, now to test it in exploder!

    I will however try and work out your suggestion, it's probably more efficient than my hack.

    Posted: Friday, 23 March 2007 at 5:41PM (AEDT)

  • Options
    @ Wanderer: nice job hacking vanilla.

    How did you get that front page set-up? is it an extension that I'm not aware of?
  • Options
    No special setup, simply Page Manager (with a little embedded php code).

    Posted: Friday, 23 March 2007 at 6:57PM (AEDT)

This discussion has been closed.