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.

Command icon 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

bill_redman created an issue. See original summary.

agudivad’s picture

Am facing the same issue. Have you found any fix?

Anonymous’s picture

Hi, 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?

Zef1982’s picture

We 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.

steveash’s picture

Using 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!

jrb’s picture

We'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:

   name: Linking
    items:
      - LinkToAnchor
      - UnlinkAnchor

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.

robert_t_taylor’s picture

We'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.

robert_t_taylor’s picture

StatusFileSize
new5.73 KB

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

robert_t_taylor’s picture

Status: Active » Needs review

I 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.

agudivad’s picture

Thanks @robert_t_taylor.

I have recreated this patch for module version 8.x-10.

uniquename’s picture

#10 worked for me.

i-trokhanenko’s picture

Status: Needs review » Reviewed & tested by the community

Patch #10 works for me.

joum’s picture

Can confirm #10 works for me, too.

Can this be merged in and released?

alastairhoward’s picture

Thanks for the work on this - I can confirm #10 is working too. Would be good to get this merged.

ravi kant made their first commit to this issue’s fork.

rajab natshah’s picture

Status: Reviewed & tested by the community » Closed (outdated)

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

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.