2

I want to add configuration settings to Paragraph entities in a specific bundle in Drupal 8. Theres potentially a lot of options and the need to change/update them over time, so I figure the best way is through ThirdPartySettings and not adding more fields to it. I am going to use these values to influence certain aspects of the render and for search queries.

I can see where you can add settings to the bundle itself, but how do you provide them for each paragraph instance on a node via a config schema?

I see this in the Paragraphs config schema dir:

paragraphs.paragraphs_type.*:
  type: config_entity
  label: 'Paragraphs type config'
  mapping:
    .....

But paragraphs.paragraphs_type.*.third_party.foo... would add it to the bundle, right?

1
  • Yes, it's like Layout Builder stores per-view-mode settings as third party config and per-node-settings as field content. What you are trying to do is the same for Paragraphs.
    – 4uk4
    Aug 6, 2021 at 19:46

1 Answer 1

1

A paragraph is a content entity, which doesn't support third party settings. Third party settings are just for config entities.

The solution is just to use fields, awkward as it might seem.

2
  • Ah damn. It would be nice in this case to avoid fields, +2 tables, etc. I guess its the only route for now.
    – Kevin
    Aug 6, 2021 at 15:28
  • Yeah, feel your pain, I was in a similar position a couple of months back but with Layout Canvases
    – Clive
    Aug 6, 2021 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.