You use form field templates to change the appearance of the form fields in Sitefinity CMS. Every form field has built-in templates that are packaged in the same assembly.
The following procedure describes how to change the built-in form field template depending on the view engine you are using.
By default, all MVC-oriented logic must reside in the Mvc folder in the SitefinityWebApp project. This folder is created automatically by Sitefinity CMS in your web application. The new MVC form fields appear in the Sitefinity CMS toolbox
To modify the default template of the Textbox field that uses the RazorViewEngine:
NOTE: The name of the folder must correspond to the name of the form field whose template you want to change. For example, if you need to change the template of the Submit button field, you must name the folder SubmitButton.
NOTE: The name of the file must be Write.Default because the TextField controller renders a view named Write.Default when a form field is displayed in write mode, that is when the website user can input information. For more information, see Naming conventions.
NOTE: If you have existing widget template in your project’s ResourcePackages directory, it will take precedence over this file. For more information, see Priorities for resolving views.
As a result, the Testing new template text is displayed.
When you set the value of the FormControlDisplayMode attribute of the form, keep in mind the behavior of the ViewMode and DisplayMode field attributes:
To display the text field, using its read-only template, perform the following:
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