Replies: 1 comment
-
Hi, I saw your message regarding the issue you were facing with rendering colors in the GrapesJS editor canvas without replacing the placeholders with the actual values. I'm curious, were you able to find a solution to this problem? If you were successful, could you please share how you accomplished it? It could be really helpful for others facing similar challenges. I am currently working on utilizing the GrapesJS editor for creating email templates, and I've encountered a specific challenge that I could use some assistance with. My situation involves certain constraints regarding how templates should be passed to the server. Specifically, I plan to utilize placeholders actively within the editor, such as @firstname, to personalize the email content. Additionally, I've implemented a custom media library that allows for adding images to the template with a placeholder attribute in the src field, following this format: @media-item-url(${itemID}). My goal is to have the actual image displayed on the canvas while still using the placeholder within the src attribute. Essentially, I aim to modify only the representation of the component without altering its underlying model. Below, I've attached some code snippets for reference. I would greatly appreciate any insights or guidance on how to achieve this functionality within the GrapesJS editor. Thank you in advance for your time and assistance.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I hope you can help me with this issue I've been trying to solve. We are currently using the grapesjs editor with the mjml plugin.
We pull in an email template written in mjml and can then edit it.
But within the template we have placeholders for text e.g.
<mj-text>Hi {{ recipient_firstname }},</mj-text>
but also for styling colors e.g.
<mj-divider border-width="1px" border-color="{{ color_primary }}" padding-top="0px" padding-bottom="0px"/>
Now the text placeholders isn't a problem as we will do something similar as suggested in #481 but we do need somehow to render the colors that represent e.g. {{ color_primary }} when shown on the editor canvas without actually replacing the placeholder with the value.
Beta Was this translation helpful? Give feedback.
All reactions