
Set global tiny_mce_options
Reported by Gabriel Sobrinho | July 16th, 2009 @ 09:00 AM
Hello,
I'm using TinyMCE on my application and I setting the same config at all controllers which uses it.
I don't find any method to set the default options. It's possible?
Thank you
Comments and changes to this ticket
-
Kieran P July 20th, 2009 @ 09:14 AM
Hey Gabriel,
A global tiny mce options setting isn't built in yet. Would be nice to have (will add to the todo), but I'd welcome a patch (with tests) beforehand.
Meanwhile, what I do is set a constant in an initializer with the settings, and reuse that constant on the controllers, which works well.
Regards
Kieran -
Gabriel Sobrinho July 22nd, 2009 @ 01:24 AM
Hey Kieran,
Thanks for response. I created a method just overwrite the uses_tiny_mce to get what I want. You can see it here: http://pastie.org/private/audjsylhgew7neo3gvt1ig
I think you create a method to be called on ApplicationController (ie: set_default_tiny_mce_options {}) and merge this options with given options of uses_tiny_mce.
I will write this as soon possible and publish here. If you can do it before, please make it.
Regards
-
Kieran P January 11th, 2010 @ 10:23 AM
- State changed from new to resolved
Thanks for some recent contributors, we now have the ability to set global options in config/tiny_mce.yml. The hierarchy is now as follows: (each one overrides options above it)
- config/tiny_mce.yml (the base file for every tinymce editor on the site)
- Controllers (when you call uses_tiny_mce, you can pass options here for different styles per controller)
- Views (when you call init_tiny_mce_if_needed, you can pass options to this, so you can have different tinymce settings per layout.
This should cover most cases, giving enough flexibility.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A Ruby on Rails plugin that allows easy implementation of the TinyMCE editor into your applications.