Link class widget selection
Link class form
Link class edit
Link class display
Add manually class to field link
Add automatically class to field link
Select the class from a list to add to field link

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.

Supporting organizations: 

Project information

Releases