Until now I'm seting up CSS data like this:
Is it possible to add/change CSS data not by passing a file (like I'm doing now), but directly by passing it as value (string, text) ?
Regards,
Peter
CKEDITOR.config.contentsCss = 'css.php';
Is it possible to add/change CSS data not by passing a file (like I'm doing now), but directly by passing it as value (string, text) ?
Regards,
Peter
Re: How to add CSS on the fly?
Re: How to add CSS on the fly?
Hi Jason, no - not realy... I have to embed changes in my css.php, and then I have to reload everything...
Cheers, Peter
Re: How to add CSS on the fly?
The approach I took was to make a URL on the server which generates the CSS dynamically.
The HTML page which loads the editor is also generated dynamically, and so it can do something like:
to point to the dynamically generated css. Works nicely.
The other approach I briefly considered was altering wysiwygarea/plugin.js, where it says
but obviously this involves changing the editor source code.
cheers .. Jason
Re: How to add CSS on the fly?
Re: How to add CSS on the fly?
Hi Gary,
I tried this in instanceReady, with the css I had previously been fetching using CKEDITOR.config.contentsCss, but it didn't affect how the contents were styled.
Any ideas?
thanks
Jason
Re: How to add CSS on the fly?
Re: How to add CSS on the fly?
Pagecss is created before this step. This works perfectly the first time the replacement happens. Subsequent ones don't work. The divs get replaced to editors, but the editor doesn't have the Pagecss. Any ideas?
Re: How to add CSS on the fly?
Can you post on how to do this? I've been looking for months now. Not sure how you call a function from an instance before the instance exists.
Re: How to add CSS on the fly?
Found out how to do it finally.
Re: How to add CSS on the fly?
we had the same problem, until we figured out, that our PHP script should send the proper Content-type. Just add this into your PHP, before any output:
Thanks,
Martin