Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.4k views
in Q2A Core by

Yo guys

I was wondering if anyone knows how  to add a custom field to the "ask a question" form which I can later on use in the questions list on the frontpage.

My plan is to add a custom (string) field for a subtitle which I want to show just beneath the title in the questions list on the frontpage.

Thank you!

1 Answer

+1 vote
by

You could do this via a plugin as follows:

  1. Provides an admin_form section which allows you to create a new database table which includes the postid and contents of your custom field.
  2. Register a layer which modifies the 'ask a question' box to include the extra field on the form.
  3. Register an event module which notices when a new question is created, gets the value of the submitted field via qa_post_text(...), and adds it to your database table.
  4. Register another layer which modifies the question list output, by retrieving the extra information from your table. The Mouseover Layer plugin that comes with Q2A may help you as an example.
...