In my file Mvc.sitemap
, have the following node:
<mvcSiteMapNode title="Contato" controller="Home" action="Contato" classesCustomizadas="quebra contato" />
Web.config
attributesToIgnore="visibility, classesCustomizadas"
Full..
<siteMap defaultProvider="MvcSiteMapProvider" enabled="true">
<providers>
<clear />
<add name="MvcSiteMapProvider" type="MvcSiteMapProvider.DefaultSiteMapProvider, MvcSiteMapProvider"
siteMapFile="~/Mvc.Sitemap"
securityTrimmingEnabled="true"
cacheDuration="5"
enableLocalization="true"
scanAssembliesForSiteMapNodes="true"
includeAssembliesForScan=""
excludeAssembliesForScan=""
attributesToIgnore="visibility, classesCustomizadas"
nodeKeyGenerator="MvcSiteMapProvider.DefaultNodeKeyGenerator, MvcSiteMapProvider"
controllerTypeResolver="MvcSiteMapProvider.DefaultControllerTypeResolver, MvcSiteMapProvider"
actionMethodParameterResolver="MvcSiteMapProvider.DefaultActionMethodParameterResolver, MvcSiteMapProvider"
aclModule="MvcSiteMapProvider.DefaultAclModule, MvcSiteMapProvider"
siteMapNodeUrlResolver="MvcSiteMapProvider.DefaultSiteMapNodeUrlResolver, MvcSiteMapProvider"
siteMapNodeVisibilityProvider="MvcSiteMapProvider.FilteredSiteMapNodeVisibilityProvider, MvcSiteMapProvider"
siteMapProviderEventHandler="MvcSiteMapProvider.DefaultSiteMapProviderEventHandler, MvcSiteMapProvider" />
</providers>
</siteMap>
I edited the file "SiteMapNodeModel.cshtml" so he could work as follows:
@if (Model.IsCurrentNode && Model.SourceMetadata["HtmlHelper"].ToString() != "MvcSiteMapProvider.Web.Html.MenuHelper")
{
<text>@Model.Title</text>
}
else if (Model.IsClickable)
{
<a href="@Model.Url " class=">>>> Classes here <<<<<">@Model.Title</a>
}
else
{
<text>@Model.Title</text>
}
How to get the class configured in my file Mvc.sitemap
on attribute classesCustomizadas
and replace (>>>> Classes here <<<<<)?
attributesToIgnore
didn't work for me. The comma-separated list of attributes can't contain any whitespace around the commas. I'm using version 3.1. – Antiquary