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
Hey guys, hopefully someone can point me in the right direction here, but im having trouble getting the value of a nested, nested content.
To get the first level (simplified):
var firstLevel = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("nestedPropName")
Then to get the second level (Assuming this nested, nested dataType has content for simplicity):
foreach(var item in firstLevel){ var nestedNestedContent = item.GetPropertyValue<IEnumerable<IPublishedContent>>("nestedNestedPropName") // returns null }
That comes out null But then doing this on the same dataset (Which I know isnt empty) does the right thing and returns true
foreach(var item in firstLevel){ var hasNestedContent = item.HasValue("nestedNestedPropName") // true }
...........Huh?! Very strange.
Has anyone managed to successfully get a nested content item, from within a nested content item.
Version : 7.13.2
Cheers all.
Can you show the content tab of that specific Nested Content please?
Hey Dave,
That does seem odd. It seems very similar to code I've seen before when accessing nested nested content and that's worked for me.
What happens if you do this:
var innerNestedContent = item.GetPropertyValue("nestedNestedPropName"); <div>innerNestedContent</div>
The aim of the code being to let the runtime tell your what type innerNestedContent is.
Thanks
Nik
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Nested, Nested Content - Possible Bug? Or am I doing something wrong?
Hey guys, hopefully someone can point me in the right direction here, but im having trouble getting the value of a nested, nested content.
To get the first level (simplified):
Then to get the second level (Assuming this nested, nested dataType has content for simplicity):
That comes out null But then doing this on the same dataset (Which I know isnt empty) does the right thing and returns true
...........Huh?! Very strange.
Has anyone managed to successfully get a nested content item, from within a nested content item.
Version : 7.13.2
Cheers all.
Can you show the content tab of that specific Nested Content please?
Hey Dave,
That does seem odd. It seems very similar to code I've seen before when accessing nested nested content and that's worked for me.
What happens if you do this:
The aim of the code being to let the runtime tell your what type innerNestedContent is.
Thanks
Nik
is working on a reply...