I'm a newbie and playing around with Alloy project. I have created a new page under existing Alloy Plan. But I could not see any change in main menu which is not the case when I add a new page under Start node.However I can navigate to the new page manually by entering url as ".../AlloyPlan/newpage". How do the things work?
My page hierarchy is as below.
There should be a checkbox on the page called "show in navigation" I beleve. This needs to be on for it to show in the menu
Yes, that field's name is Display in navigation. Is it checked in your case, Xrtquot?
Display in navigation is checked. The helper method (MenuList) has code below which does not return new page. I think the implementation of menulist is not the proper one for multi-level menu. Can anybody provide any simple implementation for multi-level menu? Thanks.
var menuItems = contentLoader.GetChildren<PageData>(rootLink)
.Select(x => CreateMenuItem(x, currentContentLink, pagePath, contentLoader, filter))
GetChidren is only the parent level so would only be displaying items directly under the first level of the start page. E.g.
It's been a while since looking at Alloy but if the code is only one level so would be the markup as a multilevel would usually suggest a dropdown or megamenu design needed to handle sub pages of the primary navigation. The code can be adapted you've just got to take the menu items collection loaded in and load it's children as well but you'll need to write some this code with some classes to structure the viewmodels for output in to the front end.
@Scott Reed: Any example please.
Instead of GetChildren use GetDescendents. If you want to list out all the pages under the current page
var repo = ServiceLocator.Current.GetInstance();
repo.GetDescendents(Model.CurrentPage.ContentLink).Where(p => repo.Get(p) is Education).Select(repo.Get)