Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Link class

Security covered Under active development 8,043 sites

Part of the Link ecosystem · 35 projects

This module adds a widget to Drupal's Link field that allows editors to easily add CSS classes to links. You can configure it to let editors manually add classes, choose from a predefined list, or automatically apply specific classes.

Link class module provide a new widget form for field type Link. This widget allows editor to add class to fields Link attached to their content.

Requirements

As this module provide a widget for Link field included in core, this module is useful only if Link module is enabled.

Features

The widget settings permit users to add a class on content field type link with several methods

  • Set manually class (the initial behavior) on the edit form
  • Choose class from a select list
  • Force the class automatically added on the link

See screenshot.

Configuration

- Select the widget "Link with class" in the Manage form display page settings for the Link field you set on the entity.
- Configure the behavior in the widget settings
- You can set default values for classes added to the link in the field settings, after selecting the widget "Link with class"
- Editors can now add their own classes to the link field.
- Classes added must be separated with a space.

Similar modules

Link attributes widget : this module allows to add more attributes on Link field, and to specify attributes on Menu content link. You should consider using this new module.

Link attributes widget is more oriented for site builder profile, where as link class is more oriented end users (a site builder can configure which classes will be available for end users / editors)

This core issue #2477155: Update LinkWidget to accommodate the attribute. could deprecated this module.

See screenshots illustrating configuration and usage.

Drupal 9–11

Ask your assistant about Link class

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

  • link Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Apr 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Active

Releases

Version Type Core PHP Release date
2.2.0 Stable 9–11 Mar 4, 2025
2.1.0 Stable 9–10 Apr 30, 2023