This discussion is related to the
Q&A addon.
hi, i've seen this come up before without a detailed response, so nudging the question here:
is there a simple way to set the plugin behavior so that the default behavior for a user clicking on "start a discussion" is actually "start a discussion" with an option to "ask a question"? (right now, as most are aware, it defaults to "ask a question" and inserts that text above the input box, creating possible confusion for a user
alternatively, would it be possible to separate out the action such that a *new* button is inserted in the upper right (default theme example) below "start a discussion" that says" ask a question"? i was thinking about doing this with "pockets" but am not sure what code snippet would go there, nor how i would then remove the option from the standard "start a discussion" link prompting a user to once again "ask a question"
1 • •
Answers
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@ passing notes
I'm too waiting for a similar functionality. Pls let me know if you have made some progress on this.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •i would be happy to know how to default to start a discussion too.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I didn't look into how to make this an "option" in the plugin itself, but to change the default
open class.qna.plugin.php and change line 395:
from: $Form->SetValue('Type', 'Question'); to: $Form->SetValue('Type', 'Discussion');
you can also change the order the tabs are displayed by modifying qnapost.php
and swapping the order of lines 15 and 16.
I just implemented this on my forum.
homebrewforums.net you can test it out if you like.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •i figured it out myself in case anyone needs the code, here it is
change in class.qna.plugin.php line 412 to 414 from
to
that works for me so far
edit: oh i did not reload the page before posting : ) thanks for your reply though
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •i would not change line 414. if i'm reading the code right, it's a failsafe condition that originally said, if you can't get the value of Type from the page, just default to the standard discussion because something is wrong. In my code i have both lines setting the value to Discussion.
maybe @todd can check my understanding of the code.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong.
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •thanks for letting me know, i did not realize that
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •before changing i can only start questions
after changing i can only start discussions
in case of hbf with two lines 'Discussion' i can start only a discussion, too
$Form->SetValue('Type', 'Discussion'); } elseif (!$Form->GetValue('Type')) { $Form->SetValue('Type', 'Discussion');onclick the Buttons "Ask a Question" or "start Discussion" happens nothing
i think there is an function missing, but which
My Vanilla Version 2.0.18.1
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •So, which is the best way to implement this functionality because if you are using the mobile theme, users do not have the opportunity to start a discussion at all.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I'd vote for the 'ask a question' button in the top right under the 'start a discussion' button too please. Needs to be clear from the beginning for my users and the current format isn't.
Thank you :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Not to resurrect a dead topic but this seems to work... also had to reorder the buttons as @hbf had suggested
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •I did the same as @Waterskiaddict - changed 411 line to @hbf suggestion:
And now Start a discussion option is chosen by default.
But the order of the buttons is still the same - Ask a Question still comes first. And I wonder how do I change this?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Your question was answered previously...
Did you do this?
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong.
- Spam
- 1Abuse
- Troll
-1 • Off Topic Insightful Awesome LOL •OMG, I've totally misunderstood all messages :(
First, I thought that post with code lines was yours, but it belongs to @fh111. Second I have not noticed your comment about the line 414 - and I agree with you, that line should not be changed. And finally, I have not noticed your remark about swapping the order of lines 15 and 16 - it helped me to change the order of the buttons.
Please, forgive me and thank you so much!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •No worries. Glad it worked for you.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •