Try our conversational search powered by Generative AI!

Detect changes on VisibleInMenu

Vote:
 

Hi!

We have a situation where we need to detect if a change has happened on the property VisibleInMenu. For instance if a page goes from invisible to visible.

I've been playing aroud with comparing

page.IsVisibleInMenu with page.Property["PageVisibleInMenu"] but I can't see any pattern on how those change.

Is there an event before PublishingPage or PublishedPage?

All help is appreciated!

Best regards,

Peter Bergqvist

#25265
Oct 16, 2008 20:29
Vote:
 

How about something like this in Global.asax.cs:

private static bool pageVisibleInMenuWhenLoaded; public void Application_Start(object sender, EventArgs e) { 	EditPanel.LoadedPage += new LoadedPageEventHandler(EditPanel_LoadedPage); 	DataFactory.Instance.PublishingPage += DataFactory_PublishingPage; } private static void DataFactory_PublishingPage(object sender, PageEventArgs e) { 	if (pageVisibleInMenuWhenLoaded != e.Page.VisibleInMenu) { 		HttpContext.Current.Response.Write("VisibleInMenu has changed!"); 	} } private static void EditPanel_LoadedPage(EditPanel sender, LoadedPageEventArgs e) { 	pageVisibleInMenuWhenLoaded = e.Page.VisibleInMenu; }
#25282
Edited, Oct 17, 2008 10:07
Vote:
 

How about something like this in Global.asax.cs:

private static bool pageVisibleInMenuWhenLoaded;

public void Application_Start(object sender, EventArgs e) {
   EditPanel.LoadedPage += new LoadedPageEventHandler(EditPanel_LoadedPage);
   DataFactory.Instance.PublishingPage += DataFactory_PublishingPage;
}

private static void DataFactory_PublishingPage(object sender, PageEventArgs e) {
   if (pageVisibleInMenuWhenLoaded != e.Page.VisibleInMenu) {
      HttpContext.Current.Response.Write("VisibleInMenu has changed!");
   }
}

private static void EditPanel_LoadedPage(EditPanel sender, LoadedPageEventArgs e) {
   pageVisibleInMenuWhenLoaded = e.Page.VisibleInMenu;
}

#25283
Edited, Oct 17, 2008 10:11
Vote:
 
#25284
Oct 17, 2008 10:14
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.