Hi! I'm trying to build a content picker where I pick the top level of content and list its children version.
I'm seeming to get stuck when trying to access the children of a blender model, or any of the typically returned Umbraco properties. Is it possible to just get a node chosen with a leblender content picker and iterate through its children?
Here's what I'm trying now, which is returning 'char' does not contain a definition for 'Id'.
List children of page chosen
Hi! I'm trying to build a content picker where I pick the top level of content and list its children version.
I'm seeming to get stuck when trying to access the children of a blender model, or any of the typically returned Umbraco properties. Is it possible to just get a node chosen with a leblender content picker and iterate through its children?
Here's what I'm trying now, which is returning 'char' does not contain a definition for 'Id'.
Thank you!
Amir
A Content Picker datatype return an id, not a IPublishedContent. So, you have first to lost you IPublishedContent:
@{ var choosePage = Model.Items.First().GetValue<dynamic>("choosePage"); if (choosePage != null) { IPublishedContent content = Umbraco.TypedContent(choosePage); <ul> @foreach (var item in content.Children()) { <li>@item.Id</li> } </ul> } }Does it make sense?
Yes! Thank you Antoine.
-Amir
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.