Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
580 views
in Plugins by
Hi,
I want to allow titles also for answers.
Meaning that when answering a Q each answer form will also have a title field to fill. (would be send to the $title field in the qtoa_posts table registered as 'A' of course).
 
Looking in the Widget $template value list ( http://www.question2answer.org/modules.php?module=widget
there is no 'answer' option, so my questions are:
 
 Is this the right way to do so? If not please advise?
If it is, how do I define a new 'answer' value  for $template?
 

 

Q2A version: 1.6.2

1 Answer

0 votes
by

You need to do some customization and may need to alter posts table. What I am describing here is just for an idea and a logic but there could be a better way to do.

First step:

  • Create a column in qa_posts "answer_title" or if you want to create new table do that with FOREIGN KEY to answer ID with CASCADE
  • Add a text input field to the new answer form as well as edit answer form using layer.

Second Step

  • On answer create or edit event store/update the "answer_title" value to the newly created colum or table (a_post and a_edit)

Third Step

  • Fetch the value from the table using custom query or modifying the list array variable (I haven't tested it yet but I am sure you can at least get by custom query if not modifying the list array variable)

All is done...

 

by
Thank you jatin.soni!
I have found this plugin that might help

http://www.question2answer.org/qa/23346/new-plugin-extra-question-field?show=23346#q23346

Still, trying to understand the dynamic of Q2A...
...