Add fragment identifiers to entity types on page generated byEntityDisplayModeListBuilder

Created on 3 November 2024, 5 months ago

Problem/Motivation

Currently all the content entity types – which have "field_ui_base_route" and ViewBuilderHandler – displayed on the /admin/structure/display-modes/form and /admin/structure/display-modes/view pages.
Every entity type has its own table, bundles are represented as rows in the table.
This page can be quite long.
It would be useful to have a link to this page which leads directly to a specific entity type.
Currently we can't have that kind of link, because there are no HTML identifiers.
<a href="/admin/structure/display-modes/view#foo-prefix--taxonomy_term">Taxonomy term view modes</a>

Text fragment doesn't work in every cases, because the label of the entity type can be on the page somewhere else as well. This happens for the "User" entity type.

Proposed resolution

Current markup:

<h2>Content</h2>
<table />
<h2>Taxonomy term</h2>
<table />

Proposed markup.
Add HTML ID to the H2 or the TABLE tag.

<h2 id="view-mode--node">Content</h2>
<table />
<h2 id="view-mode--taxonomy_term">Taxonomy term</h2>
<table />

Remaining tasks

Make changes in the \Drupal\field_ui\EntityDisplayModeListBuilder::render

User interface changes

No.

Introduced terminology

No.

API changes

No.

Data model changes

No.

Release notes snippet

No.

📌 Task
Status

Active

Version

11.1 🔥

Component

field_ui.module

Created by

🇭🇺Hungary Sweetchuck Budapest

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024