1

Our company intranet runs on SharePoint 2007. We use IE11 to browse.

I want to add HTML5/CSS3 content to the site, but unfortunately, when viewing in document modes IE8+, a lot of system functionality starts to fail when in edit mode (rich-text menu, web part edit menu). For now, it works in IE7 mode only with no CSS3 support.

I have noticed that the problems only happens when in edit mode. Therefore I want to switch the IE7 document mode on / off dependant of the page mode (edit/display)

I have found a tutorial to do this by creating a new assembly, but I do not have WSS server access, only to the master/layout/site pages.

Is this possible with js/sp controls? If so, anyone knows how?

Thanks.

EDIT

Thanks for your post, appreciate it. Unfortunately, I don't have access to the server to be able to deploy a custom web part.

However, I do have access to the master page. My goal is to be able to use the rich text editor, which won't load from the edit content menu in IE8.

I have made some progress and can switch document modes from EDGE in display mode to IE8 when in edit mode using the code below.

    <PublishingWebControls:EditModePanel  runat="server" PageDisplayMode="Display">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
</PublishingWebControls:EditModePanel>

<PublishingWebControls:EditModePanel  runat="server" PageDisplayMode="Edit">
    <meta http-equiv="X-UA-Compatible" content="IE=8"/>
</PublishingWebControls:EditModePanel>

However, if I try to switch directly to IE7, the page becomes blank.

If I switch to IE8, and change document modes to IE7 in dev tools, the page works as expected.

Therefore, I need a way to switch from IE8 to IE7 using sp controls like above.

Any ideas? Thanks!

  • Could you try with content="IE=EmulateIE7" and see if it actually changes anything? – SPArchaeologist Feb 17 '16 at 19:19
1

First I would like to give a word of warning. Some standard SharePoint 2007 functionality does not work as expected in IE8+ (the ECB menu for instance). So if you plan on using certain webbparts it will not work.

The only way to set the document mode is to use tag which has to be present on page load. So it cannot unfortunatelly be done in js. The only way I see that might be possible is to use a custom web part that adds the tag to the header since you don't have access to deploy a new masterpage on the server or add a http module. The problem is that this web part has to be added to every page this is used on.

If it is a single web then you could try modifying the masterpage for the web but safety settings usually prevent code in pages from libraries to be run on server.

The code you would have to add is something similar to

string version = (HttpContext.Current.Request.Form["MSOSPWebPartManager_DisplayModeName"] ?? string.Empty).ToLower() == "design" ? "IE7" : "Edge";
if (Page.Header != null)
{
    Page.Header.Controls.AddAt(0, new LiteralControl("<meta http-equiv=\"X-UA-Compatible\" content=\"IE=" + version + "\" />"));
}

Hopefully you can find something better to check than the form. But I could not think of anything from the top of my head.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.