Try our conversational search powered by Generative AI!

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

Vote:
 

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

#85522
Apr 29, 2014 8:25
Vote:
 

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: http://i.imgur.com/0sHkAtq.png

#85524
Edited, Apr 29, 2014 9:29
Vote:
 

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)

#85526
Apr 29, 2014 9:41
Vote:
 

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

#85527
Edited, Apr 29, 2014 10:00
Vote:
 

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:

http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=83118&epslanguage=en

#85536
Apr 29, 2014 11:47
Vote:
 

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?

#85574
Apr 29, 2014 16:16
Vote:
 

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.

Marija

#85577
Apr 29, 2014 16:25
Vote:
 

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

#85578
Edited, Apr 29, 2014 16:28
Vote:
 

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? 

#85598
Apr 30, 2014 8:54
Vote:
 

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.

http://imgur.com/kMskVmN
(sorry about the swedish)

 

#85601
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.