I have attached my richeditor to a css file for styling in the editor but whenever I make a change it doesnt update in the editor. It seems like it is being cached.
The backoffice uses the ClientDependency caching library for loading stylesheets and scripts - this could be the root of the problem.
If I remember rightly, there's a ClientDependency.config file which contains configuration switches - through this, you should be able to disable path-specific CSS caching (using <location path="/umbraco">...</location>, for example) for anything under the /umbraco directory. This way, you can force the control set not to cache the backoffice CSS (which is what the TinyMCE editor loads up - a subset of your original CSS file). Either that, or it's manually deleting everything in ~/App_Data/Temp/ClientDependency every so often.
I will try that. I have been trying to force a browser refresh but it didnt work. Then found if i placed cursor inside the rich text editor and forced a refresh then it updates.
If you open the config-file from /config/ClientDependency.conifg and increase the version by one, that should reset tha cache. Maybe that would do the trick?
I'm not sure the RTE uses ClientDependency to load your custom CSS, I think it just loads it normally. But I also have this issue sometimes and it's usually my browser caching the file. After making a CSS change to a stylesheet used by the RTE, I always do the following which works for me:
- After making the CSS change, click the link below the CSS filename to open it in your browser - Hold shift and click refresh - You should now see the changes and the RTE should as well
I'm also chiming in. If the steps written by Tom above does not help I sometimes find it neccesary to simply recycle the app pool for the changes to take effect. It's usually the last resort but afterwards it's been working for me without further problems.
Just confirming I has the same problem and Toms solution worked fine for me.
Add my custom css to the rte.css file.
Open up that exact same file in the browser /css/rte.css
Force refresh (usually Ctrl+F5) - You will know it has fixed because you should now see your custom css within the file when previously it probably wasn't there due to the caching of the old version.
Open up Umbraco back-end content editor and you should see that the css changes have pulled through into the rich text editor. Sometimes I also force refresh the umbraco back-end for safe measure but I think that is nu-nessesary.
Its always worth checking the html within the rich text editor using firebug or chromes inspector. You should quickly see if your custom css is present.
Richeditor CSS styling caching issue
I have attached my richeditor to a css file for styling in the editor but whenever I make a change it doesnt update in the editor. It seems like it is being cached.
Any help would be appreciated.
Hi Craig,
The backoffice uses the ClientDependency caching library for loading stylesheets and scripts - this could be the root of the problem.
If I remember rightly, there's a ClientDependency.config file which contains configuration switches - through this, you should be able to disable path-specific CSS caching (using <location path="/umbraco">...</location>, for example) for anything under the /umbraco directory. This way, you can force the control set not to cache the backoffice CSS (which is what the TinyMCE editor loads up - a subset of your original CSS file).
Either that, or it's manually deleting everything in ~/App_Data/Temp/ClientDependency every so often.
HTH,
Benjamin
Hi thanks Benjamin,
I will try that. I have been trying to force a browser refresh but it didnt work. Then found if i placed cursor inside the rich text editor and forced a refresh then it updates.
Thanks
If you open the config-file from /config/ClientDependency.conifg and increase the version by one, that should reset tha cache. Maybe that would do the trick?
Thanks Markus and Benjamin,
Will give this a try.
Craig
Hi Craig,
I'm not sure the RTE uses ClientDependency to load your custom CSS, I think it just loads it normally. But I also have this issue sometimes and it's usually my browser caching the file. After making a CSS change to a stylesheet used by the RTE, I always do the following which works for me:
- After making the CSS change, click the link below the CSS filename to open it in your browser
- Hold shift and click refresh
- You should now see the changes and the RTE should as well
-Tom
Hi Craig
I'm also chiming in. If the steps written by Tom above does not help I sometimes find it neccesary to simply recycle the app pool for the changes to take effect. It's usually the last resort but afterwards it's been working for me without further problems.
/Jan
Just confirming I has the same problem and Toms solution worked fine for me.
Add my custom css to the rte.css file.
Open up that exact same file in the browser /css/rte.css
Force refresh (usually Ctrl+F5) - You will know it has fixed because you should now see your custom css within the file when previously it probably wasn't there due to the caching of the old version.
Open up Umbraco back-end content editor and you should see that the css changes have pulled through into the rich text editor. Sometimes I also force refresh the umbraco back-end for safe measure but I think that is nu-nessesary.
Its always worth checking the html within the rich text editor using firebug or chromes inspector. You should quickly see if your custom css is present.
Hi David....
Thanks for the reply luckily my query was from nearly 5 years ago and we've moved to version 7 :)
Loving the enthusiasm though, thanks for the feedback, it might help new users :)
is working on a reply...