Microsoft SharePoint Products and Technologies Administrators Pocket Consultant

Web Parts provide a portable and customizable means of adding functionality to pages. They can be shared among site collections and farms, allowing them to be reused and adapted easily. Each Web Part is designed to provide a specific function, and they can be combined, connected, and customized to meet a wide variety of needs. You can customize Web Parts as part of branding your site or to give the site a new look and feel. You can design completely new Web Parts via custom code development to meet virtually any requirement. Connecting Web Parts allows you to integrate data from multiple data sources or to display the same data in multiple forms. In addition to being able to customize and connect Web Parts, you can personalize them. Within the constraints of the Web Part code, users can further modify Web Parts to meet their individual preferences. Different users can have personalized views of the same Web Part, on the same page. Web Parts can also be targeted to specific audiences. This allows different audiences to see different combinations of the same Web Parts on the same page. This means that Web Parts exist in four distinct varieties:

As an administrator, you can control who is permitted to alter Shared Web Parts, personalize Web Parts, and add Private Web Parts.

Editing Web Parts

To begin customizing Web Parts, go to the page that the Web Part resides on and select Site Actions > Edit Page. Click Edit on the Web Part you wish to edit and then select Modify Shared Web Part. Although each Web Part has properties specific to its function, several properties are common to most Web Parts. The Appearance, Layout, and Advanced property groups should remain fairly consistent among differing Web Parts and are summarized below. Figure 5-8 shows the menu item, Modify Shared Web Part.

Figure 5-8: To edit a Web Part, select Modify Shared Web Part from the edit menu.

Note 

Developers can elect not to implement some of these properties. Any given Web Part will almost certainly have properties unique to it.

Appearance

Important 

Remember that the entire Web Part zone will be resized to accommodate both the widest and highest Web Parts within the zone.

Layout

Note 

Each Web Part in a Web Part zone must have a unique zone index. Therefore, changing the zone index value of one Web Part may affect the values of some or all of the Web Parts in the zone.

Advanced

Connecting Web Parts

Web Parts provide a means of connecting to data sources and integrating information from different data sources without programming. They can be connected to lists, libraries, and to each other to reveal and manipulate data. Connecting Web Parts allows you to present the same data in different forms. For example, a common use of connected Web Parts is to provide a general view in a list, as well as a detailed view of one item in the list. To save space, a general list of users might contain only their names and e-mail addresses, whereas a more detailed view could display all of a single user's information.

To create a Web Part connection, click on the Edit drop-down list and select Connections. There you will see the list of connections that a particular Web Part can make.

Not all Web Parts are capable of making connections, and not all Web Parts support the same types of connections. For instance, the image Web Part is able to make only a single type of connection, Get Image From.

Now consider a Web Part page that contains an image Web Part and a list called Eighth Wonder. The list Eighth Wonder displays two columns: Title and URL. The URL column contains hyperlinks to images. Connecting the Web Parts is as simple as clicking on the Edit drop-down list of the image Web Part and selecting Connections > Get Image From > Eighth Wonder, as shown in Figure 5-9.

Figure 5-9: Select Connections to get the image from the Eighth Wonder list.

Once you choose a list, you can then select a column in the list from a pop-up dialog, box as shown in Figure 5-10.

Figure 5-10: After selecting a list, you can then select from the column choices.

Specifying URL and clicking Finish complete the process of connecting the image Web Part. Selecting one of the rows in the Eighth Wonder list will display the corresponding image in the image Web Part.

Caution 

You are able to create connections between Web Parts that do not generate an error, but are meaningless. If the Title column of the Eighth Wonder list had been linked to the image Web Part, the image Web Part would have attempted to interpret the Title value as an URL. This would not have caused an error message, but no image would have been displayed. Always check Web Part connections to ensure that they function as expected.

Tip 

The list and image Web Parts could also have been connected from the list. To do so, go to the list's Edit > Connections > Provide Row To > Image Web Part and select the URL column.

Категории