SaaS CMS has officially launched! Learn more now.

Problem getting ContentReference from url in CMS 8


Anyone else having problem with getting ContentReference from url with PermanentLinkUtility.GetContentReference in CMS 8? Worked before the upgrade. We're trying to fetch the ContentReference of content in a LinkItemCollection.

Feb 24, 2015 14:40


This might be related to the removal of "mapped/classical" links. Please see the breaking changes here,, under the 'PageData.LinkURL and classic links' section.

Feb 24, 2015 18:14


Yes, I have looked at that. But as I understand it, it's just classical links that has been removed? My link is in Permanent links format e.g ~/link/bbaadfc8-44d8-42a6-b559-b20f08714084.aspx. I have compared the link from a 7.19.2 version of our site and the link looks exactly the same and I am able to get a ContentReference out from the link using PermanentLinkUtility.GetContentReference in that version.

Feb 24, 2015 20:31

We have also encountered this problem today, a workaround is to resolve the ContentReference with the UrlResolver

var contentReference = UrlResolver.Current.Route(new UrlBuilder(permanentLink));

Edited, Feb 25, 2015 9:46

Thanks, that worked!

Feb 25, 2015 10:27

Nice catch, that method only supports classic links and should probably be obsoleted. I will report a bug so that we can have a look..

Feb 25, 2015 11:40

There are more functions related to mapped url's, e.g. PermanentLinkMapStore.TryToMapped(); are these going to be obsoleted as well, or do they still work?

Mar 05, 2015 5:55


var contentReference = UrlResolver.Current.Route(new UrlBuilder(context.RequestUrl.LocalPath)).ContentLink; 

is working

.. :)

Jun 19, 2017 12:32
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.