November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
An update to the matter - i got it fixed.
The Reflector told me that PageReferences have been changed to ContentReferences and by changing the following statements:
protected override bool ConvertToExternalInternal(EPiServer.UrlBuilder url, object internalObject, System.Text.Encoding toEncoding)
{
// We call the base implementation and if it returns true
// then we do our magic.
if (base.ConvertToExternalInternal(url, internalObject, toEncoding))
{
// The following handling rules are copied
// from the base method.
//PageReference pageLink = internalObject as PageReference;
ContentReference pageLink = internalObject as ContentReference;
if (pageLink == null)
{
//pageLink = PermanentLinkUtility.GetPageReference(url);
pageLink = PermanentLinkUtility.GetContentReference(url);
}
if (PageReference.IsNullOrEmpty(pageLink))
{
this.TryConvertPermanentLink(url, out pageLink);
if (pageLink == null)
{
return true;
}
}
// Do something if you get the PageReference - Reference is needed to determine pagetypes
And the ContentReference needs to be converted to PageReference:
PageData page = DataFactory.Instance.GetPage(pageLink.ToPageReference());
Hope this helps someone ;)
Good that you found a solution yourself.
But generally, using the events ConvertingToExternal, ConvertedToExternal, ConvertingToInternal and ConvertedToInternal and/or UrlRewriteModules is better since it mostly gives you less headache when doing maintenance and upgrading.
Hi!
I'm having some issues with upgrading the current EPi6R2 project functions to EPiServer 7 functions.
One of the issues include a custom FriendlyUrlRewriteProvider. The overwritten method looks like this:
The main issue seems to be that the PermanentLinkUtility or any other way I've used to parse the Url/PageId to a PageReference doesn't seem to pull through. Any ideas on how to resolve the PageType of the current page in some otherway?
Cheers,