London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
If you mean in the page type attribut the correct propertyname would be "DefaultVisibleInMenu" (DefaultVisibleInMenu = false).
/Erik
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.
Something like
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/).
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:
"Property 'PageVisibleInMenu' does not exist, can only assign values to existing properties"
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?