How to order tabs of properties for a page type

If you have quite a complicated page/block type where you end up having more than 5 tabs of properties, then you start thinking of sorting these tabs too.

To achieve this, make sure to use the attribute [GroupDefinition] and specify the Order.

 public static class MyGroupNames

    [Display(Order = 50)]
    public const string Banner = "Banner";

    [Display(Order = 101)]
    public const string Tab1 = "Tab 1";

    [Display(Order = 102)]
    public const string Tab2 = "Tab 2";

    [Display(Order = 103)]
    public const string Tab3 = "Tab 3";

    [Display(Order = 104)]
    public const string Tab4 = "Tab 4";

    [Display(Order = 105)]
    public const string Tab5 = "Tab 5";

    [Display(Order = 300)]
    public const string Sidebar = "Sidebar";

Then use these TabNames on your property.

 [Display(GroupName = LocalGroupNames.Tab1, Name = "Tab 1 Title", Order = 200)]
 public virtual String Tab1Title { get; set; }

Then voila you have a nicely grouped set of tabs in Episerver!

sorted tabs in episerver

Add a Comment

Your email address will not be published. Required fields are marked *