Loading CKEditor php variable

Hi, I am currently going through the process of upgrading from FCKEditor to CKEditor which is proving more tricky that first thought.

The first issue I am having is I want to set a variable in the function to load the content - rather than just loading the content (the reason is incase I decide to use another name for a different field for the editor). Here is my current function:

function get_editor($name, $value = '') {
	$ckeditor = new CKEditor();
	$ckeditor->basePath = '/ckeditor/';
	$ckfinder = new CKFinder();
	$ckfinder->BasePath = '/ckfinder/'; // Note: BasePath property in CKFinder class starts with capital letter

As you can see I want to use the $value = ‘’ part by the editor(‘content’) … I have tried many various different ways such as editor = $value etc. and the majority of the time the loader just does not load.

Any suggestions would be great.

Also, the next issue I am having is load the content from the database into the CKEditor. - I used this line on the FCKEditor before:

<?php get_editor('content', check_output($page['content'], true, false, false)); ?>

but this does not work. the get_editor function is above, and the check_output function is:

function check_output($output, $allow_html = false) {
	if ($allow_html == true) {
		$output = html_entity_decode($output, ENT_QUOTES);

	return $output;

Any help at all would be very much appreciated.

Thanks for reading :slight_smile: