editor.js
editor.js copied to clipboard
Merge Tags or fields ?
Merge tags allow users to dynamically add content to the HTML later,
like curly brackets {{ ... }} or square brackets [ ... ] or any other.
Thanks
Aren't plugins (custom blocks) designed to handle this functionality?
I always thought, the idea of block based editor is to define custom blocks e.g. "call to action", "ad", "related" etc. and use them instead of MergeTags. This, in my opinion allows you to totally separate content definition from its display/presentation form.
We use editor.js as CMS post editor exactly for that reason. Presentation layer processes blocks and renders them according to its own display rules.
@MerkavaPL I had a look the custom blocks, normally the MergeTags are inline with the text rather than a standalone block. Then I need to find a way to insert a block into a block which is hard I believe. Hopefully, I made it clear.
@Nothing-Works do you look a solution for including one block to another? Please, clarify your issue.
@neSpecc hi, the end result is something like this pic
This is the kind of feature I want to have in my app.
However, as @MerkavaPL suggested that using custom blocks to handle this, I do not think it can be done easily in my opinion. What I was talking about in my last comment was that maybe one of the solutions is to have an inline plugin inside a block. That's how I think this feature should be implemented.
If you have some good ideas please let me know. Or maybe I am missing something?
You can implement own Inline Tool that will insert your custom variables to the text.
Inline tools only work with text selections, where most of the time you want to insert a variable at the current caret position (without any text selected).
Inline tools only work with text selections, where most of the time you want to insert a variable at the current caret position (without any text selected).
I'm dealing with the problem right now, do you any idea?
Did anyone find a way to do this? This issue is several years old.