Chapter 11. Branding and Customization

For collaborative site collections such as team sites and workspaces, we generally recommend minimal branding and customization. But sometimes your organization mandates specific branding and customization for Microsoft Office SharePoint Server 2007 sites. Conversely, when building large intranet sites and World Wide Web sites, we almost always recommend branding and customization to fit your needs. Office SharePoint Products and Technologies supports several ways for an organization to incorporate its images, logos, colors, and styles to give SharePoint Web sites a customized look and feel.

The focus of this chapter is understanding when SharePoint Server 2007 should be customized, how to customize, and the best practices to use when customizing. This chapter will explore the following methods to effectively customize the look and feel of SharePoint Products and Technologies sites:

  • Methods and controls for branding and customization

  • Native support for branding

  • Branding with SharePoint Designer 2007

  • Branding with Microsoft Visual Studio 2005

  • Hybrid approaches

In this chapter, we’ll cover branding for SharePoint Product and Technologies sites, specifically covering the advantages of the Microsoft Office SharePoint Server publishing infrastructure feature and related tools, and will enumerate a number of best practices for branding and customization.

Overview of SharePoint Branding

Two concepts should be clarified before we discuss branding SharePoint Product and Technologies Web sites: customization and personalization. Customization is the process of making changes to the overall look and feel of the SharePoint environment or adjusting the functionality of SharePoint for all users. Personalization refers to instances in which users change the Web parts displayed on a site. Personalization also takes place when administrators use audiences to modify the content displayed on a site in order to adjust functionality for individual users.

Why Customize Branding?

Every SharePoint Server 2007 site comes pre-built with a distinct look and feel that is easily recognized as SharePoint. The interface wasn’t an accident and is the result of research and feedback from usability groups. This native look and feel was achieved through the careful selection of default font selections, color choices, and the placement of elements such as navigation and Web parts. Customization becomes necessary when organizational goals and requirements dictate that a given SharePoint Products and Technologies Web site adhere to corporate standards that the default site templates do not address. Politics and culture are usually the driving factors for deviating from the native look and feel.

How do you accomplish the corporate branding standards or other driving factors for branding and customization? Essentially, you can modify the layout, color scheme, graphics, and other elements of the design of a SharePoint Server 2007 page while staying in a supported installation posture. Figure 11-1 shows the home page of a site that has been customized to change its overall look and feel.

Mindsharp home page

Figure 11-1. Mindsharp home page

Changes to the basic design of a SharePoint site will often involve significant customization of a SharePoint environment. Because these customizations are extensive, it is a best practice to thoroughly document all of the customizations made. It is possible that service packs or upgrades to the next version of SharePoint Server 2007 may overwrite customizations. Keeping detailed records of these customizations will allow you to reapply customizations after an upgrade, and will assist you when troubleshooting problems possibly caused by customizations.

Note

Keep detailed records of customizations so that they can be reapplied if altered by a service pack or upgrade and to aid in debugging any issues that arise during the customization process.

Who Controls Branding?

Before you begin to customize native SharePoint Server 2007 sites, you should take the time to determine who will control the various aspects of branding and customization. SharePoint Server 2007 installations can be designed to allow for branding and customization at several different levels in the environment, and the decisions defining where customizations will be performed should be included in your governance strategy. Each of these customization levels can lead to different business outcomes and affect the choices of tools and methods of branding. For example, allowing local site administrators to change visual aspects of their site, beyond simple personalization, can enhance a sense of ownership for local users. This heightened sense of ownership often leads users to make more extensive use of the site. However, this decentralized approach can quickly lead to an inconsistent look and feel. If a strict look and feel is required, you may be forced to centrally control the branding. The most successful implementations we have seen use a combination of centralized and decentralized branding, ensuring a consistent corporate identity while fostering a sense of teamwork across sites and site collection boundaries.

By establishing governance policies that selectively mix localized and centralized control, feelings of local ownership and collective identity are simultaneously enhanced. For example, an organization could establish several approved master pages and allow site administrators to select which specific master page they would like to use on their site. The level of centralized control versus decentralized freedom will depend on the business goals for your implementation. Remember that SharePoint Server 2007 is an end-user product and was intended for site collection administrators to control their destiny, including customizations.

What Method Should I Use?

SharePoint Server 2007 includes a variety of native tools and methodologies that can be used to implement customizations. First, simple branding can be applied using the native in-browser site management tools. Site administrators can change the theme, modify navigation, and change the default logo. Second, site administrators can more extensively modify a site using Microsoft SharePoint Designer 2007. This second level of customization brings more freedom for page customization, but also allows for more governance noncompliance. It is critical that users with SharePoint Designer 2007 be adequately trained on when to use the tool in addition to how to use the tool. Third, almost any facet of SharePoint Server 2007 can be modified using Visual Studio. Visual Studio customizations can be made by modifying code and configuration files stored on the SharePoint server’s file system or modifying files in the site. Choosing the appropriate mix of these tools and the associated governance policy is not a simple decision. Careful planning should be done prior to choosing any one customization approach.

Criteria for Selecting a Customization Method

There is no single best way to customize a SharePoint installation. Several criteria should be considered when you select a particular approach to customizing a SharePoint installation. Your choice of an efficient and effective approach will depend on several factors, such as:

  • Where in an organization branding and customization will be controlled

  • The technical expertise of the users designing the customization

  • The scope of the change

  • Adherence to corporate, governmental, or international standards

  • Technologies used to control the look and feel of non-SharePoint Web sites

  • Performance requirements for the production site

Some of the methods we will examine are best used on individual sites and pages, while others can effect broad, sweeping changes across an entire SharePoint Farm. Some approaches require advanced training, but others can be done by relatively non-technical users. Choosing an effective strategy involves considering all of these factors and selecting a combination of tools and methodologies to implement your brand. Regardless of the chosen method, there are some underlying factors that you must understand when you decide how to customize a SharePoint site.

Understanding Where Changes Are Stored

The first factor that must be considered is where the customization changes will be stored. Depending on the tools used, customization changes will be stored in one of four places:

  1. The SharePoint farm’s configuration database

  2. The Web application or site collection’s content database

  3. The Web application’s configuration (web.config) file

  4. The SharePoint server’s 12 hive directories

Note

The 12 hive is the principle file system location for SharePoint Products and Technologies resources and is located at C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12. The structure of the 12 hive is not automatically replicated on every server in the farm. The initial structure is created on each server, thus allowing each server to initially behave exactly as its siblings. Throughout this chapter, it should be understood that changes made to the 12 hive must be made consistently across all servers in the farm.

The location of the stored changes is important because it will have a long-term effect on the scope of future changes that may be made. For example, if SharePoint Designer 2007 is used to edit a master page, then the results will be stored directly in the content database used by that site collection. This process is called customization. The customization process has the negative effect of limiting the scope of any future changes to this particular site. Activating the publishing infrastructure feature can partially mitigate this limitation by allowing inheritance of changes made to a master page to all sites in a site collection. But most publishing master page modifications are made via SharePoint Designer 2007, and the publishing infrastructure feature doesn’t change how SharePoint Designer 2007 works; changes are still stored at the site level in the content database. The advantage is site inheritance, and through inheritance the scope of future changes will be expanded to the site collection. Even so, the changes made with SharePoint Designer 2007 never apply beyond the level of a site collection. However, modification made with Visual Studio and deployed to the 12 hive will affect the entire farm. For instance, a master page deployed to the 12 hive with Visual Studio can be referenced by pages throughout the farm.

Security, Audiences, and Performance

Another factor to take into customization consideration is security. Modifying security to remove elements from the page can lead to performance issues due to a decrease in caching effectiveness. SharePoint Server 2007 pages follow a pattern in which a control is placed on the page that is always visible, but what happens or what is displayed in a submenu when that control is activated varies depending on the security of the user. For example, most SharePoint Server 2007 pages contain a Site Actions menu that is displayed for anyone who has more than read-only access to the page. But when the Site Actions menu is activated, users see only the menu entries to which they have security access. This allows the main page to be cached in only two formats, one for Read Only and one for other users. Adding code to the page that removes or hides the Site Actions menu would cause excessive invalidation of the ASP.NET Page and Fragment cache. This excessive invalidation results in an increase of trips to the SharePoint databases and a resulting decrease in Web front-end server performance. This example demonstrates why it is considered a best practice to apply security to the results of an action on a page rather than applying security to objects on the page itself.

Audience targeting is another native capability that can be leveraged to customize what a user sees on a page. Audiences are not the same as security. For example, if the contents of an existing Web part are being filtered by an audience, a user can add another instance of that Web part that is not filtered. Audiences provide a way to provide content relevance and should not be used as an alternative security mechanism. A good use of audience targeting is limiting which Web parts show up on a shared page based on audience membership.

Publishing versus Nonpublishing

Activating the publishing infrastructure feature for a site can affect the choice of tools for branding. As we have already discussed, activating the publishing infrastructure feature provides for inheritance of master pages from the top-level site of a site collection to subsites. This inheritance increases the scope of changes made using SharePoint Designer 2007. Additionally, the use of the publishing infrastructure feature can affect branding decisions in other ways. For example, when a user creates a new page in a site where publishing has been activated, she is required to use a preapproved page layout for the new page. This extends a company’s ability to control the look and feel of the pages within a site beyond the constraints applied by a master page. Master pages are used to provide a consistent framework of navigation, colors, and the basic layout of a page, but publishing layout pages provide control down to the level of content placement and formatting.

More Info

For a more detailed discussion of SharePoint’s publishing features, refer to Chapter 13.

Branding Methodologies

Knowing the strengths and weaknesses of each potential method for branding a SharePoint Web site will help you select the correct method for each situation. Your chosen solution should depend on the best methodology for the job, but many times will be limited by your budget and technical expertise.

Master Pages and Content Pages

Prior to the inception of ASP.NET 2.0, Web pages usually enforced a common look and feel by using a common set of user controls or HTML includes files. ASP.NET 2.0 introduced the concept of a master page. Think of a master page as an HTML template that contains named regions where content from an HTML content page can be inserted. The regions on the master page are called content placeholders and are actually ASP.NET server controls. Content pages are composed of ASP.NET server content controls that encapsulate all of the content to be displayed on the rendered page. When a content page is requested from the server, the associated master page is retrieved, content is inserted into the content placeholder controls, and the resulting page is rendered and returned to the user. SharePoint Products and Technologies fully supports the use of ASP.NET 2.0 master pages.

Master pages make it easy to define the overall look and feel of pages in a site. A master page is created using HTML just like any other Web page, but in the case of a master page, spaces are left for content to be filled in by placing content placeholder controls at the appropriate locations. Because any HTML in the master page applies to all rendered pages that use it, the overall look and feel of a site can be changed by simply changing the master page. The master page also provides one file that can define how events are handled for things such as site navigation. This prevents errors that find their way into code through duplication. It’s always a best practice to keep common code in a single centralized location where it’s easier to manage. Figure 11-2 shows some content placeholder controls on the default.master master page being edited in SharePoint Designer.

Content placeholder controls on the default.master master page

Figure 11-2. Content placeholder controls on the default.master master page

Although master pages provide the promise of a single centralized file to define the branding of a SharePoint installation, how the master page is created, modified, or installed can detract from the efficiency of this approach. Master pages created or modified using SharePoint Designer can be customized and, once customized, will no longer reflect changes made to a centralized master page stored in the 12 hive. Each site where the master page was saved using SharePoint Designer will have its own unique copy of the master page. Activating the publishing infrastructure feature will expand the scope of a master page to an entire site collection, but there is no easy way to synchronize customized master pages across multiple site collections, Web applications, or an entire farm.

SharePoint Server 2007 also makes use of many pages that are not stored in the content database in either a customized or uncustomized fashion. For example, the page for uploading files into a document library is retrieved from the _Layouts virtual directory that is mapped directly to the TEMPLATE/LAYOUTS directory in the 12 hive. These pages all use a master page called Application.master, and it is also stored in the 12 hive. Unlike other master pages, there is no way for files in the _Layouts directory to use an alternative master page. The only way to brand the Application.master page is by directly editing the page on the file system. Because this page may be overridden automatically by an upgrade or service pack, it is never a good idea to change one of the default files in the 12 hive.

Note

Application.master is the master page used by most of the pages retrieved directly from the _Layouts virtual directory of a SharePoint Server 2007 site. Many of these pages are used for administrative purposes on a site. For example, the Site Settings page, settings.aspx, is accessed through _Layouts. The impact of Application.master on the Site Settings page is mitigated by the fact that site settings will be used only by a limited number of users with administrative privileges. Unfortunately, other pages—such as the page used to upload files to a document library, upload.aspx—are essential to almost all users and also reference Application.master. The problem is that there is no easy way to substitute an alternative master page for Application.master. There are only two possibilities for branding pages that use Application.master. First, you can use themes to change the basic graphics and color scheme. Although you can do this without editing Application.master directly, it will not affect the basic layout of the page, only the color scheme. The second way to brand pages that use Application.master is to edit the master page itself. Be aware that editing this file is not supported by Microsoft.

In addition to master pages, SharePoint Server 2007 makes extensive use of cascading style sheets (CSS). The default style sheet is CORE.css, which contains over 800 styles. In a default SharePoint Products and Technologies installation, styles are used to control things like the height, width, color, and fonts used by controls on the rendered page. But CSS can also be used to reformat the rendered page of a SharePoint site. When used in conjunction with HTML, <Div> and <Span> tags have the advantage of decoupling the contents of a page from its eventual layout. This can be used to create a site that is more compliant with accessibility standards for devices like screen readers because it replaces the use of tables, rows, and columns for formatting the rendering of a page.

Although custom CSS files can be used to change the layout of a Web page, there are several potential problems with this approach. First, this would require a complete rewrite of the master page to remove the hard-coded table, row, and cell elements that currently format the page. Second, this would provide no practical advantage because the page is already abstracted via the required master page. A third problem is that browser support for advanced CSS is often inconsistent. This may limit who can effectively view the customized site. Because of these issues, it is best that the use of custom CSS be limited to controlling the visibility and styling of elements on the Web page and not their layout.

Note

Use master pages to control the layout of HTML elements, controls, and content on SharePoint pages. Then use CSS to control the visibility and styling of those elements, controls, and content.

If CSS is used only to control styling and not layout, how will sites be made compliant with the current accessibility standards? The problem isn’t that sites that use HTML tables can’t be compliant with accessibility standards; it is simply more difficult. Although the default SharePoint Server 2007 sites fall short of meeting accessibility standards, Microsoft began working on a toolkit shortly after the release of Windows SharePoint Services 3.0 to extend for this functionality. The toolkit is called The Accessibility Kit for SharePoint (AKS) and is available as a free download. Using the templates, master pages, and controls included in the kit, accessible sites can be created without implementing custom CSS files to control the layout of SharePoint Web pages.

Note

Microsoft has contracted with HiSoftware to create a set of resources for making SharePoint more compliant with the accessibility standards. The freely downloadable kit provides templates, master pages, server controls, Web parts, and documentation that will help designers and developers to improve SharePoint Server 2007 and Windows SharePoint Services 3.0–based Web sites and applications for access by people with disabilities, especially those who are vision impaired. AKS can be downloaded from http://aks.hisoftware.com.

Themes

Themes and CSS are often used interchangeably, but they are actually different. Themes are related to CSS because they are a collection of alternate CSS, image, and skin files that can be applied to a site. The CSS and image files replace existing files that are used by the site. Skin files define the visual properties of ASP.NET controls by overriding the default property settings. This means that themes can be used to quickly apply alternative graphics and color schemes by site administrators. For example, three corporate branded themes could be approved so that site administrators can select which one they want to use for a specific site. Themes could also be used to provide alternate sets of culturally specific graphics for use in a multilingual installation that makes use of SharePoint Variations.

The limitations inherent in the use of themes involve the way that they are applied to a site. When a user selects a theme, the directory in the 12 hive that contains the corresponding theme files is copied to a subdirectory of the site and stored in the content database. Subsequent changes to the original theme in the 12 hive are not picked up by the site. This means that any changes to a theme will need to be manually applied to each site that currently uses that theme.

Another limitation inherent in the use of themes is that they do not include a master page. Because themes contain CSS and do not contain master pages, they can be used to control graphics and color schemes but not the basic layout of the page. As noted previously, it is a best practice to control the layout of pages in a site by using master pages.

Due to their limitations, themes are not a perfect way to maintain centralized branding. But they work well in a limited fashion and are useful when the objective is to empower site owners to select approved brandings. Themes can also be used to provide approved images available for use as part of a branding effort. You should remember that changes to themes after deployment will be very laborious. Therefore, planning and quality assurance are crucial to preempting unnecessary changes to themes after they are deployed.

Themes can also be used to address one of the problems with pages that use Application.master. If a theme is applied to a site, that theme will affect the graphics and color scheme of pages retrieved from the _Layouts directory, just like every other page in the site. The theme will not affect the layout of the pages referencing Application.master, but it does provide a look-and-feel branding solution that does not involve editing the master page.

Features, Solutions, and the Object Model

For several of the methods discussed so far, improper deployment strategies may make it difficult to maintain the customizations. These maintenance issues are usually the result of using SharePoint Designer 2007 to create a custom brand that is stored as customized files in the content database. Because these files are specific to an individual site (or site collection if publishing is enabled), using them in a broader context is problematic. A way to mitigate this problem is by creating a file in a parallel development environment, exporting it to the file system, and then deploying it to the production environment using a solution. For example, a custom master page can be created in a development environment using SharePoint Designer 2007. That customized master page can then be exported to the file system and deployed in a production environment using a solution.

Custom features can also be used to support deployment scenarios. The URL address of several key components for branding, like master pages and alternate CSS files, are stored as properties of the SPWeb object that represents a SharePoint Products and Technologies site. Custom features can be created to set these properties to point to custom master pages or CSS files that have been deployed via a solution. It is also possible to deploy and activate features as part of the solution, which automates the entire process. This combination of features and solutions is used to overcome some of the limitations of updating themes. Modifications made to themes in the 12 hive can be packaged as a solution, with the same solution containing a feature that would deploy the theme to sites. This feature could copy the theme from the 12 hive to the site’s content database. Doing so allows for centrally controlled updates to existing themes.

More Info

For a more detailed discussion of features and solutions, refer to Chapter 12.

Web Parts

Web parts aren’t normally used to brand SharePoint Products and Technologies sites, but they can be an asset when leveraged intelligently. One of the issues of centrally controlled branding is a perceived lack of local control by the end-users. Allowing users to personalize the content of a specific site using Web parts may alleviate some of the problems associated with this "control" perception. Although users won’t have the freedom to change the color scheme of a site or how to navigate between sites, controlling the content that is on the site itself may provide users with the independence that empowers them.

Now that you have seen some of the strengths and weaknesses of the various tools and methods available for creating a custom brand, we need to look at the different ways that they can be used. We’ll examine the following four approaches:

  • Using native in-browser SharePoint Products and Technologies interface

  • Using SharePoint Designer 2007 to directly edit master pages and layout pages

  • Using Visual Studio 2005 to edit and deploy files in the 12 hive

  • Using a combination of SharePoint Designer to edit pages and Visual Studio 2005 to deploy the edited pages to the 12 hive

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.111.125