I wanted to create WYSIWYG editor in custom form frontend.
What I tried doing is :
Created
WysiwygConfig.php
file insideVendor/Extension/Plugin
directory with code :class WysiwygConfig { public function afterGetConfig($subject, \Magento\Framework\DataObject $config) { $styleArray = [ 'Hero - Image' => 'hero__image', 'Hero - Heading' => 'hero__heading', 'Hero - Action Button' => 'hero__primary-action' ]; $styles = array_map(function($title, $class) { return "{$title}={$class}; "; }, array_keys($styleArray), array_values($styleArray)); $config->addData(["settings" => ["theme_advanced_styles" => implode("; ", $styles)]]); return $config; } } ?>
Created
di.xml
file insideVendor/Extension/etc/
folder and provided plugin name with type.I have frontend template where I want to implement WYSIWYG editor.
I had followed one tutorial but that one is incomplete for me. Please help me to do it.