Control definitions in Sitefinity are a developer concept that enables building structured declarative user interfaces. They facilitate reuse of components when building the backend UI and also enable third-party developers to plug their own to extend that UI. Some of the benefits of control definitions include:
- Ready to use components for commonly used functionality
- Declarative UI – specify what should appear where without actually implementing it
- Strictly defined UI structure – makes duplication easy
- Default values and behavior – override existing look and functionality by plugging in your own
- Ability to redefine existing UI from configuration
- Extensibility – an easy way to implement custom UI in the backend
- Persistence – a way to save properties of a control
Let’s take the backend of a module, to put everything into perspective. A lot of the UI elements in this backend are repeated in other modules. Some are labeled in the following screenshot.
Those are pretty much the same for all modules, pages and templates. The Grid can be further broken down into different columns, the sidebar into different links and filters and so on. Sitefinity has built-in controls implemented for all those UI elements and the elements they are composed of. They all make use of definitions and you can use them in custom modules by just creating a new definition.
Definitions are persisted values for the properties of controls that control their behavior and look. The rest of the topics in this section go through the details about control definitions.