Problem/Motivation
When building a View, I'd like to add links to various entity pages by choosing a link template, while properly checking access.
This is currently impossible to do for anything but canonical, edit and delete. Even with a "custom HTML" field, I am not aware of any no-code way to confirm access before showing the link.
Steps to reproduce
- Create a view.
- Click "Add field".
- Search for "Link".
- Notice there are only links for View, Edit, and Delete.
Proposed resolution
Add a new option to the EntityLink plugin for "link_template".
The contrib module views_entity_link already does this, but also includes other options. Core could just have the single option: https://git.drupalcode.org/project/views_entity_link/-/blob/1.1.x/src/Pl...
This would also allow deprecation of the view, edit and delete link classes.
Remaining tasks
Add link_template option to the EntityLink plugin, settings form, and implement.
User interface changes
Add form element above
- "Absolute URL" for "Link Template".
- TBD: Text field? or can we lookup available links?
Introduced terminology
None.
API changes
None.
Data model changes
An extra option in the views field field config.
Release notes snippet
TBD.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3625085-field_settings.png | 100.56 KB | chaitanyadessai |
Issue fork drupal-3625085
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 #4
chaitanyadessai commentedMR raised, please review.
Comment #5
chaitanyadessai commentedAI assistance was used, reviewed and tested changes locally.