Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make teaser block dynamic #6023

Open
3 tasks
pbauer opened this issue May 16, 2024 · 0 comments
Open
3 tasks

Make teaser block dynamic #6023

pbauer opened this issue May 16, 2024 · 0 comments
Assignees
Milestone

Comments

@pbauer
Copy link
Sponsor Member

pbauer commented May 16, 2024

PLIP (Plone Improvement Proposal)

Responsible Persons

Proposer: Philip Bauer @pbauer

Seconder:

Abstract

Separated from #4208
Make teasers show dynamic data by default. Optionally users can choose to overwrite the data (old behavior)

Motivation

A teaser block currently does not change when the target-object is changed. This is breaking the expectations of most users.

Assumptions

Proposal & Implementation

All teasers are by default dynamic.
The teaser block gets a checkbox that allows to override a teaser. Checking it shows the teasers-fields that are read from the target.
The override-feature can be disabled globally in the volto registry.

A serializer in plone-restapi for the teaser block gets the data of the target to display if the block is not set to overwrite. So no additional requests are necessary to get the dynamic data on a lite with many teasers.

Extending the data is possible by adding a adapter for IJSONSummarySerializerMetadata. We could also try to configure that in the frontend by storing what is now selectedItemAttrs in the data of each teaser and using that in the serializer to add additional metadata.

Migration: We should prevent existing teaser to change only if you update Plone (volto and restapi). With the implementation in plone/plone.restapi@fb62f80 a teaser that was added before the overwrite-bool was added to the schema will be overwritten until the editor changes that.

The implementation is built based on #4790 by @steffenri, @nileshgulia1, @claudiaifrim and @pbauer and the block-serializer of @davisagli

Deliverables

Risks

The change in plone.restapi must not have any effect if used with a older version of Volto. That is already the case.
The change in Volto only works when used together with the updated version of restapi. I guess that is acceptable.

Participants

@pbauer
@pnicolli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In review
Development

No branches or pull requests

3 participants