This project is not covered by Drupal’s security advisory policy.
Simple twig filter to add attributes to link() item.url's in templates.
Has the advantage of merging attributes so modules like Menu Link Attributes do not have their attributes blown away in the template.
For example, current documentation encourages themers to do this:
{{ link(item.title, item.url, { 'class':['menu__link']}) }}
However classes added via preprocess or Menu Link Attributes will no longer be applied, as the above code blows them away.
Usage:
Filter: link_attributes('attribute type':[attribute values])
E.g. in menu.html.twig you can do stuff like this:
{{ link(item.title, item.url|link_attributes({'class' : ['menu__link'], 'data-drupal-example' : ['is-item']})) }}
Project information
Seeking new maintainer
The current maintainers are looking for new people to take ownership.- Project categories: Developer tools
113 sites report using this module
- Created by Jeff Burnz on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Make compatible with Drupal 10 - Initial Changes

