Copied to clipboard

Flag this post as spam?

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

  • Laurence Gillian 595 posts 1212 karma points
    Dec 01, 2016 @ 20:14
    Laurence Gillian

    Ditto and The Grid

    I was thinking something along the lines of:

    public IPublishedProperty Body { get; set; }

    But alas! ;-) Is it possible? Or best to handle directly in the view?

  • Lee Kelleher 3898 posts 14772 karma points MVP 10x admin c-trib
    Dec 01, 2016 @ 21:51
    Lee Kelleher

    Hi Lau,

    If no processor attribute is set on a POCO property, then Ditto will default to using the UmbracoProperty processor. This makes a call to Umbraco's GetPropertyValue("alias") ... so it returns the property's value, not the IPublishedProperty.

    If you want the IPublishedProperty, then you'd need to write your own custom processor. Pretty much copying UmbracoPropertyAttribute.cs but changing line #236 to content.GetProperty(...).

    Hope that makes sense?

    Otherwise, you could change your Body's type to JObject (or a general object)?

    - Lee

Please Sign in or register to post replies

Write your reply to: