Web Parts on a Web Part Page

While there is little behavior difference between Web Parts on a wiki page and Web Parts on a Web Part page, let’s build a Web Part page to illustrate what the differences are.

Wiki pages are most often stored in the site pages library of a Microsoft SharePoint Foundation site, Web Part pages can be built in a document library, regardless of the library name.

Web Part pages are found in all but the Team Site template as the de facto page type and have a few interesting characteristics that make them different in behavior from their wiki page counterparts, such as:

  • No version control

  • No area for freeform content (graphics, images, and so on)

  • A very rigid structure that cannot be changed quickly—once a page layout is chosen, it cannot be altered by the site owner

We will pass quickly through the process of creating first a document library for the Web Part Pages, and then the Web Part Page itself. These topics have been covered previously in both Chapter 5 and Chapter 6.

To begin, click the Site Actions menu, and then select New Document Library, as shown in Figure 7-54.

Creating a New Document Library.

Figure 7-54. Creating a New Document Library.

Name your new library Catalogs, and use the Document Template. When your new library appears (see Figure 7-55), do not click the Add Document link because it will merely prompt you for a file to upload to the library.

Don’t Choose the Add Document link.

Figure 7-55. Don’t Choose the Add Document link.

On the ribbon, click Library Tools | Documents | New Document to begin the creation of a new Web Part page, as depicted in Figure 7-56.

Creating a New Document.

Figure 7-56. Creating a New Document.

Next, choose the name and layout. For this example, use the title Barware and select the Header, Footer, 2 Columns, 4 Rows template (see Figure 7-57). Click the Create button.

Enter a name in the Name text box and select a Layout Template.

Figure 7-57. Enter a name in the Name text box and select a Layout Template.

When the new page appears, select the Header Web Part zone, click the Add A Web Part section inside it, as shown in Figure 7-58.

Adding a Web Part to the new document.

Figure 7-58. Adding a Web Part to the new document.

Add the first Web Part. The Page Tools menu provides four options:

  • Text Adds a Content Editor Web Part to display rich text

  • Image Adds an Image Web Part to display an image

  • Web Part Adds a Web Part of any type

  • Existing List Adds a Web Part derived from an existing list

Because it’s not possible to add freeform text to a Web Part zone, you need to add a Content Editor Web Part to start. On the Page Tools tab, click Insert, and then click the Text button, as shown in Figure 7-59, to add this Web Part to the Left Column Web Part zone.

Insert a Content Editor Web Part into the Web Part zone.

Figure 7-59. Insert a Content Editor Web Part into the Web Part zone.

Once the Web Part has been inserted, change its title to Barware Title, and then add content to it, as illustrated in Figure 7-60.

Change the title and add some text to the new Web Part.

Figure 7-60. Change the title and add some text to the new Web Part.

In case you forgot how to change the Title, here’s a hint—look to the right of the screen at the Web Part Properties (shown in Figure 7-61).

Changing the Web Part’s Title.

Figure 7-61. Changing the Web Part’s Title.

A couple of things are different in the Layout section of this Web Part, which you can see in Figure 7-62:

  • The Zone control allows you to choose between the available Web Part zones for the location of the Web Part.

  • The Zone Index indicates the order in which the Web Part appears.

Adjusting the Web Part’s settings in the Layout dialog box.

Figure 7-62. Adjusting the Web Part’s settings in the Layout dialog box.

Tip

INSIDE OUT Working with Web Part zone indexes

You can have several Web Parts in a particular zone. If you want the one you added to appear at the top of the Web Part zone, set its Zone Index number to 0. The other Web Parts will automatically change their index number and move down the page.

Next, you will insert an existing list. More important, you will insert this list four times. From earlier in this chapter, four library views were created that refer to the Title field:

  • Pint Glasses

  • Cocktail Glasses

  • Shot Glasses

  • Wine Glasses

The Row Web Part zones (Rows 1–4) in the middle of this page layout distribute Web Parts horizontally instead of vertically. Thus, when you set the Zone Index of a Web Part to 0, it becomes the leftmost Web Part).

The same Web Part on a page can display a particular list view. You will use this to your advantage by adding a Web Part for each view:

  1. Select Row 1, and then click Insert | Existing List, as shown in Figure 7-63.

    Add an Existing List Web Part.

    Figure 7-63. Add an Existing List Web Part.

  2. Choose the Inventory List, and then add the Web Part to Row 1 (see Figure 7-64) by clicking the Add button.

    Adding the Inventory Web Part.

    Figure 7-64. Adding the Inventory Web Part.

  3. Repeat step 2 one more time.

    You should now have two Inventory Web Parts in Row 1, as illustrated in Figure 7-65.

    Two of the same Web Parts in one Web Part Row.

    Figure 7-65. Two of the same Web Parts in one Web Part Row.

  4. Choose the Inventory List, and then add the Web Part to Row 2 (not shown) by clicking the Add button.

  5. Repeat step 4 one more time.

    You should now have two Inventory Web Parts in Row 2 (not shown).

  6. Select and edit one of the Web Parts. Then, change its view, as demonstrated in Figure 7-66.

    Changing the Web Part view.

    Figure 7-66. Changing the Web Part view.

    A warning appears, notifying you that changing the view of a Web Part will break any existing Web Part connections (see Figure 7-67). Build your Web Parts and decide on a view before making Web Part connections.

    Altering Views Breaks Web Part Connections.

    Figure 7-67. Altering Views Breaks Web Part Connections.

  7. Alter the Title of the Web Part to match its view, as shown in Figure 7-68.

    One completed Inventory Web Part.

    Figure 7-68. One completed Inventory Web Part.

  8. Repeat steps 6 and 7 for all four Web Parts. The finished page (still in Edit mode) should look something like Figure 7-69.

    All four completed Inventory Web Parts.

    Figure 7-69. All four completed Inventory Web Parts.

  9. At this point, stop editing the page. On the Page tab, click the Stop Editing button, as depicted in Figure 7-70.

    Click Stop Editing to save the page and Web Part configuration.

    Figure 7-70. Click Stop Editing to save the page and Web Part configuration.

  10. Click the Browse tab to show the completed page, as shown in Figure 7-71.

The completed Barware Items page.

Figure 7-71. The completed Barware Items page.

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

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