tinymcewysiwygpimcore

PIMCORE: How to globally configure TinyMCE (WYSIWYG) for data object? (Version 11.1.4)


The only thing which is documented is how to configure EDITABLE WYSIWYG. But not how to configure DATA OBJECT WYSIWYG.


Solution

  • Take a look into the editor.js file of the TinymceBundle, located in public/bundles/pimcoretinymce/js/. All you need to do is to set the custom configuration with the correct subspace, in your case object instead of document.

    To give an simple example of a configuration skeleton for the datatype text (wysiwyg):

    const defaultConfig = {
        // your configuration values
    };
    
    pimcore.object.tags.wysiwyg = pimcore.object.tags.wysiwyg || {};
    pimcore.object.tags.wysiwyg.defaultEditorConfig = defaultConfig;
    

    That's about it.

    Do not forget to load your configuration at runtime using an event listener or implementing getEditmodeJsPaths in your bundle class. For more info check the readme file of the TinymceBundle.