Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
964 views
in Q2A Core by
Can anyone provide the necessary code so that I can place the ask box at top of homepage above the default questions? Have been trying to achieve this all afternoon without success. Help would be much apreciated. Thanks.
by
I also want to do this! trying but couldn't succeed yet.
by
What do you mean by askbox? Could you provide an image?

3 Answers

0 votes
by

Did you try copying the code that is on the top of the Q2A page? Here it is:

<form method="POST" action="./ask">
  <table class="qa-form-tall-table" style="width:100%">
    <tbody><tr style="vertical-align:middle;">
      <td class="qa-form-tall-label" style="padding:8px; text-align:right;" width="1">
      Ask&nbsp;a&nbsp;question:
      </td>
      <td class="qa-form-tall-data" style="padding:8px;" width="*">
      <input name="title" type="text" class="qa-form-tall-text" style="width:95%;">
      </td>
    </tr>
  </tbody></table>
  <input type="hidden" name="doask1" value="1">
</form>

You would need to put that in one of your theme functions. You can check the current page using the variable $this->request.

It's possible that you put the form inside the main page for already on the page, so make sure that the two forms are completely separate.

0 votes
by
In version 1.4, you can simply add the widget and put it in the page. Try the available options and see what fits your needs. :)
0 votes
by
Is there a way of adding the askbox into qa-theme.php by using something like $this->askbox(); .... ?
...