C H A P T E R  8

Advanced Site Customizations

Now that you have explored creating content for your sites and tailoring their appearance, you will look at some more advanced topics for creating a rich, easy-to-use web site. Specifically, in this chapter, you will focus on customizing the search and site navigation features available in SharePoint.

You will learn about the following topics in this chapter:

  • How ASP.NET is used to provide a structure for SharePoint’s navigation system
  • What components to use to create an intuitive site navigation structure
  • How to customize the out-of-the-box controls and web parts to improve the search and navigation experience of your site
  • How to present search criteria and results in a way that aids users in finding the content that is most relevant to them

Navigation in SharePoint Sites

Creating a useful and efficient Navigation system is a major contributor to the usability of a site. Navigation links and menus help the user understand the structure and layout of the site and their current location within that structure. SharePoint 2010 provides a set of navigation controls that can be customized to provide a wide range of navigation experiences.

The default site templates provided by SharePoint contain a set of navigation controls that fall into one of three broad categories depending on their purpose and where they appear on the web page (see Figure 8-1).

At the top of most pages is the area known as the global menu. This is usually a menu with various tabs referring to sites within the site collection. The global menu is designed to provide the user with feedback concerning their position within the site collection as a whole.

To the left of most standard page layouts is the local (or current) menu area. The controls that appear in this area lead the user to resources within the current SharePoint site. These controls are depicted vertically and may contain links to lists and libraries within the site, subsites, or other resources in a tree view.

The third navigation area, and the one that varies the most from site to site, is the content area in the center of the web page. The controls in this area generally provide access to resources in, or related to, the local site and can be configured in different ways depending on the type of control used.

images

Figure 8-1. Navigation areas for a typical site layout

In this section, you will look at the types of controls that are available and how you can use them to customize the menus in your SharePoint sites.

ASP.NET Navigation

The basic technology used in SharePoint 2010 for rendering menus is inherited from the .NET Framework’s ASP.NET menu system. These are the same concepts and controls used to create menus and tree views within any ASP.NET site. Let’s do a quick review of these concepts.

Any site navigation control renders links, buttons, or icons that navigate the user’s browser to a certain URL. The information associated with each of these links is called a menu node. The ASP.NET navigation objects are designed to create a flexible system for gathering and delivering a set of menu nodes to the page. The components used to do this build on one another to create a rendered HTML menu.

Site map providers are components that access some source of menu node information. These nodes could come from a database, an XML file, a file directory structure, or an application-specific data repository, such as a SharePoint content database. The site map provider is responsible for determining which menu nodes to provide and what information (URL, label, and so on) goes with each node. The site’s site map providers are generally configured in a web site’s configuration files.

The menu nodes from the site map provider are passed to a site map. The site map consolidates nodes from one or more site map providers for the site and manages this information as an in-memory database of navigation information.

A site map data source is an ASP.NET control that allows other controls to bind to the in-memory hierarchy of menu nodes. A data source control can be configured to control which nodes are bound from which providers by using a given set of criteria.

Finally, the navigation controls bind to the data source controls to retrieve the list of menu nodes to be rendered to the user. Each control renders the information differently depending on its intended purpose.

SharePoint Navigation

When creating SharePoint navigation solutions, the location of the navigation controls is critical in determining how navigation is controlled and customized. By default, the global and local menus are defined in the site’s master page. This ensures that all pages in the site use a consistent set of core navigation controls. In some cases, it may be appropriate to suppress some of these controls, but when they appear, they should be made consistent.

Navigation controls that appear in the content area vary quite a bit depending on the design of the individual page or page layout. In publishing sites, it is common to place lists of summary links and tables of contents on certain page layouts. This creates a common template for these pages while allowing some flexibility to the page author. For maximum flexibility, many of these controls are implemented as web parts so that they can be added to any page that has an open web part zone. If greater control is needed, these web parts may be restricted by using permissions assigned to them in the Web Part Gallery.

