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.
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.
Nested content
Hello,
I am using nested content on umbraco 8.
I am using the code on : https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/Nested-Content/
But I am getting the below error:
Can someone please help.
Thanks,
Kusum
Do you have any null checks before the variable? If not, could you try doing:
if you have only one item in the nested content you have to use
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
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 anIEnumerable<IPublishedElement>
containing one item.Hi Steve,
thank you very much for this clarification!
Mikael
is working on a reply...