You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -25,7 +25,8 @@ We will use the image object as context in the following examples.
25
25
26
26
## Default scales
27
27
28
-
In `/@@imaging-controlpanel` Plone allows you to configure which scales are available and what dimensions they should have. By default we have the following scales configured:
28
+
In `/@@imaging-controlpanel` Plone allows you to configure which scales are available and what dimensions they should have.
29
+
By default, we have the following scales configured:
If you only have the cached image name from an URL and need to get the image scale, unfortunately you can't use restrictedTraverse(), as this will not be able to resolve the scale. But you can use this workaround, by calling the `publishTraverse` method in `ImageScaling` directly:
218
+
If you only have the cached image name from an URL and need to get the image scale, unfortunately you can't use `restrictedTraverse()`, as this will not be able to resolve the scale.
219
+
But you can use this workaround, by calling the `publishTraverse` method in `ImageScaling` directly:
218
220
219
221
```python
220
222
import re
@@ -255,81 +257,206 @@ The `ImageScaling` view explicitly checks the permissions of the current user.
255
257
To access image scales, which are normally not accessible to the current user, override the `validate_access` method in `plone.namedfile.scaling.ImageScale`.
256
258
257
259
258
-
## `srcset` configuration
260
+
(classic-ui-images-responsive-image-support)=
259
261
260
-
In `/@@imaging-controlpanel` Plone allows you to define HTML {term}`srcset` attributes.
261
-
A `srcset` can help the browser serve the best fitting image for the current users situation.
262
-
Which image scale is best for the user can be decided on different metrics.
262
+
## Responsive image support
263
263
264
+
Plone supports the generation of picture tags with `srcset`s for image optimization.
265
+
Additionally, you can define [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) for [art direction](classic-ui-images-responsive-image-support-art-direction) and further optimization.
264
266
265
-
### viewport size
267
+
The configuration allows you to define different picture variants, such as `Large`, `Medium`, or `Small`.
268
+
Users can choose from them in editors, such as TinyMCE, and developers can use them in templates.
The `sourceset` property is an array and can have more than one entry.
315
+
If we have the following two entries, the `image_srcset` output filter will generate one `source` tag for each entry and an additional `img` tag from the last entry.
0 commit comments