Anchor link icon
Anchor link in the CKEditor 5
Anchor Link for a Section heading - top and bottom of the page

The Drupal Core CKEditor is missing some very important options.

Anchor Link!!!!

This plugin module adds the anchor anchor link related features to CKEditor in Drupal 9/10.

Features

  • Dialog to insert links and anchors with some properties.
  • Context menu option to edit or remove links and anchors.
  • Ability to insert a link with the URL using multiple protocols, including an external file if a file manager is integrated.

Requirements


OPTION #1: Use "drupal/anchor_link": "^3": CKEditor 5 version, requires external library.

This plugin uses an external CKEditor5 library: Anchor Link CKEditor plugin

The library can be managed via composer, but you must require wikimedia/composer-merge-plugin:

composer require wikimedia/composer-merge-plugin

and expand the extra section of your composer.json like so (you may need to adjust the "include" directory, e.g. your web files may start with docroot instead of web in which case it would start with docroot/modules):

    "extra": {
        "merge-plugin": {
            "include": [
                "web/modules/contrib/anchor_link/composer.libraries.json"
            ]
        }
    }
    

then, you can require the library like:
composer require drupal/anchor_link:^3.0

In some cases you may need to run the above command twice so that the merge plugin picks up the library after the library information from the module is added.


Other older CKEditor 4 supported options
Recommended to use the CKEditor 5 supported version

OPTION #2: Use "drupal/anchor_link": "~2": Manage libraries in your project.

Anchor Link CKEditor plugin
and Fake Objects CKEditor plugin

OPTION #3: Use "drupal/anchor_link": "~1": Needed libraries are in the module.

They had been listed in the Drupal.org Library Packaging Allowlist

Issue #3262074: Removed the Double Click event from the Anchor Link plugin, not to conflict the double click event with Drupal Core Link or the Linkit module



This module is sponsored and developed by Vardot.

Vardot

Supporting organizations: 
Maintaining the 3.0.x branch for CKEditor 5
Initial building, ongoing maintenance and development

Project information

Releases