One of the most important navigation features in SharePoint is concerned not with showing menu nodes, but with hiding them. This is called security trimming. Security trimming in SharePoint navigation causes menu nodes for resources that the user cannot access to vanish from their menus. For example, if a user visits a site containing a document library that the user does not have access to, that user will not see a link to that library in the menu. This is important for two reasons. First, it avoids help desk calls from angry users who keep seeing Access Denied every time they try to get a look at the good stuff. Second, it avoids advertising the existence of sensitive content to (perhaps anonymous) users who should not see it.

Navigation Controls

In this section, you will take a brief look at the main navigation controls used by SharePoint. A more complete description of these controls can be found on MSDN at http://msdn.microsoft.com/en-us/library/ms476607.aspx.

Common Controls

The default global and local menus are rendered by using the AspMenu control. This control is derived from the ASP.NET Menu class. It can be used vertically or horizontally, as shown in Figure 8-2. It can display multiple levels of static menu links or dynamic fly-out menus. This control is designed to be dramatically customized by using Cascading Style Sheets (CSS).

images

Figure 8-2. AspMenu in vertical and horizontal modes

The SPTreeView control, shown in Figure 8-3, is a specialized version of the ASP.NET TreeView control. It displays a tree of nodes that represent the content in the site. Using metadata on the content items in the site, this control can also be used to navigate and filter items on custom metadata.

images

Figure 8-3. SPTreeView control

Breadcrumbs are useful when a site has a large number of pages and a deep directory structure. This control renders the levels of the web site as a series of links. In SharePoint, breadcrumbs are rendered by using the ListSiteMapPath control. This is derived from the ASP.NET SiteMapPath control. The breadcrumb control can also render the views or pages available in the current location as a drop-down list, as shown in Figure 8-4.

images

Figure 8-4. ListSiteMapPath control

The menu, tree view, and breadcrumb controls are present in most SharePoint sites by default, but several additional web parts are provided that can be added as well. These fall into two categories, publishing and nonpublishing, depending on the type of site they are intended for use in. You will review these in a moment. While these web parts are intended for use in a certain type of site, they can still be used in other kinds of sites.

Another important set of navigation controls are those that are created by a developer for custom rendering needs. These controls are simply ASP.NET web controls, as are the controls provided by SharePoint. Because these controls require coding in Visual Studio, not SharePoint Designer, we do not cover them here.

Nonpublishing Sites

In nonpublishing sites, the global (top) menu is called the top link bar. The local (left-side) menu is referred to as the Quick Launch menu. These are both AspMenu controls provided by the v4.master master page.

In Site Settings, these menus can be configured by using the Quick Launch and Top Link Bar links in the Look and Feel submenu, as shown in Figure 8-5. The Tree View link can be used to show or hide the Quick Launch menu and the tree view control that can optionally appear beneath it. By default, the Quick Launch menu is shown and the tree view is hidden.

images

Figure 8-5. Nonpublishing navigation settings

Table 8-1 lists the web parts that are most commonly used in nonpublishing sites.

images

Publishing Sites

In publishing sites, the global and local menus are also AspMenu controls provided by the site’s master page. In Site Settings, these menus can be configured by using the Navigation link in the Look and Feel submenu, as shown in Figure 8-6. The Tree View link can be used to show or hide the Quick Launch menu and the tree view control that can optionally appear beneath it. Note that the Quick Launch and tree view controls are not exposed on some publishing page layouts and will not appear even if enabled.

images

Figure 8-6. Publishing navigation settings

Table 8-2 lists the web parts that are most commonly used in publishing sites.

images

Customizing Site Navigation

In the following exercises, you will walk through performing some common customizations to the navigation of two sites. One will be a publishing site, and the other will be a standard nonpublishing team site. On the nonpublishing site, you will explore the tree view and metadata navigation. On the publishing site, you will customize the navigation for the site by using both Site Settings and a custom master page.

You may notice that you will not be using SharePoint Designer much in these examples. This is because SharePoint 2010 includes more navigation configuration options in the web user interface.

EXERCISE 8-1. CUSTOMIZE THE MENUS ON A TEAM SITE

