The updates worked… mostly!

The updates to the web environment that we performed over the holiday break, including updating the MCMS database to use SQL Server 2005 and applying MCMS Service Pack 2 with a ton of fixes went forward successfully. There were a couple bumps in the road after applying the changes, but for the most part the upgrade went well. One of the most glaring changes caused a rendering issue with many pages on the CMS, namely those in which the content flows around another framework element, like a picture. The two most prominent of these pages were the Language Schools and Schools Abroad home pages.

Language Schools Home Page with Broken Wrapping

As you can see, the content doesn’t properly flow around the “post it” in the upper right corner of the content area. I was able to track down this issue to the editing interface we use for the CMS, Telerik’s r.a.d. Editor, which in .NET 2.0 aparently inserts a style=”display:inline-block” attribute on the element where it renders the content from the editing control. This messed with our CSS, forcing the wrapping to break. I fixed this by manually adding a style element inline in the template that we use for these pages, like so:

<telerik:RadEditorPlaceholderControl style=”display:inline” id=”mainContent” Placeholdertobind=”mainContent” toolsfile=”~/RadControls/Editor/ToolsFile.xml” configfile=”~/RadControls/Editor/ConfigFile.xml” runat=”server” />

Problem solved! Or so I thought. I figured this would be the only place on the CMS where this particular issue would occur since I couldn’t recall where else we were wrapping content around elements like this. Unfortunately, I forgot about the News template, which wraps its content around a picture with a caption. My colleague, Brett, helped me track this down by looking through the Telerik support forums and finding that the display:inline-block style is hard coded into the control and can’t be easily removed from the editor. We could override the whole control and implement our own styles, or we could force a global append of the correct style. We chose the latter as it meant writing one line of code, rather than several and changing every instance of the editor throughout the application.

  protected override void OnPreRender(EventArgs e)
  { 
    foreach (RadEditorPlaceHolderControl editor in FindRadEditor(Page))
    {
     editor.Style.Add(“display”, “inline”);
    }

   base.OnPreRender (e);
  }

 Now it’s fixed everywhere and the CMS seems to be running well in the new environment.

Leave a Reply

Your email address will not be published. Required fields are marked *