Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
Do you have any null checks before the variable? If not, could you try doing:
enter code here
if you have only one item in the nested content you have to use
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 an IEnumerable<IPublishedElement> containing one item.
thank you very much for this clarification!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted