Try our conversational search powered by Generative AI!

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

Vote:
 

Hi!

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?

Thank you!

/J.

#61622
Sep 25, 2012 14:43
Vote:
 

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.

#61637
Sep 26, 2012 10:12
Vote:
 

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?

 

#61640
Sep 26, 2012 10:55
Vote:
 

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

http://world.episerver.com/Get-Started/EPiServer-CMS/Getting-Started---How-To/Create-a-Sub-Menu-with-EPiServerPageTree/

#61662
Edited, Sep 26, 2012 15:39
Vote:
 

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

#61663
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.