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
Copy file name to clipboardExpand all lines: docs/classic-ui/images.md
+60-30Lines changed: 60 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,12 +258,11 @@ To access image scales, which are normally not accessible to the current user, o
258
258
259
259
In `/@@imaging-controlpanel` Plone allows you to define HTML {term}`srcset` attributes.
260
260
A `srcset` can help the browser serve the best fitting image for the current users situation.
261
-
Which image scale is best for the user can be decided on different metrics.
262
261
263
262
264
263
### default configuration
265
264
266
-
The default configuration covers image size optimization and will provide the Browser with the needed information to load the optimal image.
265
+
The default configuration covers `image size optimization` and will provide the Browser with the needed information to load the optimal image.
267
266
268
267
```json
269
268
{
@@ -290,13 +289,35 @@ The default configuration covers image size optimization and will provide the Br
290
289
291
290
### optional settings
292
291
293
-
By default for every srcset all available scales will be included. That mean
292
+
The `sourceset` property is an array and can have more than one entry.
293
+
If we have the following two entries, the `image_srcset` outputfilter will generate one source-tag for each entry and an additional img-tag from the last entry.
294
294
295
-
To exclude some scales completely from the srcset definition, one can use `excludeScales`:
By default for every `srcset` all available scales will be included in the `srcset`.
296
318
297
319
```json
298
320
{
299
-
"excludedScales": ["tile", "icon", "listing"],
300
321
"large": {
301
322
"title": "Large",
302
323
"sourceset": [
@@ -306,7 +327,7 @@ To exclude some scales completely from the srcset definition, one can use `exclu
306
327
}
307
328
```
308
329
309
-
to restrict the list of used scales inside of a srcset, one can set the `additionalScales` parameter with an array of allowed scales.
330
+
to restrict the list of used scales inside of a `srcset`, one can set the `additionalScales` parameter with an array of allowed scales.
310
331
Without this parameter all scales which are not globally excluded scales will be used.
311
332
312
333
```json
@@ -321,15 +342,20 @@ Without this parameter all scales which are not globally excluded scales will be
321
342
},
322
343
```
323
344
324
-
This means the generated srcset will contain the scales from preview up to huge, but not mini for example.
325
-
Another benefit here is that we can define two different source tags with different scales for [art direction](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images#art_direction).
326
-
This means will force the Browser to deliver a different image for smaller screens.
345
+
This means the generated `srcset` will contain the scales from `preview` up to `huge`, but not `mini` for example.
346
+
347
+
348
+
### Art direction
349
+
350
+
With `image size optimization` the browser is able to choose the optimal image for each situation.
351
+
But we have no control lover which scale the browser will actually use.
352
+
To force the Browser to use a zoomed version of an image for smaller screens we can use media queries.
353
+
The technique is called [art direction](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images#art_direction).
327
354
328
355
Let's have a look at a more advanced configuration:
329
356
330
357
```json
331
358
{
332
-
"excludedScales": ["tile", "icon", "listing"],
333
359
"large": {
334
360
"title": "Large",
335
361
"sourceset": [
@@ -339,16 +365,16 @@ Let's have a look at a more advanced configuration:
0 commit comments