In one of my previous articles I showed a small improvement for Editors. They could create a page shortcut using D&D from page tree. This time I’d like to show another feature related with D&D. I implemented functionality of populating local blocks properties from shared block instance. Editor can drop shared block on the local block to copy all properties.
Using local blocks D&D
On the Alloy demo site we have SiteLogotypeBlock.
1 2 3 4 5 6 7 8 9 |
public class StartPage : SitePageData { [Display(GroupName = Global.GroupNames.SiteSettings)] public virtual SiteLogotypeBlock SiteLogotype { get; set; } // // other properties // } |
It has two properties Title and Url. We would like to use shared block of a SiteLogotypeBlock type as a template with predefined values.
After creating few instances of SiteLogotypeBlock we can D&D blocks on the start page.
The full source code is available on github. I also created a nuget package.