I am currently using a PageTree to view the hierarchy of a webpage (my code is based on this: http://epiwiki.se/developing/episerver-cms/web-controls/pagetree). 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?
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.
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?
I'm guessing you want the pagetree connected to your mainmenu? Take a look at this post:
this looks like something that i can use. Thank you alot!