Try our conversational search powered by Generative AI!

how to change 'undefined' block type

Vote:
 

When adding a new block for a page, some of the blocks are 'undefined'.    Are we able to change this?

Screen shot of 'undefined' in action

#203053
Apr 08, 2019 16:07
Vote:
 

That looks odd, it should say "Other Block Types".

To set your own text you would normally use GroupName in your ContentTypeAttribute:

[ContentType(DisplayName = "Banner block",
        GUID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 
        GroupName = "My blocks")]
public class BannerBlock: BlockData {}
#203054
Apr 08, 2019 17:07
Vote:
 

Thanks Erik!

#203064
Apr 08, 2019 20:24
Vote:
 

Page and Block group names are best put in a static class as shown here https://world.episerver.com/documentation/developer-guides/CMS/Content/grouping-content-types-and-properties/

This allows you to control the ordering and also apply permissions so groups can only been seen by certain users (If you need it) it also keeps everything together rather than duplicate strings across multiple blocks/pages.

Example

/// <summary>
/// The page group names used to group pages
/// </summary>
[GroupDefinitions]
public static class PageBlockGroupNames
{
    [Display(Order = 1000)]
     public const string Home = "Home";

    [Display(Order = 2000)]
     public const string Search = "Search";
}

As you can see in my example we increment in thousands. This is a tip that allows you to easily insert a group inbetween later without reorganizing all your groups.

#203087
Edited, Apr 09, 2019 10:12
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.