• Register
Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

I am trying to change the default editor in a way that I can add more fields than the simple answer.

0 votes
1,127 views
I am trying to change the default editor in a way that I can add more fields than the simple answer.  

Specifically, when providing an answer, the user can use a flash plugin that i created (that allows the user to record a 5 second audio ur upload a small audio file) and that would be added as another field to the answer.

  So the question is, where should I start in order to add another field to the default editor (Or the wysiwyg editor) for the answer field that allows the user to attach an external file.  

Any suggestions are much appreciated.
asked Nov 3, 2011 in Q2A Core by Micangello

1 Answer

+1 vote
 
Best answer

You're not adding to the editor, I don't think, you're adding to the answer form.  You have to edit the $form array.  Something like this:

        function form($form) {
            
            if($form['title'] == qa_lang_html('question/your_answer_title')) {
                $form['fields'][] = array(
                    'value' => 'your html',
                    'type' => 'static',
                );
            }

            qa_html_theme_base::form($form);
        }

Then you parse it on submit with qa_post_text('your_field_name');

answered Nov 3, 2011 by NoahY
selected Nov 4, 2011 by Micangello
Thanks NoahY I'll give it a shot.
Your plugins are all great!
Hi Naoh, i am using syntax highlighter plugin. But the user have to manually type like [code=sql] select * from emp  [/code]. But the problem there is no way on this editor to inform the user how to add code. For instance, stackoverflow editor gives to hint how add code,links etc.

Another solution will be to add an icon  for code on the existing q2a editor.
Also, i would like to know whether its possible to replace this ckeditor with jcedtor or other open source editor.
...