November Happy Hour will be moved to Thursday December 5th.

External links in XML-export file

Vote:
 

The link format in a normal page export is in permanent link format:  i.e. ~/link/f9ef91b787af4ec393c2d63aef3161fc.aspx

But is it possible to make sure that external links are outputted when doing Page Export? 

#58987
May 15, 2012 12:16
Vote:
 

Hi,


You can do something like this:

public static string RewriteUrlsToFriendly(this string input, PageData page)
{
    UrlBuilder internalUrl = new UrlBuilder(page.LinkURL);
    UrlBuilder externalUrl = new UrlBuilder(page.LinkURL);

    HtmlRewriteToExternal rewriter = EPiServer.Global.UrlRewriteProvider.GetHtmlRewriter();

    EPiServer.Global.UrlRewriteProvider.ConvertToExternal(externalUrl, page.PageLink, UTF8Encoding.UTF8);

    return rewriter.RewriteString(internalUrl, externalUrl, UTF8Encoding.UTF8, input);
}

    

#58989
Edited, May 15, 2012 13:29
* 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.