Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Automatic Anchors

172 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

Total releases
1
First release
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