MvcSiteMapProvider icon indicating copy to clipboard operation
MvcSiteMapProvider copied to clipboard

"GrandparentNode" AttributeTarget

Open bryanjd opened this issue 7 years ago • 0 comments

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?

bryanjd avatar Nov 30 '16 03:11 bryanjd