Allow hard-coded field and bundle names to be defined by site-builder

Created on 10 July 2020, over 4 years ago
Updated 24 October 2024, 3 months ago

This from_library paragraph bundle references a paragraphs library item entity using an entity reference field that's named field_reusable_paragraph.

Both the bundle and field are standard Drupal paragraph entities and entity reference fields, and as such can be edited or removed by a site builder or developer.

If these components are altered, the paragraphs_library module will no longer function in the way it's intended to.

I propose we alter the way this currently functions to make the solution more robust and add more flexibility.

Proposal

In order to continue to allow flexibility in terms of:

  • the bundle used to link a library item
  • the field used to reference a library item

I will provide user selection via the the admin interface for these two items, via a user selected paragraph library preset.

The standard bundle and field will be prefilled via a default paragraph library preset.

By referencing the values from the current code base, flexibility can be added while maintaining current functionality.

Feature request
Status

Active

Version

1.0

Component

Module: Library

Created by

🇬🇧United Kingdom lukus

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.

  • 🇬🇧United Kingdom AaronMcHale Edinburgh, Scotland

    We have a use-case for creating an additional "from library" paragraph type, and while it does work, mainly because we kept the machine name of the field the same, we had to copy some of the hook functions from paragraph_library.module and tweak them to reference the machine name of the additional from library paragraph type that we've created.

    I agree it would be great if these are not hard-coded. Trying to think of a more extensible way that would support the need for more than one "from library" though. The issue we have, is the additional one exists to point to a different Entity Browser View, and making a separate paragraph type was the easiest way to achieve that.

Production build 0.71.5 2024