Skip to content

Commit 7242f42

Browse files
authored
Merge branch 'integratel-coredev.buildout-2' into coredev.buildout-continuous-integration-fixes
2 parents 7605c31 + 21df2a7 commit 7242f42

File tree

5 files changed

+81
-31
lines changed

5 files changed

+81
-31
lines changed

docs/classic-ui/images.md

+24-8
Original file line numberDiff line numberDiff line change
@@ -285,18 +285,34 @@ To access image scales, which are normally not accessible to the current user, o
285285

286286
## Responsive image support
287287

288-
Plone supports the generation of picture tags with `srcset`s for image optimization.
288+
Plone supports the generation of [`picture`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture) tags with `srcset`s for image optimization.
289289
Additionally, you can define [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries) for [art direction](classic-ui-images-responsive-image-support-art-direction) and further optimization.
290290

291-
The configuration allows you to define different picture variants, such as `Large`, `Medium`, or `Small`.
291+
The configuration allows you to define different `picture` variants, such as `Large`, `Medium`, or `Small`.
292292
Users can choose from them in editors, such as TinyMCE, and developers can use them in templates.
293293

294+
To generate a `picture` tag, use the following code.
295+
296+
```python
297+
from plone import api
298+
299+
scale_util = api.content.get_view("images", context, request)
300+
tag = scale_util.picture("image", scale="larger", picture_variant="large")
301+
```
302+
303+
The same can be done from a template.
304+
305+
```xml
306+
<div tal:define="scale_view context/@@images">
307+
<img tal:replace="structure python:scale_view.picture('image', scale='larger', picture_variant='large'" />
308+
</div>
309+
```
294310

295311
(classic-ui-images-responsive-image-support-picture-variants)=
296312

297-
### Picture variants
313+
### `picture` variants
298314

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

