Copied to clipboard

Flag this post as spam?

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


  • Umbraco Newbie 22 posts 124 karma points
    Aug 30, 2017 @ 22:40
    Umbraco Newbie
    0

    Nested Content Returns NULL

    Hi

    I'm at a loss as to why this does not work, I'm using Umbraco version 7.6.5 assembly: 1.0.6428.37121 with Nested Content 0.5.0, I have read the pdf file for instruction and also many websites and I still cannot get it to work.

    My doctype for the blue print is headerImageBodyTextAndLink, I add this to the doctype ParentDocType, but when I run page and put break point on:

    @{
        var items = Model.HasValue("headerImageBodyTextAndLink") ? Model.GetPropertyValue<IEnumerable<IPublishedContent>>("headerImageBodyTextAndLink") : null;
    
    
        var test2 = items;
    } 
    

    It always returns null, Am I missing something simple.

    Any help would be appreciated on this

    George

  • xcurative 5 posts 75 karma points
    Sep 22, 2017 @ 10:01
    xcurative
    0

    Hi George,

    Did you get the solution?

    Kindly share the solutions if you found.

    Thanks

  • Matthew Wise 271 posts 1373 karma points MVP 4x c-trib
    Sep 22, 2017 @ 14:25
    Matthew Wise
    0

    Hi George,

    Have you tried viewing the raw value of the property you have set? This may lead you to the issue.

    Also, you could try getting just IPublishedContent

    Model.GetPropertyValue<IPublishedContent>
    

    Instead of the IEnumerable<> depending if you have allowed multiple in your property.

    Matt

  • Rahul Patel 8 posts 80 karma points
    Nov 09, 2018 @ 04:42
    Rahul Patel
    0

    If anyone runs into this in the future this happened to me because I added a property with the id "key".

Please Sign in or register to post replies

Write your reply to:

Draft