No Governance for Saved Templates

Created on 8 March 2024, about 1 year ago
Updated 27 August 2024, 8 months ago

Problem/Motivation

Even though a certain component or paragraph entity is not available within a content type’s Layout Paragraphs field, when a Mercury Editor Template (or as I like to call them, “stamped sections”) is created with that particular paragraph entity, that ME Template/Stamp is available within the content type where that paragraph entity is not allowed.

Steps to reproduce

1. Create a section or component using “Paragraph Entity A” and “Stamp” it / create a ME template, within a content type where “Paragraph Entity A” is an available component option.
2. Create or edit a content type page where “Paragraph Entity A” is not an available component – The stamped/ME Template is still available for placement and should not be.

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇺🇸United States philip_stier Denver, Colorado

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

Comments & Activities

  • Issue created by @philip_stier
  • Issue was unassigned.
  • 🇺🇸United States philip_stier Denver, Colorado
  • 🇩🇪Germany D34dMan Hamburg

    I tried this and found that, even tough we are able to add a paragraph via "ME template", it is not possible to save the node as the validation kicks in.

    I can think of multiple ways to approach this problem (for brainstorming)...

    Solution A

    1. Maybe there could be a field in "me_template" entity that captures the information about on which entity and field the template is made available for.
    2. Then when showing list of available templates, we can filter it based on entity type, bundle and field context.

    Solution B

    1. Automatically detect the paragraph type which are allowed for a given field and remove any "templates" from suggested template

    Solution C

    1. Automatically detect the paragraph type which are allowed for a given field and remove any paragraphs, which are not allowed for a given field, when "applying" the template.

    Solution D

    1. Indicate "paragraphs" which are invalid to the user as "error" so that they can "remove" it themselves.

Production build 0.71.5 2024