The tree view now contains a hierarchy for both folders, which was enabled by default because this is a document library, and content types. If a list or library is altered to contain other metadata fields, these could be used in navigation as well. By using the Managed Metadata service within SharePoint, you can define hierarchies of terms that can be used as metadata fields. These fields allow the tree view to display a custom hierarchy of objects filtered by their metadata values.

The key filters you selected are made available in the Key Filters pane at the bottom of the tree view. This feature allows users to further refine the filter to find just what they are looking for.

EXERCISE 8-2. CUSTOMIZE THE MENUS ON A PUBLISHING SITE

SharePoint 2010 Search

Searching for content is a key feature in many web sites. SharePoint 2010 has several different solutions for searching content. Which solution is available depends on which version of SharePoint you are using. Configuring the search service in SharePoint is well beyond the scope of this book, but it is helpful to understand the options available.

Microsoft SharePoint Foundation (SPF) 2010 contains a simple search functionality that indexes and searches the content of the local SharePoint sites. Because SPF is a free add-on to Windows, the search service included is very limited. Most important, it can index only content stored within SharePoint’s content databases and can perform searches only within the local site collection. The SPF search engine is designed to support small- to medium-scale farms containing fewer than 10 million documents per search server.

SharePoint Server 2010 contains an enterprise-grade search solution designed for scalability and extensibility called SharePoint Enterprise Search. This search engine can index content from various external sources, federate results from other search crawlers, and support most very large enterprises by scaling up to about 100 million documents. There are three different product SKUs that use this search engine.

In addition to SharePoint Server 2010, Microsoft Search Server 2010 Express is a free product that supports SharePoint Server’s search functionality only on a very small scale. Search Server Express is limited to a single application and database server. It can even run using the free version of SQL Server, called SQL Server Express; however, this limits its scalability even further.

The third product using the enterprise search engine is Microsoft Search Server 2010. This product contains the full search features of SharePoint Server 2010 without supporting the rest of the functionality of SharePoint. A people search capability is not included with Search Server because it depends on other services within SharePoint Server that are not available.

The last type of search available in the SharePoint family of products is called FAST Search Server 2010 for SharePoint. This is a new set of features in the SharePoint 2010 release. FAST search is based on technology that Microsoft acquired in 2008 when it purchased FAST Search and Transfer ASA of Norway. The FAST technology is designed for high-performance and massive scale, to half a billion documents or more.

images Note For more information on the SharePoint search options available, see these online resources:

SharePoint Search Getting Started Guide: www.microsoft.com/downloads/en/details.aspx?FamilyID=96663b95-e9f5-48c8-beb9-a15ad119c499&displaylang=en

Search Feature Comparison Diagram: www.microsoft.com/downloads/en/confirmation.aspx?displaylang=en&FamilyID=d7c0091e-5766-496d-a5fe-94bea52c4b15

This section focuses on the Enterprise Search features of SharePoint Server 2010 because that is the version most commonly used by enterprises. Many of the concepts presented will transfer to SPF and FAST search technologies as well. As noted before, the configuration of any of these technologies is beyond the scope of this book. Contact your SharePoint administrator to discuss configuring the search services in your environment.

All content that is indexed by SharePoint is categorized into scopes. A scope is a subset of all of the content available that is applicable to a certain set of users or sites. When conducting a search in SharePoint, a scope is always used to limit the results of the search. The two most commonly used scopes are All Sites and the local context. All Sites applies the query to the entire index of the server farm. The local context may be a site, list, or library, depending on where the search is run from. In most cases, when the user doesn’t explicitly select a scope, the current context scope is used.

SharePoint Server 2010 also exposes a People scope that refers to all the users of the farm. Running a search against the People scope will return a list of relevant users instead of documents. Queries for people can return results based on a person’s name, department, job title, expertise, and so forth.

Once a search is complete, SharePoint supports the refinement feature. Essentially, refinement refers to searching with the results of a previous search. For example, if the user has performed a search that returned thousands of documents, refinement can be used to drill into those results by attributes such as the author or age of the document.

