Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jamie Pollock 174 posts 853 karma points c-trib
    Oct 16, 2014 @ 12:40
    Jamie Pollock
    0

    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.

    Thanks,
    Jamie

Please Sign in or register to post replies

Write your reply to:

Draft