November Happy Hour will be moved to Thursday December 5th.

New page not showing in main menu

Vote:
 

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.

Start

-Alloy Plan

--newpage

-Alloy Track

-Alloy Meet

#200325
Jan 09, 2019 5:58
Vote:
 

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

#200359
Jan 09, 2019 15:27
Vote:
 

Yes, that field's name is Display in navigation. Is it checked in your case, Xrtquot?

#200371
Jan 09, 2019 18:44
Vote:
 

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)
    .FilterForDisplay(requirePageTemplate, requireVisibleInMenu)
    .Select(x => CreateMenuItem(x, currentContentLink, pagePath, contentLoader, filter))
    .ToList();

#200375
Jan 10, 2019 3:09
Vote:
 

GetChidren is only the parent level so would only be displaying items directly under the first level of the start page. E.g.

-Alloy Plan

-Alloy Track

-Alloy Meet

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.

#200384
Jan 10, 2019 9:50
Vote:
 

@Scott Reed: Any example please.

#200799
Jan 25, 2019 5:45
Vote:
 

Hi,

Instead of GetChildren use GetDescendents. If you want to list out all the pages under the current page

Ex

var repo = ServiceLocator.Current.GetInstance();
repo.GetDescendents(Model.CurrentPage.ContentLink).Where(p => repo.Get(p) is Education).Select(repo.Get)

Thanks

Ravindra

#204571
Jun 10, 2019 10:12
* 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.