Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Linus Ekström
Feb 25, 2014
  5789
(1 votes)

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: }
Feb 25, 2014

Comments

Feb 25, 2014 06:57 PM

Hi,

ExtendedMetadata doesn't contain PropertyName and Order. I have EPiServer.Shell.dll, v7.5.1002.0, am I missing something here?

Feb 26, 2014 07:31 AM

Thats odd. Both these properties are inherited from the class ModelMetadata from the assembly System.Web.Mvc.

Martin Pickering
Martin Pickering Feb 26, 2014 11:17 AM

Try...

[EditorDescriptorRegistration(TargetType = typeof (ContentData))]
public class SiteMetadataExtender : EditorDescriptor
{
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable attributes)
{
var property = metadata.Properties.FirstOrDefault(p => p.PropertyName == "icategorizable_category") as ExtendedMetadata;
if (property == null)
{
return;
}
property.GroupName = SystemTabNames.PageHeader;
property.Order = 9000;
}
}

Mari Jørgensen
Mari Jørgensen Feb 26, 2014 12:14 PM

The original blog post is titled "Moving built-in properties..." - I assume this can be done for all properties?

Feb 26, 2014 01:56 PM

@Mari: Sure, the settings header is just a grouping of properties that has a different appearance than the tabs.

Feb 26, 2014 02:07 PM

I had not referenced System.Web.Mvc, that was the problem. Thank you!

Please login to comment.
Latest blogs
Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog