Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to get a node by its url or path. Before v8 you could do it by uQuery.GetNodeIdByUrl("/"); but now I can't find the equivalent method.
I'm trying to call it inside af Umbraco Web API if that makes any difference :)
There is the GetByRoute method in 'IPublishedContentCache'
So wondering if somethign like this would work in your APIController?
IPublishedContent matchingRouteContentItem = UmbracoContext.ContentCache.GetByRoute("/",false);
Thank you. That was exactly was I was looking for :)
But in my case second parameter should be true, else I can't find subpages.
This should now be
IPublishedContent matchingRouteContentItem = UmbracoContext.Content.GetByRoute("/",false);
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted