Skip to content

Custom link attributes for link sub-fields#

Here are instructions on how to add/remove/modify the available link attributes for link subfields.

  1. Copy the custom_field.custom_field_link_attributes.yml file to the root of your own custom module.
  2. Rename the prefix of the file to the machine name of your module. e.g. my_module.custom_field_link_attributes.yml
  3. Add/Remove/Modify attributes.
  4. Clear cache.

Examples#

Add a new data type attribute as a checkbox:

1
2
3
data-download-only:
  title: Download only
  type: checkbox

Modify the existing class attribute to be checkboxes of limited options:

1
2
3
4
5
6
7
class:
  title: Class
  description: Select one or more classes from the available options.
  type: checkboxes
  options:
    foo: Foo class
    bar: Bar class