How to override the insert backend template of a custom modu

Posted by Community Admin on 05-Aug-2018 16:48

How to override the insert backend template of a custom module

All Replies

Posted by Community Admin on 24-Feb-2011 00:00

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

Posted by Community Admin on 07-Mar-2011 00:00

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:

Copy Code
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
;

You need to add the TemplatePath pointing to your custom template like this,
Copy Code
TemplatePath = "~/YourCustomTemplate.aspx"

You can look through the Products module code that shipped as a sample in the SDK package. There you can see how the templates are used and how you can map and persist fields.


Kind regards,
George
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!

This thread is closed