Paragraphs mapped to a Text or TextObject property should be rendered

Created on 20 January 2025, 7 months ago

Problem/Motivation

Most content of the websites I work on is managed using Paragraphs to allow editors some level of flexibility.
Consequently, I don't have an available text field to map to description-like properties.
When I map my paragraphs fields to these properties, the result is a list of the paragraphs labels which is not what's expected.

Proposed resolution

Have a way to use the paragraphs content instead of just outputting their labels.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France duaelfr Montpellier, France

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

Comments & Activities

  • Issue created by @duaelfr
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    A https://schema.org/TextObject defines a text document (not a string of text), and https://schema.org/Text is a data type.

    I don't think mapping a Paragraph to either TextObject or Text makes sense. It might make sense to map a paragraph to a https://schema.org/Thing, or personally I like https://schema.org/WebContent.

  • πŸ‡«πŸ‡·France duaelfr Montpellier, France

    @jrockowitz Thank you for your answer.

    My current issue is that I am trying to map one of my existing content types, which uses Paragraphs for its main content, to a NewsArticle schema.org type, which expects an articleBody attribute of type Text. When I'm choosing my entity reference revision field, no Text content is rendered in the attribute. If my paragraphs are mapped to a schema.org type, these are rendered as an array in the attribute, what's not the expected type.

    Am I completely wrong trying to map this paragraphs based content to this attribute?

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    You can probably use the schemadotorg_jsonld_custom.module to extract the 'text' from the paragraph.

Production build 0.71.5 2024