Closed X0rD3v1L closed 1 year ago
Ref: INT-3005
I want to call a react component onClick of the custom plugin icon of the toolbar. Is there any way to do that?
Here's an example of calling a react callback from a custom plugin:
https://codesandbox.io/s/custom-plugin-calling-react-0w5710
is there a way to write these plugins other than public folder of the project
There are 2 alternatives:
public/PATH/FILE.js
(names should not matter) file in the public folder and add it to external_plugins
as { PLUGINNAME: "/PATH/FILE.js" }
where PLUGINNAME matches what is listed in the plugin's tinymce.PluginManager.add
call.tinymce.PluginManager.add
with your custom plugin. It will use the plugin function registered in the PluginManger without trying to find a separate file. You will not need to list it in the external_plugins
.
I want to call a react component onClick of the custom plugin icon of the toolbar. Is there any way to do that?
The red underlined ones are the custom components designed. How to call a react component on the click of that any icon?![editor1](https://user-images.githubusercontent.com/46685302/188329151-a19543a0-5f44-494f-bffe-e6f29c78f043.png)
Following is the code to add pagebreak to toolbar,
And also is there a way to write these plugins other than public folder of the project as when these plugins aren't working if we write in anyother path.