File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1+ (classic-ui-recipes-label)=
2+
13# Recipes
24
5+ This chapter provides several recipes to working with the Classic UI in Plone 6.
6+
37
8+ (classic-ui-recipes-add-custom-classes-to-body-label)=
49
510## Add custom classes to the ` body ` element
611
7- Body classes are generated in the ` LayoutPolicy.bodyClass ` method in module ` plone.app.layout.globals.layout ` .
8- Contained is a feature to plugin in own body-classes using named adapters.
12+ Body classes are generated in the ` LayoutPolicy.bodyClass ` method in the module ` plone.app.layout.globals.layout ` .
13+ It allows you to create your own body-classes using named adapters.
914
10- Create a class like so:
15+ First create a class as follows.
1116
12- ``` Python
17+ ``` python
1318from plone.app.layout.globals.interfaces import IBodyClassAdapter
1419
1520@implementer (IBodyClassAdapter)
@@ -21,12 +26,11 @@ class CustomBodyClasses(object):
2126
2227 def get_classes (self , template , view ):
2328 return [" additional-class" , " another-css-class" ]
24-
2529```
2630
27- Then register the adapter in ZCML:
31+ Then register the adapter in ZCML.
2832
29- ``` XML
33+ ``` xml
3034<adapter
3135 factory =" .custombodyclasses.CustomBodyClasses"
3236 for =" * *"
You can’t perform that action at this time.
0 commit comments