Issue #637Opened December 14, 2017by frank-tenzing1 reactions

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)

hoainam12kDecember 14, 20171 reactions

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.

artfDecember 14, 20170 reactions

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

lock[bot]September 18, 20190 reactions

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.