Make component overrides easily re-usable

Created on 8 July 2024, 6 months ago
Updated 14 July 2024, 5 months ago

Problem/Motivation

There's a lot of work to setup a new content type. There are about a dozen fields which are devoted to look and feel. For example, to override the banner settings there are 8 fields.

My recommendation is to bundle some of these fields into paragraphs, which makes this possible within the govcms constraints.

  • "Banner settings" paragraph
  • Move fields to paragraph
  • add field_banner_settings or whatever
  • Use "Button" for the paragraph.

Here is an example of how that looks. The benefits are:

  1. Easy to enable this on a content type, just add one field instead of 8.
  2. Easy to keep the form structure consistent because there is literally only one.
  3. Can be applied to other overrides which are, in practice, only applied/overriden occasionally per node.
  4. Easy to "see" all the related settings from a developer perspective.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.8

Component

Code

Created by

🇦🇺Australia sime Melbourne

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

Comments & Activities

  • Issue created by @sime
  • 🇦🇺Australia sime Melbourne

  • 🇦🇺Australia sime Melbourne
  • 🇦🇺Australia sime Melbourne
  • 🇦🇺Australia alex.skrypnyk Melbourne

    This suggestion adds a new twist to the paradigm of "configuration paragraphs": we already use similar approach for the "Automated list", where the configuration of what would be displayed is passed down the processing pipeline to the view.

    I like this suggestion from the point of re-usability of settings between content types: if a new content type wants to use Banner overrides - adding a "Banner override" paragraph should provide such functionality in an easy way with all the "wiring" already in-place.

    The scope of the implementation needs to be widen to include possible future overrides for other components added within CivicTheme or in a consumer site.

    The paragraph for a specific component can be collapsed or expanded by OOTB CivicTheme based on the component itself to make it more apparent for the content editor what the override fields are, which will make the Banner Overrides UI looking to closer to what it is now than what it is on the screenshot in the description.

    This will also require an update hook to migrate existing site to use such configuration paragraphs.

    @sime
    Thank you for your suggestion. This is solid.

Production build 0.71.5 2024