Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The API allows the creation of a 'Drupal WYSIWYG' plugin that acts as a generic way to develop a plugin for multiple WYSIWYG implementations including a button in an editor's menu and some detection of context that can be used to pass data about what is selected when a plugin's button is used. Some editors (CKEditor and TinyMCE to name a couple) also have a context menu plugin that appears when a user right clicks in the editor.
It could include some additions to the API, but I think the extra settings could be optional. This is what I would propose:
- Title of context menu item - Use icon title by default.
- When to show the menu item:
- When the plugin's content is selected - Default.
- Always.
- Never.
- Allow to provide custom function? (Not sure how well it would be supported)
- Icon - Use regular menu icon by default. May not be necessary to allow it to be overridden.
Comment | File | Size | Author |
---|---|---|---|
#1 | media-context_menu_item_example-2243695-1.txt | 814 bytes | jmuzz |
#1 | wysiwyg-context_menu_items-2243695-1.patch | 2.45 KB | jmuzz |
Comments
Comment #1
jmuzz CreditAttribution: jmuzz commentedHere's a sample implementation:
I probably won't have time to do more work on this.