Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Automatic Anchors

No security coverage Under active development 198 sites

This module automatically creates HTML ID attributes for elements like headings, making it easier to link directly to specific sections of a page. It ensures unique IDs are generated and can optionally add inline links for easy copying.

This module automatically generates HTML id attributes for a configurable list of matched elements. The most common (and default) use is to automatically generate HTML ids on headings, for the purpose of creating anchor links. For example:

<h2>About Dunder Mifflin</h2>

becomes:

<h2 id="about-dunder-mifflin">About Dunder Mifflin</h2>

This module also can insert permalinks inline to aid editors or site users in copying the appropriate URL to link directly to an anchor (such as "/about#kevins-famous-chili"). This mimics the behavior that is available on pages within the Drupal Developer Documentation on drupal.org.

This module was discussed as the Module of the Week on the Talking Drupal podcast, episode #477. (From 3:05 to 11:45)

Features

  • Can be applied to a fully-configurable list of elements anywhere on the page (not just within a node body or field, and not just on headings)
  • Does not interfere with or change manually-added or already-existing HTML ids
  • Converts text to i18n-friendly, hyphenated, short, and clean HTML ids
  • Generates unique ids, even when multiple elements have the same text content

Usage

By default, this module automatically generates ids on <h2>, <h3>, <h4>, <h5>, and <h6> elements within the HTML <body> and inserts inline permalinks that can be viewed by administrator users. Simply download and install the module.

For more advanced configuration, visit the module settings page (located at /admin/config/auto_anchors/settings). The visibility of inserted inline permalinks can also be controlled via permissions (at /admin/people/permissions#module-auto_anchors).

Ask your assistant about Automatic Anchors

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
2
Tracked since
Mar 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Active

Releases

Version Type Core PHP Release date
3.0.0-beta1 Pre-release 10–11 Dec 9, 2024
2.1.1-beta1 Pre-release 8–10 Mar 3, 2023