Try our conversational search powered by Generative AI!

Can't set name on block when creating new block in a Content Area


Is there som way to tweak episerver so I can set a displayname of my block when I create it from a content area?

Apr 29, 2014 8:25

You can set a name of the block only after you create it from a content area.

1. Select the block you want to rename
2. Click edit
3. If you scroll up, you'll see the name property

Take a look at this image for more details:

Edited, Apr 29, 2014 9:29

No, I wan't to force the user to select a name for the block at the time of the creation of the block. (The same view you get when you create block from the + in the assets pane)

Apr 29, 2014 9:41

Not possible when you create a block from content area, only from assets pane.

Edited, Apr 29, 2014 10:00

You can make a property on the block named Name and make it mandatory, it will override the built-in one. Than you can hide a built-in one for better user experience. See this discussion:

Apr 29, 2014 11:47

Now I have added a required property namned "Name" to my block. I have also made the HideNameEditorDescription from the forum post you linked.

The built-in propterty "Name" is now hidden but it the overriding part does not seem to be working for me. What I write in my added property "Name" when I create a new block is not saved as the name of the block. What am I missing?

Apr 29, 2014 16:16

Now that I read Thomas's description of the issue once more, it's not actually overriding the property. What you can do is the following:

  1. Add a required property (now you have Name there, so that might be the one)
  2. Hook to SavingContent event and set the built-in Name (from IContent) to your Name
  3. You may still keep the editor descriptor that helps you hide the name in the header

Hope this helps.


Apr 29, 2014 16:25

Might be that you will have to do it on publishing event instead, if it's different from the value of your custom Name.

Edited, Apr 29, 2014 16:28

I hooked on the on publishing event and it works great when I create a block from the content area. When I create a block from the assets pane (+) There is 2 fields for Name. (I do have my HideNameEditorDescription still). If I write a name in the required Name field of the block and then click create I get a popup that says that I should give a more descriptive name to my block (showing the built-in property default name, New block).

Why isn't the on publishing event or the editor description working in this view? 

Apr 30, 2014 8:54

The on creating event works here but I still see 2 fields for name, plus a popup when I click create and don't have filled in anything on the built-in property name.
(sorry about the swedish)


Edited, Apr 30, 2014 9:51
* 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.