I have a page type defined in PTB and for this particular page type, I want the pages to have the VisibleInMenu property set to false by default. But when I try to set VisibleInMenu = false in the constructor for my page type, I get the following error in Edit mode:
A weird error message, since I'm not reaching for PageVisibleInMenu.
Any idea what the correct approach would be for changing the default value fo a property in a base class?
If you mean in the page type attribut the correct propertyname would be "DefaultVisibleInMenu" (DefaultVisibleInMenu = false).
This was not exactly what I was looking for, but it definitely solves the specific VisibleInMenu problem. Thank you!
But what if it is another property. If I want new pages of my page type to have its "Link type" set to "Shortcut to page in EPiServer CMS" and the "Internal Shortcut/Fetch Data from" set to the parent page, how could I do that?
Then I would attach an event to DataFactory.Instance.SavingPage in global.asax or a http module and do it from there.
protected void Application_Start(Object sender, EventArgs e)
DataFactory.Instance.SavingPage += Instance_SavingPage;
void Instance_SavingPage(object sender, EPiServer.PageEventArgs e)
if (e.Page is SomePageType)
// Do magic
OK, but what if I only want it to be default when creating a new page, letting the user alter the value if he wants to?
Saving page was the wrong event, didn't think.. :)
LoadedDefaultPageData is what you are looking for (see http://antecknat.se/blog/2008/06/09/prepopulate-fields-when-creating-page/).
Looks messy, but ok. Thanks for enlightening me!