Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
When i edit a richtext, image paths are broken (they are coded relative) and the css styles are not used either.

Any way to fix that?

THANK YOU!
Hi,

If the text being edited contains relative paths, CKEditor will try and resolve them relative to the admin panel and not relative to your site and this leads to broken paths.

To make CKditor resolve the paths relative to your site (or whatever absolute path you wish), you can try and do the following -
Go to 'couch/includes/ckeditor/'
Find 'config.js'. Edit it to add the following line -
Code: Select all
config.baseHref = 'http://www.yoursite.com/';

Make sure to put in the absolute path of your site relative to which your image paths are.
The edited config.js should end up looking like this -
Code: Select all
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

CKEDITOR.editorConfig = function( config )
{
   // Define changes to default configuration here. For example:
   // config.language = 'fr';
   // config.uiColor = '#AADC6E';

    config.language = 'en';
    config.baseHref = 'http://www.yoursite.com/';
};


Please let me know if this helped.
Thanks.
Thank You! That worked with the images. Great stuff.

Any idea about the css?
Hi,

To make CKEditor use the CSS of your website, you can set the 'css' parameter of the 'editable' tag defining the editable region e.g.
Code: Select all
<cms:editable name='desc' label='Description'
    desc='Enter description of property here'
    css='styles/editor_styles.css'   
    type='richtext'/>

If the path provided to the 'css' parameter is not absolute, it is assumed to be relative to the main site.

You can find more details in the documentation at http://www.couchcms.com/docs/tags-refer ... htext.html

Hope this helps. Do let us know.
Thank you for the quick help.

Unfortunately, it does not work for me...

I use
Code: Select all
<cms:editable name='Inhalte' css='http://site.de/light.css' type='richtext'>


to start the region, but it does not load the css in the editor. Hmmm...
nevermind, it works!!!

Thank you!
6 posts Page 1 of 1
cron