@@ -396,10 +412,10 @@ This means the generated `srcset` will contain the scales from `preview` up to `
396412

397413
(classic-ui-images-responsive-image-support-picture-variant-in-editor)=
398414

399-
#### Hiding a picture variant in editors
415+
#### Hiding a `picture` variant in editors
400416

401-
It is possible to hide a picture variant in editors.
402-
This is useful when you want to define a picture variant to be used in templates only.
417+
It is possible to hide a `picture` variant in editors.
418+
This is useful when you want to define a `picture` variant to be used in templates only.
403419

404420
```json
405421
"leadimage": {
@@ -533,4 +549,4 @@ This information shows we have everything we need to generate our image URLs, wi
533549
width="${python: preview['width']}"
534550
height="${python: preview['height']}" />
535551
</li>
536-
```
552+
```

docs/classic-ui/mockup.md

+28-5
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,39 @@ myst:
33
html_meta:
44
"description": "Mockup together with Patternslib are used to build the UI toolkit for Classic UI, a frontend for Plone."
55
"property=og:description": "Mockup together with Patternslib are used to build the UI toolkit for Classic UI, a frontend for Plone."
6-
"property=og:title": "Mockup"
7-
"keywords": "Mockup, Patternslib, Classic UI, frontend, Plone"
6+
"property=og:title": "Mockup and Patternslib"
7+
"keywords": "Mockup, Patternslib, Classic UI, plonecli, bobtemplates.plone, mr.bob, frontend, Plone"
88
---
99

10-
(mockup-label)=
10+
(mockup-and-patternslib-label)=
1111

12-
# Mockup
12+
# Mockup and Patternslib
1313

1414
{term}`Mockup` together with {term}`Patternslib` are used to build the UI toolkit for {term}`Classic UI`, a frontend for Plone.
1515

1616
View the [interactive documentation of Mockup](https://plone.github.io/mockup/).
1717

18-
For more information, visit the [Mockup repository on GitHub](https://github.com/plone/mockup).
18+
19+
## Get started
20+
21+
[bobtemplates.plone](https://github.com/plone/bobtemplates.plone) provides [mr.bob](https://mrbob.readthedocs.io/en/latest/) templates to generate packages for Plone projects.
22+
[plonecli](https://github.com/plone/plonecli) provides a command line client for bobtemplates.plone.
23+
24+
Install plonecli into your Python user packages to make it available to all your projects.
25+
26+
```shell
27+
pip install plonecli --user
28+
```
29+
30+
Create a theme package add-on with {term}`plonecli`.
31+
32+
```shell
33+
plonecli add mockup_pattern
34+
```
35+
36+
37+
## References
38+
39+
- {ref}`v60-mockup-resource-registry-label` in Plone 6.0
40+
- [Mockup repository on GitHub](https://github.com/plone/mockup)
41+
- [Patternslib](https://patternslib.com/)

docs/classic-ui/module-federation.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,24 @@ const package_json_patternslib = require("@patternslib/patternslib/package.json"
5959
Then find the following line.
6060

6161
```js
62-
config = patternslib_config(env, argv, config, ["@plone/mockup"]);
62+
config = patternslib_config(env, argv, config, ["@plone/mockup"]);
6363
```
6464

6565
Below this line add the following.
6666

6767
```js
68-
config.plugins.push(
69-
mf_config({
70-
name: "myaddon",
71-
filename: "myaddon-remote.min.js",
72-
remote_entry: config.entry["myaddon.min"],
73-
dependencies: {
74-
...package_json_patternslib.dependencies,
75-
...package_json_mockup.dependencies,
76-
...package_json.dependencies,
77-
},
78-
})
79-
);
68+
config.plugins.push(
69+
mf_config({
70+
name: "myaddon",
71+
filename: "myaddon-remote.min.js",
72+
remote_entry: config.entry["myaddon.min"],
73+
dependencies: {
74+
...package_json_patternslib.dependencies,
75+
...package_json_mockup.dependencies,
76+
...package_json.dependencies,
77+
},
78+
})
79+
);
8080
```
8181

8282
Replace the name `myaddon` with your add-on bundle's unique name.
@@ -93,7 +93,7 @@ To preserve compatibility with older add-ons and JavaScript implementations, the
9393
Constructs like the following still work:
9494

9595
```js
96-
(function($) {
97-
// JS code which uses $
98-
})(jQuery);
96+
(function($) {
97+
// JS code which uses $
98+
})(jQuery);
9999
```

docs/classic-ui/static-resources.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ myst:
1414
We often want to ship a website with a static resource, such as an image, icon, CSS, or JavaScript file.
1515
For this, we need to register static resources.
1616

17+
```{seealso}
18+
For some additional implementation information, see {ref}`classic-ui-theming-from-scratch-theme-label`.
19+
```
20+
1721

1822
(classic-ui-static-resources-registering-label)=
1923

@@ -96,4 +100,4 @@ The following attributes are available for registering a static resource:
96100

97101
## Loading order of resources
98102

99-
`depends` is used to define the loading order of resources, by specifying the name of the depending bundle.
103+
`depends` is used to define the loading order of resources by specifying the name of the depending bundle.

docs/classic-ui/theming/from-scratch.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Theming based on a filesystem package without any dependency.
2525
- No Diazo needed
2626

2727

28+
(classic-ui-theming-from-scratch-package-label)=
29+
2830
## Theme package
2931

3032
- Create a theme package as explained here.
@@ -33,6 +35,8 @@ Theming based on a filesystem package without any dependency.
3335
- Static files
3436

3537

38+
(classic-ui-theming-from-scratch-static-files-label)=
39+
3640
## Static files
3741

3842
Register directory to keep static files
@@ -49,6 +53,9 @@ Directory: `src/plonetheme/munich/browser/static`
4953
/>
5054
```
5155

56+
57+
(classic-ui-theming-from-scratch-theme-label)=
58+
5259
## Theme
5360

5461
### Manifest
@@ -161,7 +168,7 @@ To do so, follow this guide.
161168
- Add a script in {file}`package.json` to compile the CSS.
162169

163170
```json
164-
"css-compile-main": "sass --load-path=node_modules --style expanded --source-map --embed-sources --no-error-css plone.scss:../static/plone.css"
171+
"css-compile-main": "sass --load-path=node_modules --style expanded --source-map --embed-sources --no-error-css plone.scss:../static/plone.css"
165172
```
166173

167174
```{tip}

0 commit comments

Comments
 (0)