Add new block without any hard coding
Question
Hi @artf ,
We are gonna to embed this grapes editor into our portal as an Email editor. As the Email will be sent by the batch process to customers, merge tags will be implemented in order to replace the variables in the template by the actual values such as names, ages, addresses of the customers. At the moment, the merge tags are hardcoded in the code with the approach in https://github.com/artf/grapesjs/issues/481. Because the end users of the editor are non-technical people and as the business is growing more templates will be created with new variables (merge tags), we need to make the merge tags can be added from a button on the panel and then save the added tags to a config file or DB.
Is there any approach to achieve such sort of requirement?
One more question is that is it possible to load the blocks from a JSON/config file? Thank you very much!
Answers (3)
hi @frank-tenzing, I think you should do it on server side, not in the Grapes editor. For example create a manage form for merge tags and send it to Grapes with API-Rich-Text-Editor. This way you can make some merge tags are available for some template only.
we need to make the merge tags can be added from a button on the panel and then save the added tags to a config file or DB
Well, this is up to you building such a thing. The user creates a tag using your New Merge Tags panel and update stuff on your server, then, as already mentioned by @hoainam12k, you just use RTE API to update GrapesJS
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #952
Responsive email template builder using Grapes js
@ateshuseyin @artf - Thanks for the great plugin. We started to use Grapes js in our project as an editor for building responsive email tem...
Issue #1762
image not change while we fetch html using editor.getHtml()
Hello @artf I am using grapes.js for my website-builder tool into my website. While i double click on any image the asset-manager will open...
Issue #1817
Change HTML content while block is render in editor
Hello @artf I have one block into block manager like As per above script inside the block, i want to add dynamic HTML content while this bl...
Issue #795
editor.getSelected() in run:open-assets
Hello! I want without having to create a new block button, and stopping the event associated to the image that this run:open-assets get the...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.