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

  1. Create a view.
  2. Click "Add field".
  3. Search for "Link".
  4. 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

  1. "Absolute URL" for "Link Template".
  2. 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.

CommentFileSizeAuthor
#4 3625085-field_settings.png100.56 KBchaitanyadessai

Issue fork drupal-3625085

Command icon 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

jon pugh created an issue. See original summary.

chaitanyadessai made their first commit to this issue’s fork.

chaitanyadessai’s picture

Status: Active » Needs review
StatusFileSize
new100.56 KB

MR raised, please review.

chaitanyadessai’s picture

AI assistance was used, reviewed and tested changes locally.