Copied to clipboard

Flag this post as spam?

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


  • Nuno Inácio 9 posts 59 karma points
    Jul 09, 2020 @ 10:42
    Nuno Inácio
    0

    Nested Content and ContentServices

    Hi everyone,

    I'm currently struggling with this: I need to get from the database a nested content item. What I'm doing so far is:

    Guid ncItemKey = ncItem.GetKey();

    IContent content = Services.ContentService.GetById(ncItemKey);

    But the "content" is always returning null...

    My question is: Who can i achieve this in the right way?

    Thanks,

  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    Jul 09, 2020 @ 11:00
    Søren Kottal
    0

    Hi Nuno

    Are you trying to get specific nested content items from a content node?

    Nested content items is not persisted as content, so you need to get the containing node, and find the content for the property using the nested content editor.

  • Nuno Inácio 9 posts 59 karma points
    Jul 09, 2020 @ 11:08
    Nuno Inácio
    0

    Hi Søren,

    Well in this case I've a Content Node with a NestedContent property and what I'm trying to read from the database directly is the items (Nested Content Item) of this property.

    Let me show you: enter image description here

  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    Jul 09, 2020 @ 11:17
    Søren Kottal
    100

    Ok, then you need to get the Portfolio Section node through the contentservice, and get the value of the Portfolio Content property.

    IIRC the value of a Nested Content property is a Dictionary

Please Sign in or register to post replies

Write your reply to:

Draft