The easiest thing would be to create your own view for that module.
Copy the theme you are using and make it a new theme. In your theme, copy /applications/vanilla/views/modules/newdiscussion.php to /themes/YOURTHEME/views/modules/newdiscussion.php
You can now edit this copy. You should enclose 2 lines in there:
You need $Question['Text'] and Question['Url'] for your custom html and by unsetting the value, you prevent Vanilla from rendering a button with a dropdown arrow.
You would need to write some lines of JavaScript that change the link of the button depending on the radio button to either $this->Button['Url'] or $Question['Url'] and you can consider to also change the text of the button to either $this->Button['^Text'] or $Question['Text']
I followed the steps in the first 3 comments from the top, and it all works fine, but I get this big error when I click Unanswered Questions in the menu.
@okhawaja said:
I followed the steps in the first 3 comments from the top, and it all works fine, but I get this big error when I click Unanswered Questions in the menu.
I
A professional TIP - if you are not using Q & A version 1.2.1 - you are in the wrong discussion.
A second professional tip - If you are not using Vanilla 2.1 - you are in the wrong discussion
A third tip - warnings are warnings - turn off debugging if you don't want warnings.
with Q & A 1.2.4
-1 ignore everything you have read above regarding changes, since you do not have the same versions.
if you are totally confused, then start a new discussion - list your version of vanilla, and your version number of QNA and what you want to accomplish.
if you are not confused , then start a new discussion - list your version of vanilla, and your version number of QNA and what you want to accomplish.
Comments
The easiest thing would be to create your own view for that module.
Copy the theme you are using and make it a new theme. In your theme, copy /applications/vanilla/views/modules/newdiscussion.php to /themes/YOURTHEME/views/modules/newdiscussion.php
You can now edit this copy. You should enclose 2 lines in there:
You need
$Question['Text']
andQuestion['Url']
for your custom html and by unsetting the value, you prevent Vanilla from rendering a button with a dropdown arrow.You would need to write some lines of JavaScript that change the link of the button depending on the radio button to either $this->Button['Url'] or $Question['Url'] and you can consider to also change the text of the button to either $this->Button['^Text'] or $Question['Text']
@R_J Wow, thanks very much for that!
After adding The Big Button option part A code giving error from Unanswered question page. (something has gone wrong)
help me @peregrine @R_J
You are really confusing me...
https://vanillaforums.org/discussion/comment/232524/#Comment_232524
It's not working on
Version 2.2.1
I followed the steps in the first 3 comments from the top, and it all works fine, but I get this big error when I click Unanswered Questions in the menu.
I
Also, in the comments section I get this warning.
A professional TIP - if you are not using Q & A version 1.2.1 - you are in the wrong discussion.
A second professional tip - If you are not using Vanilla 2.1 - you are in the wrong discussion
A third tip - warnings are warnings - turn off debugging if you don't want warnings.
with Q & A 1.2.4
-1 ignore everything you have read above regarding changes, since you do not have the same versions.
all you need to make big buttons
-2 $Configuration['Plugins']['QnA']['UseBigButtons'] = TRUE;
in 1.2.4 you will see public function discussionController_render_before($sender) { you might change discussion to discussions.
you might also comment this part out, not sure.
if ($Sender->Data('Discussion.Type') == 'Question') {
$Sender->SetData('_CommentsHeader', T('Answers'));
}
you also need to change
-3 in the module
use return instead of echo.
return Anchor(T('Ask a Question'), '/post/question', 'Button BigButton NewQuestion');
as far as I can tell this version Version' => '1.3', also might have bugs. https://github.com/vanilla/addons/blob/master/plugins/QnA/class.qna.plugin.php#L11
if you are totally confused, then start a new discussion - list your version of vanilla, and your version number of QNA and what you want to accomplish.
if you are not confused , then start a new discussion - list your version of vanilla, and your version number of QNA and what you want to accomplish.
then read the FAQ to sort modules. https://vanillaforums.org/discussion/comment/232501/#Comment_232501
and
https://vanillaforums.org/discussion/28420/frequently-asked-questions
It would be great if this add-on were updated and bug-free in the add-ons with the ability to use big buttons.
If a discussion was started two years ago - good idea to start a new discussion - since the odds are things have changed.
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.