Skip to content

Instantly share code, notes, and snippets.

@tompipe
Created October 7, 2016 12:17
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tompipe/87e03be7572712872e6fcb0abb6e396c to your computer and use it in GitHub Desktop.
Save tompipe/87e03be7572712872e6fcb0abb6e396c to your computer and use it in GitHub Desktop.
Nested Content Property Editor Grouping
public class NestedContentEditorGroupHandler : ApplicationEventHandler
{
protected override void OnApplicationStarted(object sender, EventArgs e)
{
base.OnApplicationStarted(sender, e);
var dtMap = Mapper.FindTypeMapFor<IDataTypeDefinition, DataTypeBasic>();
dtMap?.AddAfterMapAction((s, d) =>
{
var src = (IDataTypeDefinition) s;
var dst = (DataTypeBasic) d;
if (src.PropertyEditorAlias == "Our.Umbraco.NestedContent")
{
dst.Group = "Nested Content";
}
});
}
}
@tompipe
Copy link
Author

tompipe commented Oct 7, 2016

Groups all nested content editors in the umbraco property editor dialog

@tompipe
Copy link
Author

tompipe commented Oct 7, 2016

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment