maartenba / MvcSiteMapProvider

An ASP.NET MVC SiteMapProvider implementation for the ASP.NET MVC framework.
Microsoft Public License
538 stars 218 forks source link

"GrandparentNode" AttributeTarget #455

Open bryanjd opened 7 years ago

bryanjd commented 7 years ago

I recently came across the need to be able to specify the Title for the "grandparent" node of the current node.

My specific need involved drilling into archived content by year, month, and day. For example, given the snippet below, you might have a breadcrumb similar to: Archives / 2014 / November / 28th.

[SiteMapTitle("ArchiveDay")]
[SiteMapTitle("ArchiveMonth", Target = AttributeTarget.ParentNode)]
[SiteMapTitle("ArchiveYear", Target = AttributeTarget.GrandparentNode)]
[Route("archives/{year}/{month}/{day}")]
public async Task<ActionResult> PostsByDay(int year, int month, int day)
{
    ...

Is there any interest in adding this functionality?