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.
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
Hi Bill,
You can use the uQuery.GetNodeIdByUrl(string url) method for this.
Dave
Dave, you are my actual hero.
May your death be postponed a million years.
Haha... I hope I can still use Umbraco when I am that age :-)
is working on a reply...