Copied to clipboard

Flag this post as spam?

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


  • Craig O'Mahony 364 posts 918 karma points
    Jan 31, 2018 @ 15:57
    Craig O'Mahony
    0

    Get the GUID from the NodeFactory.Node

    Hi all,

    Is there a way of getting a node GUID from the nodes ID?

    So:

    Node myNode= new Node(1234);
    

    Doesn't expose the nodes GUID. I can see everything else about the node but I can't see the GUID.

    Thanks, Craig

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jan 31, 2018 @ 16:52
    Jeavon Leopold
    3

    Hi Craig,

    "Node" is long obsolete, it was replaced by IPublishedContent. Please use the UmbracoHelper with the TypedContent method. Documentation can be found at https://our.umbraco.org/Documentation/Reference/Querying/UmbracoHelper/#typedcontent-int-id

    You can then get the Guid from the GetKey() method. e.g.

    Umbraco.TypedContent(1234).GetKey();
    

    Jeavon

Please Sign in or register to post replies

Write your reply to:

Draft