Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to add the custom action(variable) #337

Open
TechWhiz10 opened this issue Oct 5, 2023 · 3 comments
Open

Question: How to add the custom action(variable) #337

TechWhiz10 opened this issue Oct 5, 2023 · 3 comments

Comments

@TechWhiz10
Copy link

Hi, @artur Arseniev.
Grapesjs is very awesome. just like WordPress or Bubble.

I made a function using GrapesJS/grapesjs#481.
editor.RichTextEditor.add('custom-vars', {
icon: <select class="gjs-field"> <option value="">- Select -</option> <option value="[[firstname]]">FirstName</option> <option value="[[lastname]]">LastName</option> <option value="[[age]]">Age</option> </select>,
// Bind the 'result' on 'change' listener
event: 'change',
result: (rte, action) => rte.insertHTML(action.btn.firstChild.value),
// Reset the select on change
update: (rte, action) => { action.btn.firstChild.value = "";}
})

It works well in grapesjs-plugins-newsletter. but it doesn't work in grapesjs-mjml.
Sometimes it works.

![Uploading image.png…]
error
()

I don't know why it doesn't work.
How can I resolve this problem?

@LcsGa
Copy link

LcsGa commented Nov 15, 2023

Hi have the exact same issue for the exact same need!

@LcsGa
Copy link

LcsGa commented Nov 15, 2023

Did you find a solution @TechWhiz10?

@TechWhiz10
Copy link
Author

@LcsGa not yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants