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.
With this, you have a blank template, to which you can add the custom controls for your field control.
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important