Recently I added two new to an existing Mvc.sitemap and all was find. These were appearing within a menu and breadcrumb.
Menu:
@Html.MvcSiteMap().Menu("BootstrapMenuHelperModel")
Using the model
MvcSiteMapProvider.Web.Html.Models.MenuHelperModel
Breadcrumb:
@Html.MvcSiteMap().SiteMapPath("BootStrapBreadcrumb")
Using the model
SiteMapPathHelperModel
Wanting to prevent the two new nodes from being displayed in the menu I added a new custom attribute to the mapSiteMapNodes and then within the BootstrapMenuHelperModel template I added logic to handle the custom attribute and prevent them from being displayed. All good so far.
However after adding the custom attribute I have notice that the breadcrumbs are not being displayed and when looking at the SiteMapPathHelperModel Nodes the count is zero, it was previously two. (Home and my new link)
Any ideas as to why custom attribute is preventing the SiteMapPathHelperModel Nodes from being populated.
As per the documentation, you need to manually configure custom attributes to be ignored when matching route values by specifying them in the AttributesToIgnore configuration setting.
Recently I added two new to an existing Mvc.sitemap and all was find. These were appearing within a menu and breadcrumb.
Menu:
@Html.MvcSiteMap().Menu("BootstrapMenuHelperModel")
Using the modelMvcSiteMapProvider.Web.Html.Models.MenuHelperModel
Breadcrumb:
@Html.MvcSiteMap().SiteMapPath("BootStrapBreadcrumb")
Using the modelSiteMapPathHelperModel
Wanting to prevent the two new nodes from being displayed in the menu I added a new custom attribute to the mapSiteMapNodes and then within the BootstrapMenuHelperModel template I added logic to handle the custom attribute and prevent them from being displayed. All good so far.
However after adding the custom attribute I have notice that the breadcrumbs are not being displayed and when looking at the SiteMapPathHelperModel Nodes the count is zero, it was previously two. (Home and my new link)
Any ideas as to why custom attribute is preventing the SiteMapPathHelperModel Nodes from being populated.
Cheers