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?
lifeisfoo
✭✭✭
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.
Tagged:
0
Best Answer
-
Kasper Vanilla Staff
You use
Gdn::Locale()
to define translation strings too:if (conditions): Gdn::Locale()->SetTranslation('string', 'translation'); endif;
Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
6
Answers
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';
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Yes, I need a category-based text of the button.
There was an error rendering this rich post.
Yea you can call it whatever you want using the $Definitions
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
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.
You use
Gdn::Locale()
to define translation strings too:Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
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:
the key here is get the correct values for the text in the image to match up to the button.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
Just made http://vanillaforums.org/addon/categorybasednewdiscussionbuttontext-plugin-0.1
Thank you.
There was an error rendering this rich post.
@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 !!
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