Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active January 31, 2022 17:00
Show Gist options
  • Save stevewithington/7451982 to your computer and use it in GitHub Desktop.
Save stevewithington/7451982 to your computer and use it in GitHub Desktop.
Mura CMS : Example of how to create a custom instance of CKEditor with CKFinder in Mura CMS.
<!---
Form more information on configuration of CKFinder, visit:
http://docs.cksource.com/ckfinder_2.x_api/symbols/CKFinder.html#.setupCKEditor
--->
<cfoutput>
<form>
<label for="yourTextAreaID">Your Message</label>
<textarea id="yourTextAreaID" name="frm-message" class="htmlEditor">
</textarea>
</form>
<script>
$(document).ready(function() {
$('textarea##yourTextAreaID').ckeditor(
{
toolbar: 'Default'
, customConfig: context + '/requirements/ckeditor/config.js.cfm'
}
, customHtmlEditorOnComplete
);
});
function customHtmlEditorOnComplete(editorInstance) {
var instance = $(editorInstance).ckeditorGet();
instance.resetDirty();
CKFinder.setupCKEditor(instance , { basePath: context + '/requirements/ckfinder/' });
}
</script>
</cfoutput>
@charlesr1971
Copy link

Please could someone tell us how we get the:

context

Path?

Otherwise, this brilliant code is useless. Thanks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment