-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add image srcset definition and json schema #5
Add image srcset definition and json schema #5
Conversation
91724ae
to
8dcbd0f
Compare
8dcbd0f
to
2799df3
Compare
Sorted the attributes alphabetically.
Just for the record. We are adding a new srcset configuration option for Classic here and it totally unclear how this would relate to the srcset handling and configuration of Volto. If we continue to move in that direction, we risk that we will end up with two srcset configurations in the Plone control panel (one for Classic and one for Volto). If we continue to treat control panels in Plone 6 as "Classic only" and ignore Volto in the picture I honestly don't see how we could keep both together in the long run. We plan to address the handling of control panels in Volto in general during Beethoven Sprint in the first week of May. Adding new options does not make our job easier, especially not if they are conflicting with settings that we plan to have in Volto as well. I don't want to hold back the development of Classic here and srcsets are for sure a useful feature. Though, if we don't find a solution for these kinds of problems, my fear is that we will end up with a fork of Volto and Classic at some point. The bottom line is this: if our plan is to continue to add new features to Plone Classic and we don't have the time or energy to sync our efforts, we should say this clearly right away and then live (and plan) with the consequences. It is essential IMHO that the Plone community understands that the @plone/volto-team is always on the "weak end" of things here. We rely on Plone Core/Base/Classic and we need to take any change into account and make sure things work and do not affect Volto in a negative way. If we treat Plone 6 (Volto) as a product, we must not ship a control panel setting that has no effect whatsoever (I am aware that we already have lots of those anyways and that we need a solution to this in general). @plone/framework-team I'd like to put this on the agenda for our next meeting. |
It might be a good idea to tackle this at the connected Bonn/Bukarest sprint? |
My 5c: @nzambello worked his ass off in: This PR is still not merged, but it would be amazing if we syncronize the efforts and do not come up with different implementations/solutions. Also, I do not see why it's needed so many "config" in the panel... (in fact, a full control panel at all). Nicola didn't need that much, I think he's only working with the current scales and calculating CSS from that. Also, if we rely on integrators to come up with the right CSS for each available scale, instead of guiding them, the most probable thing that will happen is that any won't work at the end. We will hopefully finish the PR during the upcoming Beethoven sprint. |
Completely agree with @sneridagh. |
@@ -57,13 +60,55 @@ def dump_json_to_text(obj): | |||
Disallow: /*view$ | |||
""" | |||
|
|||
IMAGE_SRCSET_SCHEMA = json.dumps( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't exactly the most beautiful thing to see...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? B/c it is on import time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this variable at all?
This is just a string, why not having it the image_srcsets
field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would look ugly in the field definition because there is so much indentation. Calling black
on it could even make it worse due to the line length. And we then have two big dictionaries within the field.
default={ | ||
"large": { | ||
"title": "Large", | ||
"preview": "++theme++barceloneta/static/preview-image-large.png", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mentions barceloneta, I am not really sure we want to have it in plone.base
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well. difficult. I think we can go with it, but it is a bit ugly to forward reference defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking further, maybe it would be better to not have any complex defaults in here and configure them in the XML in Products.CMFPlone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it would be better to have this setup by barceloneta/volto generic setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so far it's mor of an example, we can leave this property out of core anyway.
This is meant to have a preview in the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it is time for a site profile package in the core? So for classic we could have this and for volto there can be others? Usually it is done out of core for site installations but here we will have different setups. Worth it?
I think we need this. CSS is not enough to deliver different different images for different resolutions. You for sure can strip this down, but its not how modern web works. In our recent project I worked together with a young webdev who wondered why Plone is so limited when it comes to modern srcset and scaling, even why no webp is available. Here we are on multiple levels in the past and need to improve. I talked with @MrTango and others about this and he really looked into the current state of image delivery. So: CSS is possible, but not enough. Really. |
From the looks of it, the PR from Nicola creates tags like this when you request an image for scale 'large':
So you get the requested scale, plus in the srcset you get url and width of all available scales. It does not look like this would be in any way affected by the new control panel setting. Nor does this seem to need an extra setting of its own. So I think the Volto team should be fine with this. I hope so. I can certainly misinterpret things, I did not fully read the Volto PR. If an imaging control panel in Volto reads and shows the |
I remember when Plone was full of portal_skin folders and features were in the scripts/templates. More than classic/volto thing, this is a client/server. The srcset feature is server side or client side feature or 50/50? Settings are in the ZODB/zcml or in config files/command line parameters? |
Co-authored-by: Alessandro Pisa <[email protected]>
Let's take @jensens recommendation and discuss this during Beethoven Sprint. Most folks involved in the discussion will be there. I guess this will be hybrid discussion/meeting anyways, so anyone who is interested can join us. I will post updates here. |
move _createObjectByType as unrestricted_construct_instance to here
Show Collection, hide Image and File in Navigation
Sorted the attributes alphabetically.
Co-authored-by: Alessandro Pisa <[email protected]>
…ourcesets-settings' into mrtango-image-handling-sourcesets-settings
Co-authored-by: Alessandro Pisa <[email protected]>
…ourcesets-settings' into mrtango-image-handling-sourcesets-settings
needs an upgrade step in plone.app.upgrades to load the config