Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Entity Autocomplete Anchor

No security coverage Maintenance fixes only

Part of the Entity ecosystem · 310 projects

This module adds the ability to include URL anchors when linking to entities using Drupal's entity autocomplete widget. It provides a widget and a hook to allow users to specify a fragment (like `#section`) for the generated URL. This is particularly useful when linking to specific parts of a page or content, such as paragraphs.

The entity autocomplete anchor module provides a widget that allows users to add
anchors to links set using the entity autocomplete widget.

Problem: when using a link field with the entity autocomplete widget you aren't able to provide an anchor (hash part, or fragment) to the resulting url anymore.

Solution: when the user selects an entity reference a new field for the anchor is shown.
The result URL is: /node/1#section

If you are using the link_attributes module and want to add links to specific paragraphs, this module allows you to do that without hardcoding the urls.

The module provides two implementations:
1. as a separate widget (Link with anchor)
2. as a hook that alters the default link widget

The widget is provided for edge cases when the default link widget cannot be used.
It works the same but is not recommended because it extends the Link Widget class and
overwrites the formElement method. If the overwritten method is updated in a future
core release, the link widget provided by this module will not be updated automatically.
For these type of situations the hook implementation should be toggled using a config
(to be implemented in a future release).

Update: The hook now works with the Linkit widget as well

Upadate 2: I decided to deprecate development on this module in favor of integrating its functionality in the linkit module (more specifically linkit_field module)
More details:
https://www.drupal.org/project/linkit/issues/3223919#comment-14974327
https://www.drupal.org/project/linkit_field/issues/3349013

Ask your assistant about Entity Autocomplete Anchor

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Mar 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.0-beta6 Pre-release 9 Mar 16, 2023