This chapter provides several recipes to working with the Classic UI in Plone 6.

Add custom classes to the body element#

Body classes are generated in the LayoutPolicy.bodyClass method in the module It allows you to create your own body-classes using named adapters.

First create a class as follows.

from import IBodyClassAdapter

class CustomBodyClasses(object):
    """Additional body classes adapter."""
    def __init__(self, context, request):
        self.context = context
        self.request = request

    def get_classes(self, template, view):
        return ["additional-class", "another-css-class"]

Then register the adapter in ZCML.

    for="* *"