Allow editor settings to be set through hook_wysiwyg_editor_config_alter().
| Project: | Wysiwyg |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
I think I submitted a patch similar to this once before, but I was unable to find it. In the last several sites I've built I've need to adjust TinyMCE settings or configure options that do not yet exist through the UI. The last patch I submitted received the feedback, "we should make the UI support every option TinyMCE supports". I'm not entirely sure that's a good idea (that's a lot of options) and it's difficult to keep up with all the possible options for all editors.
What I'd like to propose is a hook that lets contrib (or custom in my case) modules modify the WYSIWYG configuration options after the defaults have been set by the appropriate editor .inc file. This would allow for the configuration of esoteric options that don't make sense in the UI, or changing of the defaults that are not allowed to be changed.
There's a lot of similar discussion happening over in #313497: Allow to configure advanced editor settings, including some nice hacks to work around the inability to configure these options with PHP. I'd feel better using a sanctioned method rather than manually inserting things into the Drupal.settings.wysiwyg settings.
| Attachment | Size |
|---|---|
| wysiwyg_config_alter.patch | 675 bytes |

#1
This is a great patch - thanks!
Without this functionality we would have been unable to move from tinytinymce - please commit it.
#2
Patch works fine.
But why not name it wyswiyg_edit_settings_alter. For me it does make a little more sense here.
With this hook, it is also able to build a rundimentary order buttons extra module. I know this should be included into wysiwy itself, see http://drupal.org/node/277954, but as short-time solution it would be able to use this alter hook.
#3
The name
wyswiyg_edit_settings_alteris a little redundant ("edit" and "alter"). Perhaps you meanwyswiyg_editor_settings_alter? That would be fine by me, of course we'll have to wait and see what sun thinks about adding this hook at all, regardless of its name.#4
sure. I wanted to write this, too.