MvcSiteMapProvider
MvcSiteMapProvider copied to clipboard
Implementation of XML attribute inheritance
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:
- 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
- Add config property to setup custom inherited attributes
Best regards, Artyom
@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?
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