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.

How to force "Ask a Question" instead of "New Discussion"?

In your recent bog post you show how GATK has used the Q&A plugin. I went to their site and I see that they are forcing "Ask a Question" as the default for new discussions, rather than "New Discussion." How do I do this?

I have the plugin active and it's working fine; just need to know how to do the above.

What would really be great would be to be able to force "Ask a Question" as the only choice for a particular category. I think most new users will miss the distinction and take whatever is the default (New Discussion).

Tagged:

Comments

  • edited November 2012

    Remove or hide the New Discussion Link using css.
    to remove
    a.BigButton, a.BigButton:link { display: none;}

    to hide
    a.BigButton, a.BigButton:link { visibility:hidden;}

  • Thanks for your response, However, that does not force 'Ask a Question". It doesn't do anything actually.

  • You want Q&A to be the default link so people do not go for New Discussion. Removing the new Discussion link would force them to use the Q&A Link. You may be able to change where the New Discussion link goes to.

  • peregrineperegrine MVP
    edited November 2012

    add this to custom.css

    a#QnA_Discussion {
    display:none
    }

    or

    you could replace plugins/QnA/views/qnapost.php with the following:

    to

    <?php if (!defined('APPLICATION')) exit(); ?>
    <div class="P">
    
    </div>
    <style>.NoScript { display: none; }</style>
    <noscript>
       <style>.NoScript { display: block; } .YesScript { display: none; }</style>
    </noscript>
    <div class="P NoScript">
       <?php echo $Form->RadioList('Type', array('Question' => 'Ask a Question', 'Discussion' => 'Start a New Discussion')); ?>
    </div>
    <div class="YesScript">
       <div class="Tabs">
          <ul>
             <li class="<?php echo $Form->GetValue('Type') == 'Question' ? 'Active' : '' ?>"><a id="QnA_Question" class="QnAButton TabLink" rel="Question" href="#"><?php echo T('Ask a Question'); ?></a></li>
    
          </ul>
       </div>
    </div>
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • you also probably want to add this to one of your locale definitions files, or
    plugins/QnA/locale/en-CA.php or conf/locale.php

    $Definition['Start a New Discussion'] = 'Ask a Question';

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.