Copied to clipboard

Flag this post as spam?

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


  • Vyacheslav 5 posts 75 karma points
    Mar 22, 2021 @ 09:10
    Vyacheslav
    0

    How to get a property by key (GUID) from IUmbracoContextFactory

    Each item in a nested content contains Key property. Is it possible to find item of nested content by this key?
    Method GetById returns null.

    umbracoContext.UmbracoContext.Content.GetById(new Guid(key)); 
    
  • Huw Reddick 335 posts 1007 karma points
    Mar 22, 2021 @ 14:44
    Huw Reddick
    0

    GetById should accept a guid, does key definitely have a value?

  • Mehmet Avcı 32 posts 124 karma points
    Mar 25, 2021 @ 11:28
    Mehmet Avcı
    0

    Hi,

    The method you are calling is used to fetch Content Nodes. However, you are trying to access a nested content, in another words, you access a property of a node.

    You first need to access the content then you can get the property you are looking for. Normally, property alias is used, if you cannot, you can manually search for it in the properties of the node.

    I hope this helps.

  • 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.

Please Sign in or register to post replies