Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Darren Wilson 218 posts 556 karma points
    Mar 20, 2019 @ 23:55
    Darren Wilson

    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

    var items = Model.Value<IEnumerable<IPublishedElement>>("products");
    foreach (var item in items)
            foreach (var item2 in item.Value<IEnumerable<IPublishedContent>>("productPicker"))


  • Paul Wright (suedeapple) 260 posts 662 karma points
    Mar 21, 2019 @ 13:11
    Paul Wright (suedeapple)

    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

Please Sign in or register to post replies

Write your reply to: