How to override the insert backend template of a custom module
Hi,
How do I override/extend the backend template of a custom module? Can I implement an .ascx template containing the fields in the module and reffer to that instead of the autogenerated view? If so how to map the individual field on the custom template so that Sitefinity know which fild on the template is mapped to which field on the module?
Thanks,
Duneel
Hello Duneel,
Which template exactly you would like to override? If you mean the DetailForm template, you can do it by specifying an external template in the definitions of your module. Let's say your module is called ProductsModule, then the definition of the detail form may look like:
var productsEditDetailView =
new
DetailFormViewElement(backendContentView.ViewsConfig)
Title =
"EditItem"
,
ViewName = ProductsDefinitions.BackendEditViewName,
ViewType =
typeof
(DetailFormView),
ShowSections =
true
,
DisplayMode = FieldDisplayMode.Write,
ShowTopToolbar =
true
,
ResourceClassId =
typeof
(ProductsResources).Name,
WebServiceBaseUrl =
"~/Sitefinity/Services/Content/Products.svc/"
,
IsToRenderTranslationView =
true
;
TemplatePath =
"~/YourCustomTemplate.aspx"