Drupal is a registered trademark of Dries Buytaert
Release: Drupal 11.4.5 Update released for Drupal core (11.4.5)! Release: Drupal 10.6.15 Update released for Drupal core (10.6.15)! Release: Superfish Dropdown Menu 8.x-1.15 Minor update available for module superfish (8.x-1.15). Release: Leaflet 10.4.10 Minor update available for module leaflet (10.4.10). Release: Raven: Sentry Integration 7.5.1 Minor update available for module raven (7.5.1). Release: htmLawed 8.x-3.8 Minor update available for module htmlawed (8.x-3.8). Release: Raven: Sentry Integration 7.5.0 Minor update available for module raven (7.5.0). Module Revived: Media Library Form API Element 2.1.5 Module media_library_form_element updated after 10 months of inactivity (2.1.5). Release: Acquia Content Optimization 2.1.0-alpha1 First alpha version released for module conductor (2.1.0-alpha1). Usage Milestone: Manage display Module manage_display crossed 1,000 active installs.

Automatic Anchors

163 sites No security coverage
View on drupal.org

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

Activity

Tracked releases
1
Tracked since
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
3.0.0-beta1 Pre-release Dec 10, 2024