SaaS CMS has officially launched! Learn more now.

What are my options for getting rid of the "Name" field when creating a new page?


I have a couple Page Types where the PageName is derived from other properties and should really be automatic.  For instance, one Page Type has a "First Name" and "Last Name" property.  So, the PageName should just be "Last Name, First Name" in all cases.  Another one has a "Year" and a "Month" property, so the PageName should always be "Year-Month."

Now, I know I can hook various page creation events and set the PageName from there.  But the user still has to enter a name in a textbox in the interface.  This seems pointless, and potentially confusing since I'm going to adjust it programatically anyway when they save it.

Is there some way to prevent the "Name" field from appearing?  I'd be happy with disabling it. However, it does require input, and I don't know if there's anyway I could shortcut the validator, so my thought is that I could just diable it and put "[Auto]" in the field or something.

Has anyone done this before?  I can't imagine I'm the first one who wants to do this.

Sep 02, 2010 7:44

Try adding this to your global.asax.cs file:

protected void Application_Start(Object sender, EventArgs e)
    EPiServer.UI.Edit.EditPanel.LoadedPage += new EPiServer.UI.Edit.LoadedPageEventHandler(EditPanel_LoadedPage);
private void EditPanel_LoadedPage(EPiServer.UI.Edit.EditPanel sender, EPiServer.UI.Edit.LoadedPageEventArgs e)
    e.Page.Property["Pagename"].DisplayEditUI = false;


Sep 02, 2010 8:07

Wow.  Linus, thank you.  It works perfectly.

Sep 02, 2010 15:18
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.