Thanks for the reply! Just wondering if I wanted to get a node that's NOT the current node.. equivalent to doing something like
new UmbracoHelper(UmbracoContext.Current).NiceUrlWithDomain(<some node id>)
I know UmbracoContext.Current is null at this stage in the pipeline. and you can't use var generalErrorPage = umbraco.library.NiceUrlWithDomain(Settings.Instance.UriNodeError);
because context is null.. any other thoughts? straight to the db?
Get Url For Node in an HttpModule where UmbracoContext.Current is null?
Hi Guys,
I'm in Context_BeginRequest and am trying to get a niceurl from a node. at this point in the stack UmbracoContext.Current is null..
I'm just wondering what the right way to access this info would be?
Tom,
There is http://our.umbraco.org/forum/developers/api-questions/3993-Accessing-current-node-in-a-HTTPModule see last post that may work or there may be better way?
Regards
Ismail
Hi Ismail,
Thanks for the reply! Just wondering if I wanted to get a node that's NOT the current node.. equivalent to doing something like
new UmbracoHelper(UmbracoContext.Current).NiceUrlWithDomain(<some node id>)
I know UmbracoContext.Current is null at this stage in the pipeline. and you can't use var generalErrorPage = umbraco.library.NiceUrlWithDomain(Settings.Instance.UriNodeError);
because context is null.. any other thoughts? straight to the db?
Tom,
You could use application context although that will get you a document i think that may or may not have url property?
Regards
Ismail
is working on a reply...