Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
2.4k views
in Q2A Core by
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.

1 Answer

+1 vote
by
selected by
 
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');

by
Thanks NoahY I'll give it a shot.
Your plugins are all great!
by
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.
...