Copied to clipboard

Flag this post as spam?

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


  • Bill 43 posts 65 karma points
    Oct 17, 2014 @ 14:17
    Bill
    0

    Convert Url into NodeId

    Hi all,

    I have a puzzling problem that I am hoping someone has come across before. 

    A client requirement is the need to convert a list of urls into their Umbraco Node Ids. There is more to the requirement, but this is the crux of the problem.

    Initally I thought I would create a dedicated Examine index and use the GatheringNodeData event to inject the url property of a node into a field of the index, but the event isn't fired from a valid UmbracoContext so the NiceUrl property is always null...

    I can easily turn a NodeId into a NiceUrl, just not the other way round.

    Many thanks!

    Bill

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Oct 17, 2014 @ 14:22
    Dave Woestenborghs
    0

    Hi Bill,

    You can use the uQuery.GetNodeIdByUrl(string url) method for this.

    Dave

  • Bill 43 posts 65 karma points
    Oct 17, 2014 @ 14:26
    Bill
    0

    Dave, you are my actual hero.

    May your death be postponed a million years.

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Oct 17, 2014 @ 14:27
    Dave Woestenborghs
    0

    Haha... I hope I can still use Umbraco when I am that age :-)

  • 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