Pivot and Entity References

Created on 8 March 2022, almost 3 years ago
Updated 21 February 2024, 10 months ago

Problem/Motivation

I'm not sure if this is a bug, a new feature or just some documentation that could be improved. I'm trying to set up a HowTo schema, with multiple HowTo Steps. I got that to work by setting up multiple multi-value fields, one for name, one for text, one for image, etc and then enabling pivot and using tokens like [node:field_steps_title].
This is a kind of ugly solution for editors though, and I'd prefer to have an entity reference field that lets you add Steps, and each Step content item has a name, text and an image. I was able to access the referenced content item with tokens like [node:field_steps:entity:body], but when I enabled pivot it didn't change into multiple HowTo Steps.

Steps to reproduce

  1. Create a content type "HowTo" with an entity reference to another content type "Steps" that has fields like Name, Text and Image
  2. Configure the HowTo content type to use the HowTo schema
  3. Create a HowTo content item with multiple Steps in the entity reference field
  4. In the metatag config, enable Pivot on HowTo Steps and set the text field to a token that accesses the Text field on the Steps content item (ex. [node:field_steps:entity:body])
  5. Schema Metatag should output multiple steps, one for each content item in the entity reference field

Proposed resolution

Allow Pivot to work on entity reference fields, or provide a new option in that field that would work on entity reference fields. Improve the documentation to show people what kind of fields and tokens are need for use with the existing pivot and pivot on entity reference fields.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

2.3

Component

Code

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇪🇸Spain pcambra Asturies

    100% agree, the pivot feature doesn't take into account entity reference fields, so the only workaround for this would be custom tokens and use the separator.

Production build 0.71.5 2024