editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

Merge Tags or fields ?

Open Nothing-Works opened this issue 6 years ago • 8 comments

Merge tags allow users to dynamically add content to the HTML later,

like curly brackets {{ ... }} or square brackets [ ... ] or any other.

Thanks

Nothing-Works avatar Jun 07 '19 04:06 Nothing-Works

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.

ghost avatar Jun 07 '19 09:06 ghost

@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 avatar Jun 08 '19 00:06 Nothing-Works

@Nothing-Works do you look a solution for including one block to another? Please, clarify your issue.

neSpecc avatar Jun 11 '19 11:06 neSpecc

@neSpecc hi, the end result is something like this pic image001 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?

Nothing-Works avatar Jun 11 '19 20:06 Nothing-Works

You can implement own Inline Tool that will insert your custom variables to the text.

neSpecc avatar Dec 07 '19 10:12 neSpecc

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).

fdev avatar Dec 07 '19 10:12 fdev

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?

phongluudn1997 avatar Jan 02 '21 08:01 phongluudn1997

Did anyone find a way to do this? This issue is several years old.

jmarbutt avatar Jun 11 '25 18:06 jmarbutt