Problem/Motivation
Linkit is great and offers many useful features and configuration options to create hyperlinks in CKEditor by marking text, clicking the "LinkIt" button and linking that text. That is helpful, flexible and nice, but takes many clicks even if the link text should be equal to the target entity.
CKEditor Mentions is a nice plugin to quickly create links in CKEditor starting with a certain character, e.g. "@" like we know from Social Media Platforms and others.
As a maintainer of https://www.drupal.org/project/ckeditor_mentions when writing #3582358: Allow using tokens for the Mentions link text output per bundle I came to the conclusion that probably LinkIt and CKEditor Mentions might be a great team!
(Issues like #3529104: CKEditor5 plugin incompatibility with LinkIt module additionally show that they may currently conflict)
Creating that issue I wondered if we're not reinventing the wheel with all the functionality and configuration LinkIt already offers and should better provide an alternative input functionality based on LinkIt using CKEditor Mentions.
If someone needs that functionality to link nodes, users (@user), ... using a specific syntax, that could become a dream-team. Dedicated in some cases, like social media platforms for linking users, but also additional to speed up editing linking content.
So my question is: What do the LinkIt maintainers think? Can you see the benefits for such use-cases and would you see this as a useful submodule or additional contrib module you'd support to integrate with?
I think it might them make sense to join forces and replace https://www.drupal.org/project/ckeditor_mentions one day by this much better one :)
Comments
Comment #2
anybodyComment #3
mark_fullmerThanks for suggesting this integration.
There are a couple reasons I can think of why integrating CKEditor Mentions with Linkit might not be a good idea.
First, Drupal 11.3 had introduced its own flavor of Linkit, with https://www.drupal.org/node/3524296 . My hope is that this core solution will continue to develop in features and that many sites will be able to use this instead of Linkit. Linkit will likely still have a role for some sites that want some of the features not included (see list at https://www.drupal.org/project/linkit ). If CKEditor Mentions were incorporated into Linkit, that would hamper people from adopting the core solution and simply using CKEditor Mentions with Drupal core.
Second, regarding the main impetus for this integration, a bug report in #3529104: CKEditor5 plugin incompatibility with LinkIt module, Linkit has had to make multiple changes in the last year to be compatible with CKEditor's API to avoid the multiple link problem (see #3540235: [CKEditor v45] Editing Displayed text from collapsed selection generates multiple links, #3571226: [CKEditor v45+] Changing "Displayed text" when creating a new link triggers JS error). I think it would be worth a bit more investigation into CKEditor Mentions' implementation to see if this bug can be resolved without merging the two modules. For example, the module Editor Advanced Link also uses a createAttribute downcast method (https://git.drupalcode.org/project/editor_advanced_link/-/blob/2.3.x/js/...) and integrates fine with Linkit (note that some collaboration was needed to get this worked out. See #3534699: [CKEditor5 v45+] Attributes can overwrite other attributes and editing displayed text from collapsed selection generates multiple links
I'm not intransigently opposed to an integration, of course. I just want to raise this points for consideration, in case the above were not yet on the radar of the CKEditor Mentions maintainers.
Comment #4
anybodyThank you very much for the very valuable information @mark_fullmer!
Indeed these are important points to consider, while fixing #3529104: CKEditor5 plugin incompatibility with LinkIt module is not the main reason here. Instead the primary reason is that I think that
So in the end I think both module share 80% in configuration and UI / UX, which is a good reason to build up on each other. And LinkIt (or Core) would be a great starting point then, if they's allow integration for Mentions.
So the question is: Should we - for now - postpone this and wait how things go on in Core and LinkIt, but keep this in mind for the future and before implementing very similar things in Mentions? Maybe the core maintainers that integrated the new Link functionality should also be aware of this and leave their comments?
Anyone commenting this, please give CKEditor Mentions a short try so you'll see the similarities while CKEditor mentions is far behind what LinkIt offers.
Thank you!!