[SOLVED] CKEditor with ScriptCase

Dear All,

I would like to install CKEditor, but would like to know how to keep from messing up ScriptCase html functions with TinyMce, or just possibly disable them temporarily so HTML field would use CKEditor.

Thoughts and experience much appreciated.

Thank you.

Lyle

Within the fieldtype there’s no possibility to change webeditor. You can embed fckeditor in blank applications though. The html processing thing, especially the extraction of the root can be disabled by a setting in the tinyCOnfig file. See http://www.scriptcase.net/forum/showthread.php?1916-Problems-with-html-editor-loosing-the-absolute-path&highlight=tinymce

Hi Albert,

Could you give me a hint or two on installing CKEditor with blank application? Would it work for a Control application?

Thanks greatly,

Lyle

[QUOTE=lyleholc;22301]Hi Albert,

Could you give me a hint or two on installing CKEditor with blank application? Would it work for a Control application?

Thanks greatly,

Lyle[/QUOTE]

A blank application is an application where you do all the programmning yourself. I think you could do it in a control application, but you need to create the form field manually, apply the FCK editor code etc. Again I think it’s possible, but I stick to tiny.

Hi Albert,

Here’s what I’ve done. I unpacked CKEditor in a ckeditor directory off wwroot in program files(86), netmake. I opened the samples and text was displayed. Then I created a Blank Application pasting in the below code that is the vanilla code from CKeditor to create a rich form. It compiles fine but when I run it, an error saying ‘Unexpected <’ displays.

Appreciate any thoughts you may have.

Thanks again!!

Here is the code I pasted:

<html>
<head>
<title>Sample CKEditor Site</title>
<script type=“text/javascript” src="/ckeditor/ckeditor.js"></script>
</head>
<body>
<form method=“post”>
<p>
My Editor:<br />
<textarea id=“editor1” name=“editor1”><p>Initial value.</p></textarea>
<script type=“text/javascript”>
CKEDITOR.replace( ‘editor1’ );
</script>
</p>
<p>
<input type=“submit” />
</p>
</form>
</body>
</html>

mmm, you entered this in some event? Rembember that you are in a php environment. So you need to ‘echo’ the html code to be able to achieve your goals. So something like

echo “<textarea id=“editor1” name=“editor1”><p>Initial value.</p></textarea>”;

Thank you Albert. I’ll play around with this and also in a html editor to get the feel. I’ll let you know if I get it working and how.

Much appreciated.

Lyle

Hi Albert,

The following code produces the CKEditor properly when run outside of ScriptCase. If I place it in ScriptCase Blank Application, it gives error 'unexpected <" when the code executes and encounters the <html> tag. I tried inserting your code above at a couple places, but not successful.

Any thoughts much appreciated.

Lyle

—Code below—

<!DOCTYPE html>
<html>
<head>
<title>A Simple Page with CKEditor</title>
<!-- Make sure the path to CKEditor is correct. -->
<script src=“http://127.0.0.1:98/ckeditor/ckeditor/ckeditor.js”></script>
</head>
<body>
<form>
<textarea name=“editor1” id=“editor1” rows=“10” cols=“80”>
This is my textarea to be replaced with CKEditor.
</textarea>
<script>
// Replace the <textarea id=“editor1”> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( ‘editor1’ );
</script>
</form>
</body>
</html>

Hi Albert,

I’ve played around with the code and the following code displays a text area, but CKEditor is not displayed. I think I have something wrong in the echo statements.

Any thoughts much appreciated!!

Lyle

— code below —
echo "<textarea name=‘mydata’ id=‘mydata’>
“;
// echo htmlspecialchars($data).”
";
echo “</textarea>”;
// echo “<script>”;
echo “<script language=‘javascript’>
“;
echo “<script src=‘http://127.0.0.1:98/ckeditor/ckeditor/ckeditor.js’>”;
// echo”</script>”;
echo “CKEDITOR.replace( ‘mydata’ )”;
// echo “</script>”
echo "</script>
";

are you sure this is a correct url?

src=“http://127.0.0.1:98/ckeditor/ckeditor/ckeditor.js

I think you might have installed it in the _lib somewhere. If you enter above code does the js comes up?

Hi Albert,

This is the right url. The php file below runs just fine outside of ScriptCase. I got it working by adding ‘echo’ before the lines like you mentioned before. Just hadn’t done it properly for all the lines.

Thanks greatly!!!


Here’s the code that works fine outside of ScriptCase

<!DOCTYPE html>
<html>
<head>
<title>A Simple Page with CKEditor</title>
<!-- Make sure the path to CKEditor is correct. -->
<script src=“http://127.0.0.1:98/ckeditor/ckeditor/ckeditor.js”></script>
</head>
<body>
<form>
<textarea name=“editor1” id=“editor1” rows=“10” cols=“80”>
This is my textarea to be replaced with CKEditor.
</textarea>
<script>
// Replace the <textarea id=“editor1”> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( ‘editor1’ );
</script>
</form>
</body>
</html>

Hi Albert,

I got it working based on using echo like you said. Just didn’t have it in all the places I needed it.

Thanks so much!!!

Lyle