dpc-sdp / ripple-framework

Ripple is the presentation layer for building websites on the DPC Single Digital Presence platform.
Apache License 2.0
19 stars 13 forks source link

Reusable content #1264

Open bgilhome-now opened 1 month ago

bgilhome-now commented 1 month ago

Describe the feature

Reusable content (via the Paragraphs Library module in Tide) - such that e.g. an instance of a Basic Text component can be created once & placed on multiple landing pages without having to create duplicate components.

The current functionality for reusable content is limited to campaigns and image galleries. There is arguably a common use case for reusable content components of any type (or at the least, the Basic Text type).

Motivation

The content required for the EPA site includes pages specifying fees and regulations relating to various types of permits. Between the ~50 permit types, much of the fee and other regulatory information is the same. It would be laborious and open to human error to create & maintain this information as individual Basic Text instances - the preferable approach would be to create a reusable paragraph that could be placed on multiple pages. Then, if the shared information needed to be updated, it could be edited in one place, and updated automatically wherever it is used.

This kind of use case is very likely not limited to EPA, but a common one across other projects (new or existing).

Proposal

The paragraphs_library module can be enabled on the backend to provide the required editing UX functionality. Any paragraph type can be configured as 'Reusable', enabling editors to create a library of reusable items of those types which editors can place on any landing page.

Reusable paragraphs can be included in the JSON:API's response for a landing page in the same way as other entity references are currently handled (via the include query parameter). A simple 'from-library' component mapping can be added to take that data and 'pass it through' to the component mapping of the relevant type.

A PR containing the required updates for Ripple will be made and referenced here.

Benefits

Solves the issue outlined in Motivation, and may be required or desired in other client projects (existing or future).

Drawbacks

The Tide UX re: creating/editing/placing a reusable paragraph would need to be reviewed to ensure that it is intuitive and presents no hindrance to the current editing experience.

Adoption strategy

Could be added to the Confluence documentation for Tide. Not sure if it needs any dev docs in Ripple except for test/s?

Additional information

Final checks

dylankelly commented 1 month ago

Hey @bgilhome-now - thanks for adding this and taking the time to write it up. Do you have a corresponding Tide PR that implements this so I can review how this works?

bgilhome-now commented 1 month ago

Thanks @dylankelly , I made the above PR in the content.vic.gov.au repo, I'll make one for Tide now.

bgilhome-now commented 1 month ago

@dylankelly Is there a Tide repo which tracks exported config for the whole project or shall I add update hooks to the repo for the tide_landing_page module to enable paragraphs_library? And/or config/install in that module, for fresh installs?