Today I found out about the existence of this module via #2855521-7: Drupalimage calling drupallink functions without checking if the plugin is loaded. Thanks for this valuable contribution! :)
Unfortunately, I noticed this module violates two important guidelines:
- Drupal.org does not allow committing 3rd party JS libraries to
git.drupal.org
. See https://www.drupal.org/project/drupalorg_whitelist. Several CKEditor plugins are already whitelisted: https://www.drupal.org/packaging-whitelist?title=ckeditor. - Drupal 8 uses an alternative implementation of the
link
plugin. It was developed in collaboration with the CKEditor team. The Drupal implementation allows to usehook_form_alter()
and removes all the edge case link dialog options.
(I'm the maintainer of the ckeditor.module
component in Drupal 8.)
This module is valuable and fills a niche that's very important to a small set of people (<5% of users). But it's doing so by importing CKEditor plugins that conflict with Drupal core's plugins. So unfortunately, to properly integrate, this should stop copy/pasting CKEditor's official anchor link plugin (which would also prevent issues like #2885447: Upgraded plugin versions breaks edit functionality from ever happening again), and instead write its own CKEditor plugin, so that it can be used together with \Drupal\ckeditor\Plugin\CKEditorPlugin\DrupalLink
and https://www.drupal.org/project/editor_advanced_link.
Comments
Comment #2
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedThank you, Wim for your time :)
I LOVE Open Source!!
We keep sharing and learning from the best of us, all the time.
I will follow on steps, to correct all notes and remarks.
We needed the Anchor only "The button with a flag icon" in CKEditor under Drupal 8.
I wish that we have this Anchor button in Drupal 8 core.
Anchor linking is very important for many websites.
bible.org for example: Having the anchor button was a decision switcher to update from Drupal 7 to Drupal 8, Do you think they will go with that at this time?
If anchor button was already in Drupal Core CKEditor, they could be had went with the decision just like that.
I find out that only the following CKEditor plugin do have anchor flag button.
http://ckeditor.com/addon/link
link and anchor
Did not need the link tho.
Following on the steps:
1. Drupal.org Library Packaging White list Issues CKEditor Anchor link
2. Developers could use the anchor and keep the drupal core link or use other linking like linkit.
Any help is welcome.
Rewarded and enjoyable time working on this project :)
Comment #3
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedI'm with a custom Anchor button in Drupal core. just like the core link.
Personally I will switch to us it :)
Comment #4
Wim LeersI understand! But that's where your wonderful module comes in :)
No, they can't. Because the "Anchor" functionality in CKEditor (and in this module) is provided by the CKEditor core
link
plugin. Drupal core intentionally does not ship with this, as I explained. When this module is installed, things break, as is shown in #2855521: Drupalimage calling drupallink functions without checking if the plugin is loaded, #2848535: Unable to create link when wrapping img, #2802085: Duplicate edit link menu items in CKEditor and #2885447: Upgraded plugin versions breaks edit functionality (and there's probably more).Glad to hear that! :)
Woot! Let me know if you're stuck on something!
Comment #5
dsnopekWhat is the status of this issue?
I just posted #2939895: Changed to depend on fakeobjects module which is sort of tangentially related to this...
If the CKEditor plugin code was removed from this module, a dependency on the 'fakeobjects' module was added, and then a super simple plugin for creating anchors was added, that would basically satisfy this issue!
Is that on the table? I might be willing to work on such a thing because I need to get anchor functionality into panopoly_wysiwyg somehow.
Comment #6
dsnopekI started an implementation of a CKEditor "anchor" plugin from scratch on this panopoly_wysiwyg issue:
#2939911: Anchor support in Drupal 8
It doesn't do much yet, but it's a start! :-)
I don't know how to make the dialog and form be more Drupal-y (ie. be a Drupal form), but I'm not sure that's even necessary here - what would anyone want to alter into an anchor form? The single text field might be sufficient.
Comment #7
dsnopekComment #8
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedTotally agree with you David!
CKEditor FakeObjects
I wish that FakeObjects and the Anchor Link comes with Drupal 8 Core CKEditor package.
Drupal.org Library Packaging Whitelist
#2940014: CKEditor Fake Objects
I had created the following issue 7 months ago
#2888309: CKEditor Anchor link
Comment #9
chipway CreditAttribution: chipway at Chipway commentedI vote for anchor link in Core as proposed by Wim.
Comment #10
dsnopekWe just implemented a custom anchor plugin in panopoly_wysiwyg! It doesn't use a Drupal form yet, but once that's implemented, we'd like to spin that functionality back out into a new module. See:
Would moving that functionality into this module (as a replacement for what's currently here) be an option?
Comment #11
rootwork@dsnopek Given the lack of movement (in terms of code) on this issue, I think moving the functionality into this module would be great.
If you do decide to release your own module, please let us know in this issue!
Comment #12
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedStarting a new branch 8.x-2.x to follow with the best practice and have the
#2939895: Changed to depend on fakeobjects module
Comment #13
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #14
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #16
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedRequired Anchor link library to follow with d.o guidelines and D8 guidelines — and stoped copy/pasting CKEditor plugin and allow developers to roll their own
Comment #17
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedHi @Wim,
What are other steps to go with to have the module in Drupal Core or a custom CKEditor anchor management plugin
and a kind of CKEditor fakeobjects plugin.
Only Anchor link button with fakeobjects
Not sure where to move with ideas from this point.
Released Anchor Link 8.x-2.0-alpha1
Comment #18
Rajab Natshah CreditAttribution: Rajab Natshah at Vardot commentedComment #20
alisonHi! Just double-triple-checking -- is this module now in line with guidelines? Thank you!