Darius Mann
Darius Mann

Reputation: 733

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.

Upvotes: 0

Views: 464

Answers (1)

Andreas W. Wylach
Andreas W. Wylach

Reputation: 737

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.

Upvotes: 0

Related Questions