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