Search results are automatically security trimmed, where feasible. This means that if a user doesn’t have the necessary permissions to open a document, that document will not appear in that user’s search results. There are limitations to security trimming. When content is indexed against external sources that do not provide detailed permission information, or when search results are received from federated search services, security trimming may not be possible. A federated search service is one that exists outside the local SharePoint farm but has been configured to provide search results within SharePoint.

The search functionality of SharePoint 2010 also includes new features as compared to the 2007 version. One often-requested feature that has finally appeared in SharePoint search is the ability to use wildcard characters in search terms. Unfortunately, SharePoint supports wildcards only at the end of a word, not at the beginning or in the middle. For example, using custom* as a search term would match custom, customer, and customized. However, using *stomer would, most likely, not match anything because the asterisk (*) would not be seen as a wildcard in this case. SharePoint also supports a new query syntax in search terms that allow AND, OR, and NOT conditions to be used. For example, sharepoint NOT foundation would match items that contain sharepoint, excluding those that also contain foundation.

Search Web Parts

The search experience in SharePoint is created SharePoint 2010 by using a set of web parts specifically designed for handling search functions. These web parts are usually provisioned by creating a site based on one of the Search Center site templates provided by SharePoint. These templates are described in the next section. In this section, you will learn about the web parts available.

images

Figure 8-14. Basic Search Center web parts

The most common use of search is to find pages and documents that have been indexed by SharePoint. Table 8-3 lists the web parts used to enter a search query and display search results.

images

As described earlier, federated searches are those that are performed by external search providers. The search query is passed to the remote search provider, and a set of results are returned and displayed. Table 8-4 describes the web parts used with federated searches.

images

A people search is used to find other SharePoint users based on their name, title, expertise, or other attributes. Table 8-5 lists the web parts used to perform people searches.

images

The remaining search web parts display information about a set of search results or control the display of search results. Table 8-6 lists these web parts.

images

images

Search Site Templates

SharePoint Server 2010 comes with three site Partstemplates that are designed to provide a complete search user interface. Each one contains a set of search pages and search results pages that are prepopulated with a group of configured search web parts. These sites can be easily deployed and then customized as needed.

The Basic Search Center template is a simple search site that consist of a simple search page (default.aspx) containing nothing but a Search Box web part. There is also an advanced search page (advanced.aspx) that uses an Advanced Search Box instead. Search results from either of these pages are displayed on the Search Results page (results.aspx). The Basic Search Center is designed for use in site collections that do not use publishing or other enterprise features.

The Enterprise Search Center template is similar to the basic site except that the pages in this site contain a tabbed control that allows for multiple search and result pages to be deployed into one search solution. It contains the same three pages as the basic site plus search and results pages for people searches. The site contains two tabs by default: All Sites and People. Additional search and result pages can be added as needed. See Exercise 8-4 later in this chapter for an example of adding tabs to this site template.

The third search site template is called the FAST Search Center. As its name indicates, it is designed to work with the FAST Search Server 2010 for SharePoint search engine. Once FAST search is configured, this search center is similar to the Enterprise Search Center except that it contains enhancements for displaying results from the FAST search service.

Customizing the Search Experience

In the following exercises, you will explore the user interface components that are available for customizing the SharePoint search experience. You will use both the Basic and Enterprise Search Center templates. As you did when looking at site navigation, you will do one example in a nonpublishing site and the other in a publishing site.

In order to follow these exercises, you will need to meet the following conditions:

  • You will need to have at least site owner privileges in the sites you will be working with.
  • You will need to have the right to create new subsites.
  • Your SharePoint farm administrator will need to have configured the search service in your environment.

EXERCISE 8-3. DEPLOY AND CUSTOMIZE A BASIC SEARCH CENTER

EXERCISE 8-4. DEPLOY AND CUSTOMIZE AN ENTERPRISE SEARCH CENTER

Summary

In this chapter, you have

  • Examined the .NET technologies used to implement SharePoint’s navigation system
  • Described the visual components used to create an intuitive site navigation structure
  • Customized the out-of-the-box pages, controls, and web parts to implement customized site navigation and search
  • Customized the search web parts to improve the search relevancy and flexibility
images

Figure 8-22. Advanced site customization road map

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

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