I'm adding wysiwyg editor in admin custom form enter image description here
All displays good and working fine, but when I click on Insert variable I have an error: Uncaught ReferenceError: MagentovariablePlugin is not defined at HTMLButtonElement.onclick
Thanks.
2 Answers 2
Create below file in your module
app/code/Vendor/Module/view/adminhtml/layout/adminhtml_system_config_edit.xml
Content for this file is..
<?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"/>
</page>
And more information and most useful link :-
How to make field as WYSIWYG editor in system.xml in configuration?
Hope this help you
Thanks ...
-
I tried to do it but it didn’t work...gleboha– gleboha2020年04月30日 21:02:24 +00:00Commented Apr 30, 2020 at 21:02
-
you check attached link ???Mohit Patel– Mohit Patel2020年04月30日 21:04:24 +00:00Commented Apr 30, 2020 at 21:04
-
I need to create app/code/Vendor/Module/Block/Adminhtml/System/Config/Form/Field/Editor.php file to my editor? I can't understand how to indicate path to this block from my fieldsetgleboha– gleboha2020年04月30日 21:11:52 +00:00Commented Apr 30, 2020 at 21:11
-
you add
system.xmlfile ???Mohit Patel– Mohit Patel2020年04月30日 21:14:48 +00:00Commented Apr 30, 2020 at 21:14 -
This file need to add editor to configuration page, but I'm need to add editor in custom form. Or I'm wrong?gleboha– gleboha2020年04月30日 21:16:21 +00:00Commented Apr 30, 2020 at 21:16
For the WYSIWYG editor, default Magento's variable.js could not load. This is the full path of the js file:
\vendor\magento\module-variable\view\adminhtml\web\variables.js
You can override this file in your custom module and call this manually by adding this file in adminhtml_system_config_edit.xml in the head block.
Get all your queries solved. I would feel grateful for doing it.