How to set Default in Q&A Plugin
rakoffron
New
I'm trying to make "ask a question" not be the default.
I'd prefer the default to be "Start a discussion".
I like the plugin but am not looking to turn the whole forum into a Q&A FAQ thing.
Even better is there a way to Only allow it Under a specific category?
0
Comments
Hi there,
I'm no expert here but wouldn't modifying the locale.php achieve this result?
If you've not created one yet, create a file called "locale.php" and upload to "/conf/".
Inside the file, include the following:
<?php if (!defined('APPLICATION')) exit(); $Definition['TEXT_HERE'] = 'TRANSLATION_HERE';So for example, if those specific words you're wanting to change are "ask a question", use:
<?php if (!defined('APPLICATION')) exit(); $Definition['ask a question'] = 'Start a Discussion';Hope this helps. You can find more information on translations / local files here:
http://vanillawiki.homebrewforums.net/index.php/Locales
http://vanillaforums.org/page/localization
That won't do. It would just change the label on the buttons, not their behaviour. A solution would be to override, in the theme, the
qnapost.phpview that comes with the Q&A plugin, and change this line:<?php echo $Form->RadioList('Type', array('Question' => T('Ask a Question'), 'Discussion' => T('Start a New Discussion'))); ?>to this:
<?php echo $Form->RadioList('Type', array('Question' => T('Ask a Question'), 'Discussion' => T('Start a New Discussion')), array('Default' => 'Discussion')); ?>I haven't tested it, but it should default the selection to Discussion.
My shop | About Me
the line I see is in /plugins/views
<?php echo $Form->RadioList('Type', array('Question' => 'Ask a Question', 'Discussion' => 'Start a New Discussion')); ?>I can't find qnapost.php anywhere in the themes folders.
Doesn't have the "T's" in it. are those escape characters?
also the Number of close parenthesis don't match.
Precisely. You have to copy that view in your theme's
viewsfolder and modify it (hence the "override it in your theme"). Do not modify the original one in plugin folder.T()is a global translation function. I must have added it in my own custom version of the plugin.It does match, as far as I can see. Anyway, that's not a big deal, my example is a suggestion, not a fully tested solution.
My shop | About Me