MvcSiteMapProvider icon indicating copy to clipboard operation
MvcSiteMapProvider copied to clipboard

Implementation of XML attribute inheritance

Open ArtyomBaranovskiy opened this issue 11 years ago • 2 comments

Hello,

I'm using your Mvc.Sitemap provider library and recently faced the following problem: I need my custom xml node attributes to be inherited from parent nodes, if there is no value in current node. I've already implemented the functionality, so please verify it and tell me, if something is wrong (I've refactored the code a bit).

Short commit history:

  1. Implement loading inherited attributes
  • The attribute value is got from current node OR from the closest parent node which contains not-null/non-empty value
  • Refactor getting inherited route values to remove several hard-coded strings and prevent copy-paste
  1. Add config property to setup custom inherited attributes

Best regards, Artyom

ArtyomBaranovskiy avatar Mar 12 '13 06:03 ArtyomBaranovskiy

@maartenba - I was thinking about adding this to v4, but then I realized this could be done in a multitude of ways. Should inheritance include routes, roles, or the other well known XML attributes as well? Perhaps this is one of those scenarios that is best left for a custom ISiteMapBuilder implementation or maybe just subclassing and overriding some of the properties of the current XmlSiteMapBuilder. Thoughts?

NightOwl888 avatar Mar 31 '13 16:03 NightOwl888

Would say all known attributes

Sent from my Windows Phone


From: NightOwl888mailto:[email protected] Sent: ‎31/‎03/‎2013 18:31 To: maartenba/MvcSiteMapProvidermailto:[email protected] Cc: Maarten Balliauwmailto:[email protected] Subject: Re: [MvcSiteMapProvider] Implementation of XML attribute inheritance (#134)

@maartenba - I was thinking about adding this to v4, but then I realized this could be done in a multitude of ways. Should inheritance include routes, roles, or the other well known XML attributes as well? Perhaps this is one of those scenarios that is best left for a custom ISiteMapBuilder implementation or maybe just subclassing and overriding some of the properties of the current XmlSiteMapBuilder. Thoughts?


Reply to this email directly or view it on GitHub: https://github.com/maartenba/MvcSiteMapProvider/pull/134#issuecomment-15693717

maartenba avatar Mar 31 '13 16:03 maartenba