Use referenced entity's fields in field formatter's SDC config

Created on 6 March 2024, 3 months ago
Updated 3 April 2024, 2 months ago

Problem/Motivation

Currently, when we use SDC display on an entity reference field, it looks like we can only select a slot to place the field value.

I think this form should show fields on the referenced entity so they can be assigned to props/slots.

Without this, I am creating an extra display mode to use SDC, and using the rendered entity formatter to show it. However, in one case I have a prop for an html tag, and it would be nice to configure this from the parent display.

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

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

Comments & Activities

  • Issue created by @mortona2k
  • Status changed to Fixed 3 months ago
  • e0ipso Can Picafort

    I think the current solution you mention is the actual way to go.

    Without this, I am creating an extra display mode to use SDC, and using the rendered entity formatter to show it. However, in one case I have a prop for an html tag, and it would be nice to configure this from the parent display.

    After rendering, an entity can no longer be considered structured data. Therefore it needs to be put in a slot.

  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    The solution worked well, I actually used a static token to set the html tag, so it's flexible if you're setting the variable manually.

    Here's another case.

    I have a block with an entity reference to different content types. I want to make a card component that shows the title, image, and body summary. With this workflow, I have to set up that display mode for all the content types. By having a more capable entity reference sdc ref, we could do that all in one place.

    But, I think the solution for that will be in layout builder relationships and tokens.

    Or maybe creating a view that lists the fields, but then we need an SDC Views module ;)

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024