Copied to clipboard

Flag this post as spam?

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


  • Gambit 20 posts 100 karma points
    Apr 12, 2018 @ 06:44
    Gambit
    0

    "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". Link with Anchor 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: Collide link

    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(); The id is different

    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.

  • 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