I want to add wysiwyg editor in store configuration. I added also. But, when I click on "Insert Variable" it's return error :

Uncaught ReferenceError: MagentovariablePlugin is not defined

How to solve this error?

Any help would be appreciated !!


1 Answer 1


I found answer for that. Follow this below steps to solve this issue :

Add Field in system.xml file :

<field id="wysiwyg_editor" translate="wysiwyg" sortOrder="4" type="editor" showInStore="1" showInDefault="1" >
    <label>wysiwyg editor</label>

Now, create file for add wysiwyg editor in element :



namespace Vendor\Module\Block\Adminhtml\System\Config;

use Magento\Framework\Registry;
use Magento\Backend\Block\Template\Context;
use Magento\Cms\Model\Wysiwyg\Config as WysiwygConfig;
use Magento\Framework\Data\Form\Element\AbstractElement;

class Editor extends \Magento\Config\Block\System\Config\Form\Field
* @var  Registry
protected $_coreRegistry;
* @param Context    $context
* @param WysiwygConfig $wysiwygConfig
* @param array      $data

public function __construct(
     Context $context,
     WysiwygConfig $wysiwygConfig,
     array $data = []
) {
     $this->_wysiwygConfig = $wysiwygConfig;
     parent::__construct($context, $data);
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
     // set wysiwyg for element

     // set configuration values

     return parent::_getElementHtml($element);

Now, create adminhtml_system_config_edit.xml for update editor handle :


<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="editor"/>

Clean cache and it's working.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.