Show a link to the Paragraphs' Host Entity

Created on 6 December 2023, 7 months ago
Updated 28 April 2024, 2 months ago

Problem/Motivation

For websites that use nested paragraphs, having the parent entity and id is not at all useful. It is typically just another Paragraph entity, and there is no way to see which node the paragraph belongs to.

This module would be way more useful if it had a link to the top-level Host entity instead of just the immediate Parent entity, which can often be a Paragraph entity if using nested paragraphs.

Proposed resolution

Since the top-level host entity cannot be obtained via a simple views query (because it would need to recurse up through the parents to find the host entity) the suggested approach is to create a custom views field and use PHP code to recurse through the parent entities via Paragraph::getParentEntity() until you find a non-Paragraph entity to which the item is attached.

Remaining tasks

User interface changes

In addition to listing the Parent entity type and id, we'll list the top-level Host entity and include a link to that entity, provided that the entity type has a canonical URI. Since Paragraph entities have no canonical URL, this often indicates the Paragraph may be orphaned which will be apparent from the unlinked Parent/Host entity title.

API changes

Data model changes

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ͺπŸ‡¨Ecuador jwilson3

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024