as my primary reference, I have been looking into a way to extend the DetailFormView. For instance, I would like to attach additional functionality to the events triggered when publishing or Saving a Product as a draft.
Using this reference:
How to add predefined values to the backend create view of Dynamic content items
All of this is done client-side, by a control called DetailFormView. This is one of our most complex controls as it accommodates the create/edit functionality for all content types in Sitefinity. As such we have exposed certain extensibility points which we can benefit from, and plug some custom logic. This is done via an Extension script. In the extension script we can hook up to a particular event thrown by the DetailFormView and work with the items we get at this point.
There's another thread:
How to extend a backend view (Insert) of a custom module
Which looked promising, but seems a bit dated after looking at the most up-to-date implementation in the github codebase:
var productImageField = new ImageFieldElement(mainSection.Fields)
ID = "avatarField",
DataFieldName = "ProductImage",
DisplayMode = displayMode,
UploadMode = ImageFieldUploadMode.Dialog,
Title = "ProductImageFieldTitle",
WrapperTag = HtmlTextWriterTag.Li,
CssClass = "sfUserAvatar",
ResourceClassId = typeof(ProductsResources).Name,
DataFieldType = typeof(ContentLink),
DefaultSrc = "~/SFRes/images/ProductCatalogSample/Images.NoProductImage.png", // put your default image location example:
SizeInPx = 100
Plus, it really is addressing adding additional fields and functionality within the page, not hooking into existing functionality or events like the publish/save a draft.
My goal is to do something like this (Telerik.Sitefinity.Samples.Products/SitefinityWebApp/Global.asax.cs):
private void CreateSampleWorker(object args)
var result = SampleUtilities.CreatePage(new Guid(ProductsPageId), ProductsPageName, true);
SampleUtilities.SetTemplateToPage(new Guid(ProductsPageId), new Guid(SamplesTemplateId));
ProductsView productsView = new ProductsView();
SampleUtilities.AddControlToPage(new Guid(ProductsPageId), productsView, "Content", "Products Widget");
upon publishing or saving a product as a draft.