Copied to clipboard

Flag this post as spam?

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

  • k 256 posts 654 karma points
    Sep 22, 2019 @ 14:35

    Nested content


    I am using nested content on umbraco 8.

    I am using the code on :

    But I am getting the below error: enter image description here

    Can someone please help.



  • Ryan Helmn 26 posts 188 karma points
    Feb 10, 2020 @ 14:52
    Ryan Helmn

    Do you have any null checks before the variable? If not, could you try doing:

        enter code here
  • Alex Skrypnyk ( 6064 posts 23316 karma points MVP 6x admin c-trib
    Feb 12, 2020 @ 18:57
    Alex Skrypnyk (

    if you have only one item in the nested content you have to use

  • Mikael Axel Kleinwort 120 posts 449 karma points c-trib
    Feb 13, 2020 @ 10:00
    Mikael Axel Kleinwort

    Hi Alex,

    I am curious, do you know why this is so? Shouldn't it be returning a collection with a single item? Does this means I have to check in code each time, or update the code when the nested content changes?

    I am relatively new to using Nested Content and I would like to understand the issue so I can avoid problems, I would appreciate your insight on this a lot.

    Thank you! Mikael

  • Steve Megson 151 posts 998 karma points MVP c-trib
    Feb 13, 2020 @ 10:11
    Steve Megson

    It should only return an IPublishedElement if the property is configured to require exactly one item (min and max both set to 1). If the property is configured to allow multiple items then it should return an IEnumerable<IPublishedElement> containing one item.

  • Mikael Axel Kleinwort 120 posts 449 karma points c-trib
    Feb 13, 2020 @ 10:48
    Mikael Axel Kleinwort

    Hi Steve,

    thank you very much for this clarification!


Please Sign in or register to post replies

Write your reply to: