CKEditor Cloud Services
The forum operates in
mode. Please head to
Thu, 07/13/2006 - 06:26
Placeholder for asp
Hi I am trying to use a placeholder to display in design mode not source mode (like the one use for flash or anchors) when I have asp code in the editor. Any Ideas on how i can do this?
Thu, 07/13/2006 - 15:02
RE: Placeholder for asp
I'm trying to do something that is sort of similar.
The placeholders for flash and anchors use the IMG tag, but the tags have extra attributes associated with them. Create some anchors and flashes and look at the innerHTML of the editor element, easiest way to do this is to go to the "Editor API usage" sample page, better yet download the Firebug extention for firefox.
You'll see _fckrealelement and _fckfakelement attributes.
If you look in _source/internals/fck_contextmenu.js , you'll see:
if ( tagName == 'IMG' && !tag.getAttribute( '_fckfakelement' ) )
This bit of code will override the context menu for IMG elements with the _fckfakelement attribute. I've tried modifying the source to an image I created in the editor to make it my own place holder, but when I switch between source and WYSIWYG mode, my image disapears.
I was able to add an extra condition in that if-statement to look for my own custom attribute to override the context menu. It worked, but it's hacking the main code, it won't work as a plugin.
I'm pretty new with this FCKeditor (< 1 week). I imagine there may be some way to override or expand the FCK_ContextMenu_GetListener function, but I'm not sure.
I hope that helps get you started, and maybe someone else can comment on what I said.