PageTree issue / Controlling what's being listed in specific menus



I am currently using a PageTree to view the hierarchy of a webpage (my code is based on this: It displays links to each site with StartPage as a start reference.

The problem is that when I add a page as a child to another page i have to choose the option to display this page in menus (in edit mode), and at the same time as the item is displayed in the PageTree it's also appearing in the MainMenu in the top of page.

Is there any way to setup new pages to be shown only in the pagetree?

Thank you!


Sep 25, 2012 14:43

Try changing EnableVisibleInMenu for your PageTree Control and see if this can help you.

If not you can also add code to your Control.PageLoader.GetChildrenCallback event.

Sep 26, 2012 10:12

The EnableVisibleInMenu seems to do the trick! Thank!

However, i have stumbled into another problem. The start location for the pagetree is currently set to:

var pageRef = PageReference.StartPage;

Menu.PageLink = pageRef;

My problem with this is that my menu is displaying Level 2 pages, and i want it to display from level 3, and them stay in that formatting (i have tried to set Menu.Pagelink to Currentpage.Pagelink; but it did not work properly since this creates a dynamic pagereference).

Is there any way to staticly point to a level 2 reference, and fill the menu with it's children?


Sep 26, 2012 10:55

I'm guessing you want the pagetree connected to your mainmenu? Take a look at this post:

Edited, Sep 26, 2012 15:39

this looks like something that i can use. Thank you alot!

Sep 26, 2012 15:51
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.