Showing posts with label Master page. Show all posts
Showing posts with label Master page. Show all posts

Wednesday, April 24, 2013

SharePoint2013 migration resetting master page references

If I am not wrong, it does, isn’t it?

Actually, it is not new. It did so when migrating to 2010 also. It changed master page reference of all sites to v4.master. I wrote a code to reset them back to our custom master. Needless to say that, before doing that, the custom master needed to be adapted. I needed the code to do this, because, even with sites where you see the master page reference is inherited from its parent, the effective master page became to v4.master.

I did not think it a big flaw at that time, but now think it is. What if for a legitimate reason, an organization employs several masters for their public facing web site, say for instance, employing different brandings for different products, champagnes etc.? Once upgraded, you do not know any more which site was on which master.

If SharePoint does not allow such an arrangement i.e. employing different master page for different sites, then OK. We would not complain. But it does allow, even encourages you, and says NO you cannot, all the sudden, when a new version comes out.

I did some googling, to find out that not so many seem concerned. Is this the sign that it has never gained enough popularity in the public facing web sites market? Where obviously branding is one of the most important aspects.

Monday, November 5, 2012

Horizontal scroll bar does not appear

This is about an issue that we had with our public facing web site master page. That the horizontal scroll bar does not show, when it should, that is, when the page width is bigger than that of the browser window displaying it. Interestingly, it comes when you scroll down to the bottom of the page.

I did not know that SharePoint 2010 implements the scroll bars with some JavaScript so they enclose the s4-workspace div, not the body element, including the “ribbon”. And we had the above issue because I did the master page in such a way that it does not have the ribbon when the pages are viewed by the visitors.

I am sure that it is a requirement for everybody who do their public facing sites on SharePoint 2010. We need to get rid of the ribbon when the pages are consumed, while we do need it when we prepare them.

At the very early stage (with SP2007), I achieved it by denying any write on the internet zone. The Sites Action menu was not presented, if I remember well. Then soon enough, I needed to come up a different mechanism, because the site does need to be writable in certain cases such as a feedback form. I wrote a control, and with which I enclose the ribbon so that the ribbon is not rendered on the internet zone. This “not rendered” was the cause of the issue.

It appears that when SharePoint JavaScript displays the horizontal scroll bar at the bottom of the window, it positions it vertically from the ribbon. Therefore, when it does not find the ribbon, the starting point, it displays it only at the very bottom of the page, where s4-workspace div ends.

I have overcome it by hiding the ribbon i.e. style="display:none;" rather than being not rendered.

Hope it helps.

References:
- Starter Master Page: http://archive.msdn.microsoft.com/odcSP14StarterMaster
- A useful JavaScript trick: http://blog.pixelmill.com/944/sharepoint-2010-%E2%80%93-adding-a-fixed-footer-to-your-sharepoint-master-page/