IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
By definition, your field control must provide UI for both displaying and editing the value of a field. This is a typical case where you can use conditional templates. Use the following markup for the template:
First, the template registers the Telerik.Sitefinity.Web.UI namespace, to use the conditional template and SitefinityLabel.
It includes a ConditionalTemplateContainer with two templates in it - one for Read and one for Write mode. It specifies the condition on each of them to look at the value of the DisplayMode property. This property is available in the FieldControl class and is set through the definitions of your control, or automatically.
Each conditional template includes the controls that it needs to show. This sample only includes the required labels for TitleControl, DescriptionControl, and ExampleControl. These IDs correspond to the IDs that are used in the class's properties.
TitleControl
DescriptionControl
ExampleControl
With this, you have a blank template, to which you can add the custom controls for your field control.
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important