Code in CKEditor
Hey all,
I am not really sure how I can include code inside the WYSIWYG. Whenever I try and add some Javascript or XML code snippets it just gets hidden on the blog page.
Any idea how I can fix this?
Maybe try a plugin for CKEditor? Something like this but I don't have experience using it. I have tried several other plugins for ckeditor before, but not for code. Make sure though that the plugin is compatible with CKEditor version 3.6.6 (the one used in forkcms). Copy the plugin to the plugins folder of ckeditor and edit /src/Backend/Core/Js/backend.js
to activate the plugin and maybe add a button to the toolbar.
If you want to add some javascript, maybe you can just open the "code" view and add some code like:
<script>
window.alert("hi");
</script>
This snippet gets executed if I add it through the code view...
Please try option for CKEditor:
config.allowContents = true;
Also I recommend you to use the Doksoft plugin HTML Insert for CKEditor. Maybe this what you want. Plugin highlights HTML syntax and helps to create new code and edit selected existing code. You can try plugin here: doksoft.com/soft/ckeditor-html-insert/demo.html