Copied to clipboard

Flag this post as spam?

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


  • glob 72 posts 172 karma points
    Jul 08, 2016 @ 06:38
    glob
    1

    How to get Umbraco Node url based on nodeid in umbraco tables?

    Hello,

    I am using umbraco 7+.

    Can i get umbraco node url from the nodeid in umbrao table using sql query?

    With Regards,

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 08, 2016 @ 06:52
    Dirk De Grave
    0

    Hi glob,

    you should never query db for url's, unless you have a good reason to do so!

    If you need url from node id, just use the Umbraco (UmbracoHelper) object on your views to fetch url

    var publishedContent = Umbraco.TypedContent(id);
    var url = publishedContent.Url;
    

    Cheers, Dirk

  • Arul Pushpam Murugan 16 posts 108 karma points
    Oct 05, 2020 @ 06:55
    Arul Pushpam Murugan
    0

    var publishedContent = Umbraco.TypedContent(id);

    var url = publishedContent.UrlAbsolute();

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Jul 08, 2016 @ 06:54
    Michaël Vanbrabandt
    0

    Hi glob,

    Like Dirk is saying you can use the Umbraco build in helpers to get the Url of a node.

    if you want the absolute url with domain you can use:

    var nodeUrl = Umbraco.NiceUrlWithDomain(nodeId);
    

    /Michaël

  • Arul Pushpam Murugan 16 posts 108 karma points
    Oct 05, 2020 @ 11:38
    Arul Pushpam Murugan
    1

    var domainURL=PublishedContentExtensions.UrlWithDomain(ipublishedContent);

  • 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