We have a custom implementation of "DefaultUrlProvider" where I override the "GetUrl" method which added "anchor" for specific nodes:
"parentUrl + # + node name".
We work with it on UI and we were happy.
However, from the version 7.7.X it stopped working. (Right click -> "Browse" is still working though)
Now Umbraco cut the anchors and treat the link as incorrect:
Debugging shows that it happens in "UrlProviderExtensions" class.
The following line cut the anchor and resolve the PublishContent for the Url without the anchor. Which is of course - different node.
uri = UriUtility.UriToUmbraco(uri);
var pcr = new PublishedContentRequest(uri, UmbracoContext.Current.RoutingContext, UmbracoConfig.For.UmbracoSettings().WebRouting, s => Roles.Provider.GetRolesForUser(s));
pcr.Engine.TryRouteRequest();
As I didn't find anything of the sort on the forum I believe not many people used this kind of logic (if any). However, business really wants this logic back.
So the question is - does it even possible? Maybe we can override something for PublishedContentRequest or add additional provider?
"Link to document" with anchor in backoffice
Hello,
We have a custom implementation of "DefaultUrlProvider" where I override the "GetUrl" method which added "anchor" for specific nodes: "parentUrl + # + node name". We work with it on UI and we were happy.
However, from the version 7.7.X it stopped working. (Right click -> "Browse" is still working though) Now Umbraco cut the anchors and treat the link as incorrect:
Debugging shows that it happens in "UrlProviderExtensions" class. The following line cut the anchor and resolve the PublishContent for the Url without the anchor. Which is of course - different node.
uri = UriUtility.UriToUmbraco(uri); var pcr = new PublishedContentRequest(uri, UmbracoContext.Current.RoutingContext, UmbracoConfig.For.UmbracoSettings().WebRouting, s => Roles.Provider.GetRolesForUser(s)); pcr.Engine.TryRouteRequest();
As I didn't find anything of the sort on the forum I believe not many people used this kind of logic (if any). However, business really wants this logic back.
So the question is - does it even possible? Maybe we can override something for PublishedContentRequest or add additional provider?
Please advise.
is working on a reply...