Try our conversational search powered by Generative AI!

Shortcut to relative URL with partial route trailing segment automatically converts to permanent link without ~

Vote:
 

I'm upgrading a solution where a block has had a LinkItemCollection property.

It has items has a PageReference set and also a RemaningPath to a target a specific with a partial router trailing segment. This works.

It also has page references where page is set as external shortcut but to a relative URL. This is to be able to have pages in navigation that includes a trailing segment.

When saving such a page with the full relative URL including partial route this gets changed to a value that looks like this, can't see that we have some own code for this and it was the same in CMS11:
/link/<guid>.aspx?epsremainingpath=nice-name/1245/

When putting that shortcut page in the LinkItemCollection we get ~/link/<guid>.aspx that goes to Url.ContentUrl() but that one returns:
/link/<guid>.aspx?epsremainingpath=nice-name/1245/ .. so I need prepend a ~ and send it through Url.ContentUrl() one more time to get the correct rewritten URL.

Maybe a bit of an edge case but at least there seems to be some internal workings going on to convert a relative shortcut URL with trailing segment to a permanent link style value so maybe worth a ticket with support to get the ~ in the right place or add an extra check inside the URL resolver?

#291781
Nov 16, 2022 16:59
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.