tags:

views:

64

answers:

1

Put a relative URL (no server name) into the HTML Editor and save the page. The URL is converted to an absolute URL (http://server_name is added to the beginning).

This is posing a problem for moving content from our staging to production environment, as the server names are different.

The exact same scenario is common when using the Content Editor Web Part, and Microsoft has published a fix here:

http://code.msdn.microsoft.com/WssCewpLinkFixup/Release/ProjectReleases.aspx?ReleaseId=2210

The solution creates a custom ASP.NET 2.0 control adapter to change the rendering process of all Content Editor Web Parts in the application.

But we are using the HTML Editor Field Control, not the Content Editor Web Part.

Can the same approach be used to change the behavior of a web part?

Has anyone else encountered this problem and solved it? A Google search has come up with no answers, only many frustrated users and abandoned forum threads, including this one on StackOverflow from a year ago:

http://stackoverflow.com/questions/917019/sharepoint-publishing-html-field-control-converts-relative-url-to-absolute-url

Many thanks in advance.

A: 

You may be able to put a little bit of JavaScript in the link, either

<a href="javascript:location='page.aspx';">Link</a>

or

<a href="#" onclick="location='page.aspx';">Link</a>

Haven't tried it, but it may work.

Muhimbi