private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) { return new MenuItemEntry { MenuItemId = menuPart.Id, IsMenuItem = menuPart.Is<MenuItemPart>(), Text = menuPart.MenuText, Position = menuPart.MenuPosition, Url = menuPart.Is<MenuItemPart>() ? menuPart.As<MenuItemPart>().Url : _navigationManager.GetUrl(null, Services.ContentManager.GetItemMetadata(menuPart).DisplayRouteValues), ContentItem = menuPart.ContentItem, }; }
private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart, string parentUrl) { var pluralService = PluralizationService.CreateService(new CultureInfo("en-US")); string urlFormat = parentUrl+"/{0}"; string pluralContentTypeName = pluralService.Pluralize(menuPart.MenuText); string url = string.Format(urlFormat, pluralContentTypeName); return new MenuItemEntry { MenuItemId = menuPart.Id, IsMenuItem = menuPart.Is<MenuItemPart>(), Text = menuPart.MenuText, Position = menuPart.MenuPosition, Url = url, ContentItem = menuPart.ContentItem, }; }