Skip to content

Commit b81b1f6

Browse files
committed
add example for js and css bundle
1 parent 4b2aa09 commit b81b1f6

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/classic-ui/static-resources.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ We often want to ship a website with a static resource, such as an image, icon,
1515
For this, we need to register static resources.
1616

1717

18+
(classic-ui-static-resources-registering-label)=
1819
## Registering javascript and css
1920

2021
To register a static resource in Plone 6, we need to use the `plone.base.interfaces.resources.IBundleRegistry` interface.
@@ -36,21 +37,6 @@ The js files have to be in the `browser/static` folder of your Plone 6 project.
3637

3738
You can register a CSS resource in the same way.
3839

39-
```xml
40-
<registry>
41-
<records interface="plone.base.interfaces.resources.IBundleRegistry" prefix="plone.bundles/css">
42-
<value key="enabled">True</value>
43-
<value key="csscompilation">++plone++myproject.site/style.min.css</value>
44-
<value key="jscompilation">++plone++myproject.site/javascript.min.js</value>
45-
<value key="load_async">False</value>
46-
<value key="load_defer">False</value>
47-
<value key="depends">plone</value>
48-
</records>
49-
</registry>
50-
```
51-
52-
Registering a js file and a css file in the same bundle is also possible.
53-
5440
```xml
5541
<registry>
5642
<records interface="plone.base.interfaces.resources.IBundleRegistry" prefix="plone.bundles/css">
@@ -61,6 +47,20 @@ Registering a js file and a css file in the same bundle is also possible.
6147
</registry>
6248
```
6349

50+
Registering a js file and a css file in the same bundle is also possible.
51+
52+
```xml
53+
<registry>
54+
<records interface="plone.base.interfaces.resources.IBundleRegistry" prefix="plone.bundles/css">
55+
<value key="enabled">True</value>
56+
<value key="csscompilation">++plone++myproject.site/style.min.css</value>
57+
<value key="jscompilation">++plone++myproject.site/javascript.min.js</value>
58+
<value key="load_async">False</value>
59+
<value key="load_defer">False</value>
60+
<value key="depends">plone</value>
61+
</records>
62+
</registry>
63+
```
6464

6565
(classic-ui-static-resources-available-attributeslabel)=
6666

0 commit comments

Comments
 (0)