Ckeditor5: Can't use the mention feature to insert container elements.

Created on 12 Jul 2019  路  5Comments  路  Source: ckeditor/ckeditor5

I'm fairly new to ckeditor - I chose it above other editors thanks to the existence of the mention feature, which is close to what I need.

I want to use the interface of mentions to insert html - like a canned response, or a quick way to insert a template.

It doesn't seem like I can do this, because mentions are expected to insert text attributes.

  1. Am I right that this is the limitation?
  2. Is there any way around it?
  3. Or is there perhaps a better way to achieve what I want without using the mention feature?
mention question

All 5 comments

cc @jodator

It looks like a bit different case then mention was designed for. For canned responses, you don't want to insert a mention attribute so you cannot use the mention feature.

Right now we do not have a guide for such feature but basically you'd need to re-implement the mention UI feature that listens for some editor events, shows the dropdown panel to choose a response and inserts desired HTML.

Hi @jodator , thank you for your answer. I am also new to CkEditor and having a similar need than @GusRuss89 .

In my case I need to change the output content of the mention with a matching value. The goal is to be able to search for a field and replace with its matching value in a data set for instance.

Could you recommand a reading or a specific part of the framework API about your suggestion plz ?

Right now we do not have a guide for such feature but basically you'd need to re-implement the mention UI feature that listens for some editor events, shows the dropdown panel to choose a response and inserts desired HTML.

I'm not sure that I fully understand you case but the good point to start is to check this customizing CKEditor 5 mention output in the docs. This can be used to change how the mention is rendered to the view (editing and/or data).

Hey @jodator thank you very much for your answer !

No actually I was looking for a way to customize the data that will be outputed in the editor but I found that the plugin searches for the text attribute of the feed item and fallbacks on id by default.

So using the text attribute is what I was looking for !

Thank you :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hybridpicker picture hybridpicker  路  3Comments

pjasiun picture pjasiun  路  3Comments

metalelf0 picture metalelf0  路  3Comments

jodator picture jodator  路  3Comments

oleq picture oleq  路  3Comments