You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
In the sitemap, if i left the sitemap description attribute to empty or if it is not added in the node in sitemap file, Instead of getting the sitemap description as null or empty i am getting the title value.
In the small tag i am getting the Title value if i left empty or if didn't have description attribute. If i have some value for description i am getting correct value.
Thanks.
The text was updated successfully, but these errors were encountered:
Going back a bit, there was an inconsistency in this behavior between the XmlSiteMapBuilder and ReflectionSiteMapBuilder. The solution then was to make them both use the description by default if the title wasn't provided. At the time I didn't make an issue of it because I figured it would be more SEO friendly by default (by populating the description - and title attribute of the HTML anchor tag - automatically when it isn't provided).
In hindsight, it probably would have made more sense not to default the description during the time the SiteMap is constructed, but instead make the description default to title in the default HTML helper template so it can be changed more easily if it isn't the behavior that is desired.
This isn't tough to fix, but it would be a breaking change for anyone using custom HTML helper templates and could have drastic implications on their SEO site positioning if they are. If we follow semantic versioning to the letter, we would have to bump the major version number because of the potential impact of this change. In other words, I agree with you but can't fix this until version 5.
I suggest for the time being you add some logic to your HTML helper template to check whether the values of @Model.CurrentNode.Title and @Model.CurrentNode.Description are the same and if so, to not output the description in this case. As long as your description is always at least slightly different than title (including a change in casing or a space or period at the end), you will get the description in your output.
if (@Model.CurrentNode.Title == @Model.CurrentNode.Description){
<strong>@Model.CurrentNode.Title</strong>
}else{
<strong>@Model.CurrentNode.Title</strong><small>@Model.CurrentNode.Description</small>
}
Hi,
Thanks, That's exactly how i managed it till now. Some times due to the SitemapActionFilter attribute the condition got broken and i am seeing the static xml title value in description.
But any way. I can live with this. If its know issues then it is fine. I can understand your point.
Hi,
In the sitemap, if i left the sitemap description attribute to empty or if it is not added in the node in sitemap file, Instead of getting the sitemap description as null or empty i am getting the title value.
SiteMapTitleHelperModel.cshtml
In the small tag i am getting the Title value if i left empty or if didn't have description attribute. If i have some value for description i am getting correct value.
Thanks.
The text was updated successfully, but these errors were encountered: