Designing UX -
     SharePoint 2010 Page Layouts Model

Ramona Maxwell’s study notes, ©2011 All rights reserved

Master pages are and ASP.NET feature used in SP2010. Every page in an SP2010 installation must follow the Master Page layout, all sites use v4.master as their primary master page, but you can also design site specific master pages. Master pages prevent an SP2010 installation from losing it's theme, for instance if pages are contributed by various developers or third-parties controls and layout will still be consistent throughout the site. Updates to the Master Page cascade throughout the site, think about the time savings when a company renames or has ownership changes. SharePoint maintains a Master Page Gallery for every site in the collection, however you can only create new pages with the Masters in the top level site collection's gallery. The v4.master page now includes the server ribbon by default, and some controls that used to be specified separately in the master page will no longer be available unless you update your v4.master page to relocate the Publishing Console, Site Actions Menu, Sign In and Log Control from the existing Master Page and replace them with a reference to the ribbon. An additional change to the product from the previous version is that both content and application pages now use the same Master Page.

What if you manage to break your Master Page? There are certain pages that will still render using the simple4v.master, a master page that you define as the emergency backup. These include Login, SignOut, Error, ReqAcc, Confirmation, WebDeleted and AccessDenied.

Marching in behind the Master Page is the Page Layout page which is specific to that site page and contains all the metadata for it. Page layouts host the field controls which are bound to fields on the 'master page list item.' These can be default field controls or custom controls you design. While only the pages based on a Page Layout page follow its pattern, all pages have access to the Master Page. Page Layouts live in the Master Page Gallery where security protects them from users who aren't designers and they have the benefits of versioning, a check-out system and can use workflow features.

Distinguishing the various page types in SP2010 has to do with their purpose. Regular site pages do not contain code, just content. Site pages are based on a load-once template, eliminating the overhead of retrieving page infrastructure with every access request. While you can customize these pages you cannot add any inline server code. Server-side code that is allowed to run on a site page is predefined in a web.config file. While a developer could create a site definition for site pages with server-side code it's not recommend practice because if a user edits the page it will no longer run. Web Part pages can run the code from your store of Web Parts, i.e. code modules. Both of these first two can be edited in SharePoint Designer or the browser. Application Pages, which live in the _layout directory, cannot be created in Designer but can run inline code without restriction. You cannot modify the default Application Pages in SharePoint Foundation, but you can add customized ones. Application Pages cannot use Web Parts and Web Part Zones.

The ASP.NET page processing model means the .NET server can compile the Master Page once, and then reuse it time and again to render your page without the overhead of reloading it. You can further speed it up by asking it not to re-render the controls each time the page loads and to cache those also. Thus if the page is requested again by the same user, or a user with permissions identical to the first requester, the page loads very quickly in views subsequent to the first one.

SP2010 Master and Layout pages use CSS to control layout and an MSDN search for "Cascading Style Sheets Class Usage in SharePoint Foundation" will lead you to a list of the default classes for things like controlling the ribbon, titles, menus and the rest of a basic page framework.

Return to