Posts

Showing posts with the label master page

Working around X-Frame-Options for iframes

Image
The problem: One of the first things we noticed after migrating to SharePoint 2013 was that our iframes have stopped working, giving the error: "Refused to display 'http://contoso/pages/home.aspx' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'." Quickly we could see that this is in fact a security mechanism to prevent click-jacking and others: "The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a frame or iframe. Sites can use this to avoid Clickjacking attacks, by ensuring that their content is not embedded into other sites." Soon we realized that, starting SharePoint 2013, an HTTP Module is adding the header " X-Frame-Options " by default, with the value " SAMEORIGIN ". This is effectively preventing the rendering of pages outside the scope of the current web application. The (attempted) solution: So what to do?...

SharePoint 2010 | Caveats when upgrading master page to IE9 (with solutions)

Image
Problem: One of the biggest issues with branding is our "friend", Internet Explorer. When we talk about SharePoint, specially SharePoint 2010, we are typically bound to one version of Internet Explorer, where everything works great, but as soon as we move to another version, all hell breaks loose. In practice, this happens when we change this line, < meta http-equiv="X-UA-Compatible" content="IE=8" /> to something like < meta http-equiv="X-UA-Compatible" content="IE=9" /> Why would you do this? Well, among other things, you get access to CSS3. Otherwise, even if you have IE9+ installed, you will not get CSS3 because the browser will be rendering in IE8 mode. Many other limitations of IE8 will apply as well. Should you do this? Ideally, no. This raises issues as soon as this is enabled and I'm sure not all issues have been found. However, in a small and/or public facing application, where only a few area...

SharePoint | Master Pages By Site Template

Master pages vary by site template. As much as we'd like to create a master page that is suitable for all kinds of sites, search and meeting sites require specific layout changes that the default master page does not support. So here's a breakdown of SharePoint 2010 default master pages. Team Site / Blog / Wiki / etc. Meeting Site (ID: 2) Search Site (ID: 90, 50) My Site SharePoint Designer: Custom Master Page SPWeb Object: Web.CustomMasterURL Site Actions: Site Master Page (first option) Note: Applied to front end v4.master MWSDefaultv4.master minimal.master V4.master SharePoint Designer: Default Master Page SPWeb Object: Web.MasterURL Site Actions: System Master Page (second option) Note: Applied to admin area V4.master MWSDefaultv4.master V4.master V4.master Search changes - Move immediately before PlaceHolderMain <asp:ContentPlaceHold...