Skip to content

Commit b76a900

Browse files
committed
Minor English and MyST grammar and syntax fixes.
1 parent 32d3e30 commit b76a900

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

docs/classic-ui/images.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ We will use the image object as context in the following examples.
2525

2626
## Default scales
2727

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:
2930

3031
* huge 1600:65536
3132
* great 1200:65536
@@ -176,9 +177,9 @@ scale_util = api.content.get_view("images", context, request)
176177
tag = scale_util.scale("image", width=600, height=200)
177178
```
178179

179-
(classic-ui-images-using-image_scale0-in-templates-label)=
180+
(classic-ui-images-using-image_scale-in-templates-label)=
180181

181-
### Using image_scale in templates
182+
### Using `image_scale` in templates
182183

183184
You could use the URL-variant from above, but that would be an uncached version.
184185
To create a cached scale in a page template you can do the following:
@@ -212,9 +213,10 @@ You can also provide the following keyword arguments to set `title`, `alt`, or `
212213

213214
(classic-ui-images-get-image_scale-by-cached-uid-name-label)=
214215

215-
### Get image_scale by cached UID name
216+
### Get `image_scale` by cached UID name
216217

217-
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:
218220

219221
```python
220222
import re
@@ -256,26 +258,30 @@ To access image scales, which are normally not accessible to the current user, o
256258

257259

258260
(classic-ui-images-responsive-image-support)=
261+
259262
## Responsive image support
260263

261264
Plone supports the generation of picture tags with `srcset`s for image optimization.
262-
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.
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.
263266

264267
The configuration allows you to define different picture variants, such as `Large`, `Medium`, or `Small`.
265-
Users can choose from them in editors like TinyMCE and Developers can use them in templates.
268+
Users can choose from them in editors, such as TinyMCE, and developers can use them in templates.
266269

267270

268271
(classic-ui-images-responsive-image-support-picture-variants)=
272+
269273
### Picture variants
270274

271275
In `/@@imaging-controlpanel` Plone allows you to define picture variants with a list of available image scales.
272276
These are used for HTML {term}`srcset` attributes.
273277
A `srcset` attribute can help the browser to serve the best fitting image size for the current user's display.
274278

275279

280+
(classic-ui-images-responsive-image-support-default-configuration-label)=
281+
276282
### Default configuration
277283

278-
The default configuration covers image size optimization and will provide the browser with the needed information to load the optimal image size.
284+
The default configuration covers image size optimization, and will provide the browser with the needed information to load the optimal image size.
279285

280286
```json
281287
{
@@ -306,7 +312,7 @@ The default configuration covers image size optimization and will provide the br
306312
### Optional settings
307313

308314
The `sourceset` property is an array and can have more than one entry.
309-
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.
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.
310316

311317
```json
312318
{
@@ -328,7 +334,9 @@ If we have the following two entries, the `image_srcset` outputfilter will gener
328334
}
329335
```
330336

337+
331338
(classic-ui-images-responsive-image-support-filtering-scales)=
339+
332340
#### Filtering scales
333341

334342
By default, for every `srcset`, all available scales will be included in the `srcset`.
@@ -344,7 +352,7 @@ By default, for every `srcset`, all available scales will be included in the `sr
344352
}
345353
```
346354

347-
To restrict the list of used scales inside of a `srcset`, you can set the `additionalScales` parameter with an array of allowed scales.
355+
To restrict the list of used scales inside a `srcset`, you can set the `additionalScales` parameter with an array of allowed scales.
348356
Without this parameter, all scales which are not globally excluded scales will be used.
349357

350358
```json
@@ -363,6 +371,7 @@ This means the generated `srcset` will contain the scales from `preview` up to `
363371

364372

365373
(classic-ui-images-responsive-image-support-picture-variant-in-editor)=
374+
366375
#### Hiding a picture variant in editors
367376

368377
It is possible to hide a picture variant in editors.
@@ -383,6 +392,7 @@ This is useful when you want to define a picture variant to be used in templates
383392

384393

385394
(classic-ui-images-responsive-image-support-art-direction)=
395+
386396
### Art direction
387397

388398
With image size optimization, the browser is able to choose the optimal image for each display size.
@@ -450,4 +460,3 @@ This will result in a `srcset` as in the following example for a medium image:
450460
Please note that this example has the `resolve_uid_and_caption` filter disabled to see the scale names better.
451461
The real `src` URLs look more like `http://localhost:8080/Plone50/dsc04791.jpg/@@images/778f9c06-36b0-485d-ab80-12c623dc4bc3.jpeg`.
452462
```
453-

0 commit comments

Comments
 (0)