Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
2.0k views
in Plugins by

How i add Source Editing Area for wysiwyg editor?

I'm download plugin and copy paste ckeditor/plugins folder. After i add config.js file

config.extraPlugins = 'sourcearea';
But its not worked. How i add my editor Source botton.
Q2A version: 1.7

2 Answers

+3 votes
by
selected by
 
Best answer

Follow these steps:

1. Download the Source Editing area plugin from http://ckeditor.com/addon/sourcearea

2. Put the sourcearea folder in the .zip file in qa-plugin/wysiwyg/ckeditor/plugins

3. Edit the qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php and add exactly this line:

"        { name: 'source', items: [ 'Source' ] },",

Immediately below this line:

"        { name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteFromWord', '-', 'Undo', 'Redo' ] },",

4. In that file also add this line:

"    extraPlugins: 'sourcearea',",

Immediately below this line:

"    language: " . qa_js(qa_opt('site_language')) . ",",

And that's it. You should see something like this :)

by
I am not able to follow step 3 on your instruction as there is no such line of code exists in the qa-wysiwyg-editor.php file. Could you please help me to install source editing?
by
I found a sufficient answer here - http://www.question2answer.org/qa/50180/source-editing-area-wysiwyg-editor-that-comes-with-version - however I had to modify config.extraPlugins: 'sourcearea'; to config.extraPlugins = 'sourcearea'; (notice [:] was changed to [=].
by
@btwebgroup.com: I'd rather configure the .php plugin file as that's where Q2A sets the configuration of CKEditor, leaving untouched as much as possible of the internal CKEditor configuration. Still, it is a matter of choice. BTW, your comment about using "=" instead of ":" is irrelevant (and misleading) for this answer.
0 votes
by

Hi @pupi1985 I am not able to follow step 3 on your instruction as there is no such line of code exists in the qa-wysiwyg-editor.php file. Could you please help me to install source editing?

by
Did you try this:
https://github.com/amiyasahu/q2a-express-editor
The plugin has code editor built in.
by
Yes, I did. I prefer to use ckeditor. If I can only just successfully add the source plugin to the editor. It can be done if someone here can give me instruction to follow. My ckeditor version appears to be different from what pupi1985 gave instruction on.  Thanks for the suggestion.
...