createWidgetClass(definition)

Creates a CMS widget type without adding it to the registry of CMS widget types.

Scrivito.createWidgetClass generates a widget class using the given definition.

Analogously to an object class, a widget class defines the properties of its instances.

Please note that Scrivito.createWidgetClass does not automatically add the generated class to the registry of CMS types. Instead, it is considered an „abstract class“. An abstract class is useful:

  • as a superclass for specialized CMS widget types
  • for overloading an API method before registering the final type using Scrivito.provideWidgetClass.

Params

Example

Create a an abstract class named BaseClass and an ImageWidget subclass.