I've got a nested content (products) data type which has a standard content picker (productPicker) which I want to fetch the URL I'm having some issues with fetching the content picker content - it throws a Null even tho I have content. Any ideas what I've done wrong? It's the second foreach that's throwing the error.
Thanks.
Darren
@{
var items = Model.Value<IEnumerable<IPublishedElement>>("products");
foreach (var item in items)
{
foreach (var item2 in item.Value<IEnumerable<IPublishedContent>>("productPicker"))
{
@item2.Url
}
<p>@item.GetProperty("productPicker").Value()</p>
<p>@item.GetProperty("quantity").Value()</p>
<p>@item.GetProperty("cost").Value()</p>
}
Nested content - fetch Content Picker
Hi Folks,
I've got a nested content (products) data type which has a standard content picker (productPicker) which I want to fetch the URL I'm having some issues with fetching the content picker content - it throws a Null even tho I have content. Any ideas what I've done wrong? It's the second foreach that's throwing the error.
Thanks. Darren
}
Is "productPicker" just a regular ContentPicker? or a MultiNode Picker?
If its just a single node picker, then the return type will be simply IPublishedContent
is working on a reply...