Problem/Motivation
In #3025657: Add views area plugin to display a link to another view display within the same view a new display link area plugin was added to views, and in #2981044: Unify the grid/table views of the media library we want to use/change the views display links for the media library view to add some attributes. The only way to currently do that is via hook_link_alter()
. Since hook_link_alter()
is called for ALL links, this impacts performance in a bad way.
Proposed resolution
Implement a specific hook_views_display_link_alter()
to allow modules to change display links.
Use this new hook to add an ID and/or data attributes to the media library display links.
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
None
API changes
New hook_views_display_link_alter()
hook.
Data model changes
None
Release notes snippet
Issue fork drupal-3036694
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
seanBComment #3
samir_mankar CreditAttribution: samir_mankar as a volunteer and commentedComment #12
akalam CreditAttribution: akalam commentedI added a new MR as a starting point, calling the hook_views_display_link_alter passing the render array of the display_link area plugin so other modules can make use of it.