Working around the CEWP’s absolute links…

Wednesday, December 24, 2008 4:21 AM
Microsoft MVP Logo

[via Stefan Gossner & Maxime Bombardier]

The Content Editor Web Part, as many people have realized who’ve tried to use it in Publishing sites and then extend multiple Web apps or leverage content deployment, stores links as absolute references rather than relative ones. For instance, if you have a link to in a CEWP on a page and then do content deployment to, the link will be pointing back to the staging site (which will… or should… be inaccessible).

Sidebar: In my opinion, you shouldn’t using the CEWP in Publishing sites. In fact, for most if not all my deployments, we remove that Web Part from the Web Part gallery and add a entry in the site’s web.config to flag is as NOT a safe control. You should be using field controls instead (see my blog post detailing this here which is also on the ECM team blog and also discussed in my MSDN article Prescriptive Guidance for MOSS 2007 WCM Sites).

Maxime Bombardier has come up with an interesting workaround to fixing this for all WSS 3.0 based sites, including Publishing sites. This approach uses a custom ASP.NET Control Adapter to do some link fixup. In his post he references Waldek’s similar process.

» Maxime Bombardier: Fixing absolute URLs for all Alternate Access Mappings (AAM) of Content Editor Web Part with a Control Adapter

comments powered by Disqus