fckeditor and image paths (e.a. for newsletter)

Questions about how to use the online - editors and suggestions how to improve them
Post Reply
bikesnake
Posts: 1
Joined: Wed Oct 12, 2011 7:28 pm

fckeditor and image paths (e.a. for newsletter)

Post by bikesnake » Wed Oct 12, 2011 7:47 pm

Hello to all,

This is my first posting, this little CMSimple really rocks!

Maybe this might be useful for Newsletter-Plugin useres out there.

The fckeditor doesnt store the complete pathname of images, so the path must be corrected manually.
I just checked the FCK sourcecode - when changing the code like below, the path will be stored correctly.

goto -> fckeditor/editor/filemanager/browser/cmsimple/frmresourceslist.html

Code: Select all


@Line 92

	if(oConnector.ResourceType=='Image'){
		var sLink = '<a href="#" onclick="OpenFile(\'' + ProtectPath( cmsimpleUrl ) + '\'); return false; " onmouseover="ShowPreview(\'' + ProtectPath( fileUrl ) + '\'); return false;" onmouseout="HidePreview(\'' + ProtectPath( fileUrl ) + '\'); return false;">' ;
		}

replace with:


	if(oConnector.ResourceType=='Image'){
		var sLink = '<a href="#" onclick="OpenFile(\'http://www.domain.com/subdirectory/images/' + fileName + '\'); return false; " onmouseover="ShowPreview(\'' + ProtectPath( fileUrl ) + '\'); return false;" onmouseout="HidePreview(\'' + ProtectPath( fileUrl ) + '\'); return false;">' ;
		}

Important: Delete the cached browserfiles & restart the browser - else the cached html will be taken and you see no success!

testet with IE9 an Chrome -


cheers bikesnake

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: fckeditor and image paths (e.a. for newsletter)

Post by cmb » Thu Oct 13, 2011 11:08 am

Hi bikesnake,
bikesnake wrote:This is my first posting, this little CMSimple really rocks!
So welcome to the forum! :)
bikesnake wrote:The fckeditor doesnt store the complete pathname of images, so the path must be corrected manually.
Indeed it's important for the newsletter to have the absolute URL to the image (and to other resources on the server as well). But don't forget the general advantage of relative URLs: they will still work if you move the CMSimple installation to another directory or even another domain. That's the reason for the default behaviour of the FCKeditor for CMSimple.

But anyway, thanks for the tip. Might be very useful for newsletter users.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply