volto icon indicating copy to clipboard operation
volto copied to clipboard

Unify the use of the optional `preview_image_link` across Volto

Open sneridagh opened this issue 1 year ago • 6 comments

PLIP (Plone Improvement Proposal)

Responsible Persons

Proposer: Víctor Fernández de Alba (@sneridagh)

Seconder:

Abstract

Currently, Plone/Volto use preview_image field by default in content types to store images as an attribute (NamedBlobImage) in the DX content type itself. This could lead to duplication in case you want to reuse images across your content. To solve this, we created a preview_image_link field that stores a RelationChoice pointer instead (in the server as a resolveuid).

We need to make sure that Volto supports it OOTB in the same use cases that preview_image is used, and that nowhere it's hardcoded to use preview_image.

Motivation

Allow reusable images and open the door to a DAMS (Digital Asset Management System) in Plone.

Assumptions

No preconditions.

Proposal & Implementation

Search the codebase for preview_image usage and make sure that it does work for preview_image_link use case too.

Deliverables

  • Acceptance fixture and tests for the preview_image_link
  • Documentation on how to use preview_image_link

Risks

No risks.

Participants

sneridagh avatar Jan 16 '24 08:01 sneridagh

@sneridagh What is the specific proposal?

plone.volto already supports the preview_image_link behavior, but it is not enabled by default.

Is this a proposal to disable the preview_image behavior and enable preview_image_link by default?

We could pretty easily do that for new sites only, and thus avoid a migration (as long as we still support the old preview_image behavior when it is used)

If we want to get rid of preview_image entirely and always use preview_image_link, that would require a migration which creates a new Image content item for each image that is currently stored in an image field. That could take quite some time for a large site, and bloat the size of the catalog.

It can also be a complicated question how to handle translations when the images are separate content items.

davisagli avatar Jan 16 '24 23:01 davisagli

This was motivated by the request @tisto did the other day. I wanted to put it on the table to start discussions. I know that the migration could be painful. I was wondering if we can have it in specific distributions. Also, to raise awareness of this option, since I realised that even some members of the Volto Team didn't know about it.

sneridagh avatar Jan 17 '24 07:01 sneridagh

@sneridagh Like I said, I'm not sure we need the migration. We could make the switch for new sites only.

davisagli avatar Jan 17 '24 07:01 davisagli

@davisagli @sneridagh I agree with David. We only need this as an option for new sites so that integrators can choose. If we want to make this a default at some point is a different discussion. I would love to see an option that allows both uploading an image and re-using an existing image. However, this is a bit more complicated.

tisto avatar May 07 '24 05:05 tisto

@tisto @davisagli ok, however, we have to make sure that it is supported everywhere thorough the Volto code base (also, I received feedback from some Volto Team Members that they did not know about this, so we will need to put some effort in documenting it properly).

OTOH, if we want at some point to integrate the DAMS in Volto we might want to reconsider this.

sneridagh avatar May 07 '24 06:05 sneridagh

@tisto @davisagli I updated the description and reach of the PLIP.

sneridagh avatar May 07 '24 07:05 sneridagh