BlogCFC with FCKEditor/CKEditor or TinyMCE

124 views
Skip to first unread message

lahue

unread,
Oct 13, 2010, 5:25:20 PM10/13/10
to BlogCFC
I have been trying all day to integrate my blog with any WYSIWYG
editor, particularly FCK/CKEditor and TinyMCE. When implementing FCK
either BlogCFC does not receive the text from the editor or the editor
does not send it because my blog posts come out as undefined. And as
far as TinyMCE, well, I am not even able to see the editor.

Does anyone have instructions on how to integrate the latest version
of any of these options with the latest BlogCFC version?

Stephen Moretti

unread,
Oct 14, 2010, 8:39:27 AM10/14/10
to blo...@googlegroups.com
How are you currently trying to integrate your RTE of choice? Are you editing the textarea.cfm tag?

Stephen

--
Stephen Moretti
Blog : http://nil.checksite.co.uk/
Twitter : http://twitter.com/mr_nil

Stephen Moretti

unread,
Oct 14, 2010, 8:41:05 AM10/14/10
to blo...@googlegroups.com
On 13 October 2010 22:25, lahue <lahu...@gmail.com> wrote:

lahue

unread,
Oct 14, 2010, 10:01:01 AM10/14/10
to BlogCFC
On Oct 14, 7:41 am, Stephen Moretti <stephen.more...@gmail.com> wrote:
Well I followed the tut on http://blog.critical-web.com/blog/index.cfm/2008/1/12/Configuring-FCKeditor-with-BlogCFC
but the code would not create the editor. So I used:
<cfmodule
template="../fckeditor/fckeditor.cfm"
basePath="../fckeditor/"
instanceName="myEditor"
value='<p>This is some <strong>sample text</strong>. You are using <a
href="http://www.fckeditor.net/">FCKeditor</a>.</p>'
width="100%"
height="200"
>

And that created it, but when I submit I either get the error to enter
in body txt or it generates the body as undefined.

lahue

unread,
Oct 14, 2010, 9:58:45 AM10/14/10
to BlogCFC
Stephen: I am trying to use FCKEditor due to its more extensive
features. I tried the online tutorials on various CF blogs and none
would generate the editor. Instead they would produce an error
stating that FCKEditor was undefined.

So I did what the actual FCKEditor site said:
<cfmodule
template="../fckeditor/fckeditor.cfm"
basePath="../fckeditor/"
instanceName="myEditor"
value=''
width="100%"
height="200"
>

And that successfully create the editor and then I went into entry.cfm
and changed:
</cfoutput><cfmodule template="../tags/textarea.cfm" fieldname="body"
value="#HTMLEditFormat(form.body)#" class="txtArea"><cfoutput>

To:
</cfoutput><cfmodule template="../tags/textarea.cfm" fieldname="body"
value="#form.body#" class="txtArea"><cfoutput>

I've done a little messing around and I either get an error stating to
ender body text or it submits but the blog post is "undefind"

On Oct 14, 7:41 am, Stephen Moretti <stephen.more...@gmail.com> wrote:

Stephen Moretti

unread,
Oct 14, 2010, 1:11:58 PM10/14/10
to blo...@googlegroups.com

Well if the body is ending up as undefined then that suggests to me that you have a JavaScript error in your fck editor implementation.

I might have a quick look at changing my editor to use ckeditor or tinymce later tonight if I get a chance. It shouldn't be complicated.

Stephen

lahue

unread,
Oct 14, 2010, 2:17:10 PM10/14/10
to BlogCFC
Ok let me know how it goes and post anything that you find. ;)

On Oct 14, 12:11 pm, Stephen Moretti <stephen.more...@gmail.com>
wrote:
> Well if the body is ending up as undefined then that suggests to me that you
> have a JavaScript error in your fck editor implementation.
>
> I might have a quick look at changing my editor to use ckeditor or tinymce
> later tonight if I get a chance. It shouldn't be complicated.
>
> Stephen
> >> More Twitter :http://twitter.com/CFOverflow- Hide quoted text -
>
> - Show quoted text -

Stephen Moretti

unread,
Oct 14, 2010, 6:46:54 PM10/14/10
to blo...@googlegroups.com
Sorted...

So I downloaded CKEditor and TinyMCE and had a look at both of them
Boy CKEditor has soooooo many files. I took one look and decided to implement TinyMCE instead.

It took me about about 20 minutes to get TinyMCE working as the editor locally.

Its not pretty and there appears to be some kind of theme related javascript error,  but it works. Attached is my updated textarea.cfm

You need to download the latest tinymce library and extract it into the includes folder.  
You don't need to change the entry.cfm file in the admin folder.

The updated textarea.cfm uses an advanced tinymce config with everything including the kitchen sink thrown in there, so it doesn't fit the design properly. With everything in there you will be able to cut out all the elements that you don't need and leave in those that you don't.

The way I've done this, by putting the tinymce config into the textarea custom tag, is not good.  With every call to the tag it will insert another instance of the config and the tinymce library into the head of the entry form page. It would be better to put the config that you see in the attached textarea file into the head of the page using the adminlayout.cfm file that you'll also find in the tags folder.

Hope that helps

Stephen
textarea.cfm

Raymond Camden

unread,
Oct 14, 2010, 6:51:11 PM10/14/10
to blo...@googlegroups.com
Wonder - should I add a FAQ under About? This would be a good FAQ I think.

--
===========================================================================
Raymond Camden, ColdFusion Jedi Master

Email    : r...@camdenfamily.com
Blog      : www.coldfusionjedi.com
AOL IM : cfjedimaster

Keep up to date with the community: http://www.coldfusionbloggers.org

lahue

unread,
Oct 14, 2010, 7:19:17 PM10/14/10
to BlogCFC
Stephen: Thank you for all your help. Could you clarify:
"The way I've done this, by putting the tinymce config into the
textarea
custom tag, is not good. With every call to the tag it will insert
another
instance of the config and the tinymce library into the head of the
entry
form page. It would be better to put the config that you see in the
attached
textarea file into the head of the page using the adminlayout.cfm file
that
you'll also find in the tags folder."

Would it be an option to simply replace the entry.cfm code that calls
textarea.cfm and inset the config you gave me?
> >> > >> More Twitter :http://twitter.com/CFOverflow-Hide quoted text -
>
> >> > - Show quoted text -
>
> > --
> > Stephen Moretti
> > Blog :http://nil.checksite.co.uk/
> > Twitter :http://twitter.com/mr_nil
> > More Twitter :http://twitter.com/CFOverflow
>
> --
> ===========================================================================
> Raymond Camden, ColdFusion Jedi Master
>
> Email    : r...@camdenfamily.com
> Blog      :www.coldfusionjedi.com
> AOL IM : cfjedimaster
>
> Keep up to date with the community:http://www.coldfusionbloggers.org- Hide quoted text -

Stephen Moretti

unread,
Oct 15, 2010, 3:49:35 AM10/15/10
to blo...@googlegroups.com

No. There is no need to edit the entry.cfm file.

The textarea.cfm and adminlayout.cfm files are there to enable you to do exactly these kinds of enhancements without mutating the underlying application. By editing the files like entry.cfm you open yourself to a world of pain when it comes to applying updates and bug fixes.

The tags and pods are the best and intended points at which to introduce variation into blogcfc.

Hopefully soon there will be a better point of variation for blog themes. [Hint hint nudge nudge Ray ;)]

Stephen

Reply all
Reply to author
Forward
0 new messages