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 600 posts 1219 karma points
    Dec 01, 2016 @ 20:14
    Laurence Gillian
    0

    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 4020 posts 15802 karma points MVP 13x admin c-trib
    Dec 01, 2016 @ 21:51
    Lee Kelleher
    0

    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)?

    Cheers,
    - Lee

Please Sign in or register to post replies

Write your reply to:

Draft