HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Some adjustments to more clearly see Ask a Question in Q & A 1.2.1 (new discussion button).
The Big Button option part A
add this to class.qna.plugin.php
public function DiscussionsController_Render_Before($Sender) { if (C('Plugins.QnA.UseBigButtons')) { $QuestionModule = new NewQuestionModule($Sender, 'plugins/QnA'); $Sender->AddModule($QuestionModule); } if ($Sender->Data('Discussion.Type') == 'Question') { $Sender->SetData('_CommentsHeader', T('Answers')); } }
above this
/** * Add 'Ask a Question' button if using BigButtons. */
add these lines to your config.php
$Configuration['Plugins']['QnA']['UseBigButtons'] = TRUE;
$Configuration['Modules']['Vanilla']['Panel'] = array('MeModule', 'UserBoxModule', 'GuestModule', 'NewDiscussionModule', 'NewQuestionModule','DiscussionFilterModule', 'SignedInModule', 'Ads');
you should now see a big button Ask a Question directly below the "New Discussion button".
maybe this will help you guys
@AbhinavG @MasterOne @der_k @JanHoos
in reference to
http://vanillaforums.org/discussion/26809/q-a-plugin-not-working
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
5
Comments
The big Button Option Part B
you also need to change QnA/modules/class.newquestionmodule.php
from
echo Anchor(T('Ask a Question'), '/post/discussion?Type=Question', 'Button BigButton NewQuestion');
to
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Either do the steps above in the previous two comment or this below
Drop Down Option (not the additional Big Button
The discussion - new question scroll down option with dropdown menu on add discussion
Another option if you don't want to use big buttons but have a scroll down like the current vanilla site.
you would change class.qna.plugin.php (uncomment it essentially)
from
to
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
BTW. this was tested in vanilla 2.1
and one needs to cut and paste correctly. If your cutting and pasting skills are not honed, you may have troubles.
you may need to use the older version of plugin for 2.0.18.x
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Awesome! It works like a charm. I went for the double button option to make sure my users won't be able to mis it
thx. Awesome. always good to get at least one person who can use the mods and provide positive feedback.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@peregrine, thanks a lot, of course it can't work if commented out. Just uncommenting those lines and the drop down is back.
@peregrine , thanks . @MasterOne , just uncommenting those lines fixes the plugin ?
@peregrine , thanks . @MasterOne , just uncommenting those lines fixes the plugin ?
yes for the dropdown box option. http://vanillaforums.org/discussion/comment/208152/#Comment_208152
if you want buttons - then you use the first option parts a and b
http://vanillaforums.org/discussion/26902/some-adjustments-to-more-clearly-see-ask-a-question-in-q-a-1-2-1-new-discussion-button/p1 first two posts.
you have to be using 2.1 and you might need to make the other fix if you get a fatal error when trying to enable the plugin prior to making modifications.
http://vanillaforums.org/discussion/comment/207522/#Comment_207522
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Problem solved here using the copy paste steps, thank you
revision of comment...
this may work better.. (for setting category button automatically, when "Asking a Question" within a category)
http://vanillaforums.org/discussion/comment/208151/#Comment_208151
The big Button Option Part B (revised)
you also need to change QnA/modules/class.newquestionmodule.php
fromecho Anchor(T('Ask a Question'), '/post/discussion?Type=Question', 'Button BigButton NewQuestion');
toecho Anchor(T('Ask a Question'), '/post/question', 'Button BigButton NewQuestion');this may work better..
change from
to
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Perfect, works like a charm! The drop-down option is the sexiest one by far, thanks @peregrine !
can u tel me in where this code add in to class.pna
public function DiscussionsController_Render_Before($Sender) {
if (C('Plugins.QnA.UseBigButtons')) {
$QuestionModule = new NewQuestionModule($Sender, 'plugins/QnA');
$Sender->AddModule($QuestionModule);
}
if ($Sender->Data('Discussion.Type') == 'Question') {
$Sender->SetData('_CommentsHeader', T('Answers'));
}
}
https://github.com/vanilla/addons/blob/master/plugins/QnA/class.qna.plugin.php#L940
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Big Button method A & B worked for me with 2.1.6 and plugin 1.2.1. I didn't attempt the other method, as I wanted the buttons.
@peregrine Please tell me how to change the order of these 2 buttons?
via module sorting in config.php
$Configuration['Modules']['Vanilla']['Panel'] = array('MeModule', 'UserBoxModule', 'GuestModule', 'NewQuestionModule', 'NewDiscussionModule', 'DiscussionFilterModule', 'SignedInModule', 'Ads');
vs.
$Configuration['Modules']['Vanilla']['Panel'] = array('MeModule', 'UserBoxModule', 'GuestModule', 'NewDiscussionModule', 'NewQuestionModule', 'DiscussionFilterModule', 'SignedInModule', 'Ads');
there are numerous discussions on module sorting, a tutorial on sorting in tutorials category and a plugin that does module sorting.
see FAQ question 28
http://vanillaforums.org/discussion/28420/faq-what-frequently-asked-questions/p1
unfortunately the FAQ is not in the Tutorials category, but you will have to live with it until it is moved.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@peregrine It's working.. thank you..!
This works thanks, I got the 2 buttons showing and the separate "Ask a Question" button knows which category it's in when it's clicked (as explained in your revised comment here) but I still have the little drop down arrow in the "New Discussion" button.
Is there any way to show the top button without the drop down arrow if you have a separate Question button?
As a suggestion for a future update What I would actually prefer is a normal discussion button with a pair of yes/no radio buttons underneath defaulting to "no", with some text asking if it is a question, like this:
I think the users on my particular forum will get confused about which button to click (and I'll get fed up trying to explain it to them) but they'll soon get the hang of choosing "Yes" if they want to be able to select the best answers.
On reflection I decided I didn't like those 2 big buttons up there so I've gone with this for the time being - I just changed the button text to make it a bit more apparent that there were more options hiding behind the arrow.
I'm ashamed to say that was a bit of a hack for my own benefit - it would be good to know if there is a safe way to change that button text?
I'd still prefer an arrow-less button with some radio buttons or an option slider below it, as in my post above.
Thanks again for the Q&A plug-in... it's a huge help for what we're trying to do with our community.