Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Howto customize text of the "New discussion" button?

lifeisfoolifeisfoo Zombie plugins finder ✭✭✭

In question category I need "New question", in used-items I need "Sell item", etc...
Is there a hook that can be used in a plugin?

There was an error rendering this rich post.

Best Answer

Answers

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited March 2013

    Do you just want to change the text from New Question to Sell Item?

    if so then go to conf/locale.php and add or change the definition

    $Definition['Start a New Discussion']='Sell Item';

  • lifeisfoolifeisfoo Zombie plugins finder ✭✭✭

    Yes, I need a category-based text of the button.

    There was an error rendering this rich post.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yea you can call it whatever you want using the $Definitions

  • lifeisfoolifeisfoo Zombie plugins finder ✭✭✭

    But changing $Definition will change the text of the button globally (in all categories).
    I need a different behaviour, e.g.:
    *while I'm in http://vanillaforums.org/categories/developers I want the "new discussion"button with text "Ask to developers"
    *while I'm in http://vanillaforums.org/categories/feedback I want the "new discussion" button with text "Give a feedback!"
    *...

    There was an error rendering this rich post.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    You could just add new buttons that say and go where ever you want too. You make an array of bbuttons with the names of what ever you want for the pages and systematically you can display:none the one that you don't want to show.

    or you can make a sprite image with the names of the links and using css you can direct the position of the image to match where you want it on the specific page.

    This way it is only one button and one image with all the link names and on the body of the page that you wish to show x link example of how to use a sprite image:

    body.Profile a.BigButton{
    background:url(images/bbsprite.png);
    background-position:24px 50px;
    background-repeat:no repeat;
    }
    
    body.Discussions a.BigButton{
    background:url(images/bbsprite.png);
    background-position:50px 50px;
    background-repeat:no repeat;
    }
    
    body.Entry a.BigButton{
    background:url(images/bbsprite.png);
    background-position:50px 50px;
    background-repeat:no repeat;
    }
    body.Dashboard a.BigButton{
    background:url(images/bbsprite.png);
    background-position:60px 24px;
    background-repeat:no repeat;
    }
    
    body.Categories a.BigButton{
    background:url(images/bbsprite.png);
    background-position:60px 60px;
    background-repeat:no repeat;
    }
    

    the key here is get the correct values for the text in the image to match up to the button.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @lifeisfoo Thanks for making a contribution to the community , it does not happen very often that someone solves their own problem and also creates something useful for everyone else to be able to benefit !! :)

Sign In or Register to comment.