Proposing a new way to get strongly typed property values recursively
Hey folks,
I've been doing a fair bit of work with Ditto, Archetype & the Property Value Converters project Jeavon created. All in all great stuff. My one frustration is GetPropertyValue(alias, recursive) when grabbing ArchetypeModels.
A quick example of why I have such a setup. Say, I have a homepage with some authoring component for some footer logic which can be overwritten at a section lower down in the content tree. Currently GetPropertyValue<ArchetypeModel>("myFooterWidget", true) would return an ArchetypeModel with an empty fieldset. This is with the use of the "Start with Add" prevalue selected for the data type.
I believe the logic for grabbing such strongly type objects isn't as flexible as it should be. I've got a proposal gist here which allows the developer to provide a linq expression for determining how recursive values should be deemed valid for plucking.
Any thoughts/feedback would be welcome. I wonder if this should be added into custom property converters, but my current approach might have a bit more flexibility should it be required.
Proposing a new way to get strongly typed property values recursively
Hey folks,
I've been doing a fair bit of work with Ditto, Archetype & the Property Value Converters project Jeavon created. All in all great stuff. My one frustration is GetPropertyValue(alias, recursive) when grabbing
ArchetypeModel
s.A quick example of why I have such a setup. Say, I have a homepage with some authoring component for some footer logic which can be overwritten at a section lower down in the content tree. Currently
GetPropertyValue<ArchetypeModel>("myFooterWidget", true)
would return anArchetypeModel
with an empty fieldset. This is with the use of the "Start with Add" prevalue selected for the data type.I believe the logic for grabbing such strongly type objects isn't as flexible as it should be. I've got a proposal gist here which allows the developer to provide a linq expression for determining how recursive values should be deemed valid for plucking.
Any thoughts/feedback would be welcome. I wonder if this should be added into custom property converters, but my current approach might have a bit more flexibility should it be required.
Thanks,
Jamie
is working on a reply...