Tweaking the settings header in EPiServer 7.5
My collegue Kalle Ljung wrote a blog post about how to tweak the settings header that was added in an UI update last year (http://world.episerver.com/Blogs/Kalle-Ljung/Dates/2013/10/Moving-built-in-properties-to-the-settings-header-in-EPiServer-7-CMS/). Back then he wanted me to have a look at the code to see if there was any room for improvement and there sure was…though it required some stuff in EPiServer 7.5 that was yet to be released. So, now that EPiServer 7.5 has been out for quite a while, I though I’d post a simplified pattern to accomplish this. The code below shows how to move the built in category property into the settings header.
1: using System;
2: using System.Collections.Generic;
3: using EPiServer.Core;
4: using EPiServer.DataAbstraction;
5: using EPiServer.Shell.ObjectEditing;
6: using EPiServer.Shell.ObjectEditing.EditorDescriptors;
7:
8: namespace Samples
9: {
10: [EditorDescriptorRegistrationAttribute(TargetType = typeof(ContentData))]
11: public class SiteMetadataExtender : EditorDescriptor
12: {
13: public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
14: {
15: foreach (ExtendedMetadata property in metadata.Properties)
16: {
17: if (property.PropertyName == "icategorizable_category")
18: {
19: property.GroupName = SystemTabNames.PageHeader;
20: property.Order = 9000;
21: }
22: }
23: }
24: }
25: }
Comments