[MenuProvider]
public class EHAppsMenuProvider : IMenuProvider
{
const string MenuPath = MenuPaths.Global + "/apps";
public IEnumerable<MenuItem> GetMenuItems()
{
var menuItems = new List<MenuItem>();
// Add Emergency Text Main & Subb menus
menuItems.Add(new SectionMenuItem("Apps", MenuPath)
{
SortIndex = SortIndex.Last + 10,
IsAvailable = (request) => PrincipalInfo.HasEditAccess
});
menuItems.Add(new UrlMenuItem("Text", MenuPath + "/Text", UriSupport.ResolveUrlFromUIAsRelativeOrAbsolute("/Text/Index"))
{
SortIndex = 1
});
return menuItems;
}
}
if you inspect what you get back from this UriSupport.ResolveUrlFromUIAsRelativeOrAbsolute("/Text/Index")
?
No, it is not about "UriSupport.ResolveUrlFromUIAsRelativeOrAbsolute".
Actually i was getting even the same result without this code.
I am using this before:-
menuItems.Add(new UrlMenuItem("Text", MenuPath + "/Text", "/Text/Index")
but what you experience now when you changed urls for the child menu items? 404? or menu is not shown at all? what are effects? asking because I have working example..
i am saying that i want show my all child menu items
but whenever i click on the newly added parent menu then
it navigates to the first child menu's url and i couldn't see the other child menu item
If you try the orginal code from the link i shared with you then it is working fine
when i click on the parent menu item then first it show it's child menu's item.
oh, ok understood now. opening 1st child menu item is by design. this is sort of like landing page for the module. if I understood you correctly then what might be missing in your case is menu rendering in the "Apps/Text/Index" view. Have you included Html.CreatePlatformNavigationMenu()
in your markup?
https://world.episerver.com/documentation/developer-guides/CMS/user-interface/extending-the-navigation/adding-and-configuring-menu-items/
I use the code form the above link present in example 4(New global menu section.).
I just only changed the url of the child menu's item and it is not working as it is showing in example 4 view.