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

Allow Image Widget value to be an object in which case we use the '@id' for value of the Image Sidebar preview #6156

Merged
merged 5 commits into from
Jul 29, 2024

Conversation

ichim-david
Copy link
Member

@sneridagh I am not proposing we change the teaser preview_image widget however I was trying as a test bench for the new image widget what would be needed in order to remove the object browser widget and use the new image widget.

Given how the ImageWidget assumes the value is only a string and Teaser/ObjectBrowser always assumes an array of value 1 with an object I think the ImageWidget should be more flexible in displaying the "image preview" by checking the value for the array first result.

Taking the work from #6147 these changes would display the external images set as preview_image overrides, any image selected or any image uploaded.

What I would propose is to make the ImageWidget a bit more flexible as seen in the changes made here
packages/volto/src/components/manage/Widgets/ImageWidget.jsx

What do you think about my proposal?

@ichim-david ichim-david requested a review from sneridagh July 7, 2024 18:12
Copy link

netlify bot commented Jul 7, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 5a0c316
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/6690c5542956170008f541b6

@ichim-david ichim-david changed the title Proof of concept of changes needed for teaser to use the new Image Widget Allow Image Widget value to be an object in which case we use the '@id' for value of the Image Sidebar preview Jul 10, 2024
@ichim-david
Copy link
Member Author

Removed the proof of content code in favor of the proposed fix to the ImageWidget. If anyone wants to try the Teaser block using the ImageWidget you can check out this commit f685450

@sneridagh sneridagh merged commit 88e1894 into main Jul 29, 2024
71 checks passed
@sneridagh sneridagh deleted the teaser_image_widget branch July 29, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants