I installed version 1.9 of the module so I wouldn't have to deal with the Fakeobjects module and the external libraries issue and all appeared fine at first. I added what I thought were the Link, Unlink & Anchor icons to the editor toolbar in the admin text format and editors section as I have in the past.
The first think I noticed was when I hovered my mouse over the link/unlink icons, it showed Link to Anchor and Unlink Anchor. Previously, they just said Link and Unlink. More importantly, when I saved my changes and went to edit a page on my site, the Link to Anchor and Unlink Anchor did not appear on the editor toolbar.
Did I miss a step somewhere?
I'm running Drupal 9.3.4 module version 8.x-1.9.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | add-icons-to-editor-toolbar-3264588-10.patch | 2.49 KB | agudivad |
| #8 | 3264588-add-icons-to-editor-toolbar.patch | 5.73 KB | robert_t_taylor |
Issue fork anchor_link-3264588
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
agudivad commentedAm facing the same issue. Have you found any fix?
Comment #3
Anonymous (not verified) commentedHi, we are having the same issue. When adding the anchor link field to the CKeditor settings, it only displays when setting the field to 'Full HTML'. My customer uses a different format 'Basic HTML'. Did anyone found a fix for this?
Comment #4
Zef1982 commentedWe found a fix: In our case we checked the CKeditor filter Limit allowed HTML tags and correct faulty HTML . After adding the name attribute to the a-tag in the 'Allowed tags' section, the Anchor button appeared in the toolbar.
Comment #5
steveash commentedUsing CkEditor Version: 9.3.12
Drupal Core Version 9.3.12
"drupal/anchor_link": "^1.9",
We set the icons up in the configuration, but the icons aren't showing up in the editor. We set them in the back end configuration, but the add link button simply isn't there on the front end. The flag icon for the anchor itself shows, but the link and unlink buttons do not show up.
Hover text on admin is showing "Link to Anchor" and "Unlink Anchor", which is a change.
We tried the solution about the faulty html, but it did not help.
We've got this working on about 30 sites beautifully, but on this one site it's decided to stop working. HELP!
Comment #6
jrbWe're also seeing this issue. The LinkToAnchor and UnlinkAnchor buttons are placed via the UI in the text format, but they do not show in the toolbar when editing content.
The config for the text format does have the icons:
This happens both with and without "Limit allowed HTML tags..." filter enabled.
I verified this on simplytest.me with only this module (8.x-1.9) added.
Comment #7
robert_t_taylor commentedWe're also seeing this issue with Drupal 9.4.2. Interestingly, CTRL^L works to insert the link so it must be something in the toolbar insertion code. I will keep looking.
Comment #8
robert_t_taylor commentedI have got this working under Drupal 9.4.4 and module version 8.x-1.9. This patch tweaks the button names to get them to align with the naming in AnchorLink.php, copies the link.png and unlink.png images to a location that can be found, and sets the path to the icons for link and unlink so the CSS styles can be generated appropriately. Icon paths are set in en.js, so simply make the same changes in the language file you may need.
Hope this helps someone else.
(Note: This is my first patch submission so kindly excuse me if I stepped on any toes or munged up the naming convention.)
Comment #9
robert_t_taylor commentedI have got this working under Drupal 9.4.4 and module version 8.x-1.9. This patch tweaks the button names to get them to align with the naming in AnchorLink.php, copies the link.png and unlink.png images to a location that can be found, and sets the path to the icons for link and unlink so the CSS styles can be generated appropriately.
Comment #10
agudivad commentedThanks @robert_t_taylor.
I have recreated this patch for module version 8.x-10.
Comment #11
uniquename commented#10 worked for me.
Comment #12
i-trokhanenkoPatch #10 works for me.
Comment #13
joumCan confirm #10 works for me, too.
Can this be merged in and released?
Comment #14
alastairhoward commentedThanks for the work on this - I can confirm #10 is working too. Would be good to get this merged.
Comment #17
rajab natshahThis one is on 8.x-1.9 and CKEditor 4; on 3.0.x the Anchor button shows its icon, so closing as outdated. See #3256442: Icons not displaying in CKEditor settings for the CKEditor 5 side :)