Section 3.4. Custom Web Part Pages


3.4. Custom Web Part Pages

Although you can combine individual Web Parts into a site, you may want to group individual Web Parts into a complex Web Part page. By implementing a Web Part page, you can display lists, charts, text, and images as a single Web Part component. Organizing related data and web pages eliminates the time and steps required for users to constantly access multiple web pages and data sources. For example, you can build a custom Web Part page that displays a customer's contact information, orders, and invoices. All three pieces of information will be grouped as a single Web Part control.

Web Part pages can be used to:

  • Combine data from multiple data sources

  • Report data (e.g., aggregate data or prioritized data)

  • Access any external sites that users require in daily tasks

  • Display updated schedules and meeting information

3.4.1. Web Part Galleries

Any Web Parts that are available for you to add to your SharePoint Services team site are stored in Web Part galleries. Depending on how your site is configured, Web Parts can be stored in any of four galleries:


Site Web Part gallery

Any site-level Web Part made available by the server administrator is stored in the Site Web Part gallery.


Web Part Page gallery

Any Web Part that is available to a page, but not visible on a Web Part page is stored in the Web Part Page gallery. When a Web Part is closed (not deleted), they are still available to a user.


Online Web Part gallery

Microsoft created several Web Parts (for example, MSNBC stock tickers, weather, and news Web Parts) that are stored in the online Web Part gallery. Eventually, the Online Web Part gallery will include Web Parts created by other software vendors.


Virtual Server Web Part gallery

If your company has several sites, it makes sense to store any commonly used Web Parts in one centralized location. The Virtual Server Web Part gallery stores any Web Parts that can be used across multiple sites.

3.4.2. Creating a Custom Web Part Page

The easiest way to create a custom Web Part page is through the New Web Part Page form. After creating a page with the New Web Part page form, you can easily design the page in a web browser.

To create a new custom Web Part page:

  1. Click Create in the top menu bar located at the top of the page.

  2. Under Web Pages, click Web Part Page to open the New Web Part Page dialog.

Figure 3-8 shows the New Web Part Page screen that you can use to create new Web Part pages and choose the template that your Web Part page uses:

  1. In the dialog, type a name for your Web Part page in the Name text field. Once again, your custom page will always have an .aspx extension.

  2. If you want the new page to overwrite existing files with the same name, select the "Overwrite if file exists?" checkbox.

  3. Select the layout you want for your Web Part page from the Layout Template list box. The template determines the graphical layout of your Web Part (for example, whether the Web Part has a header or footer, and the number of columns displayed to the user). Figure 3-9 displays the "Header, Left Column, Body" template.

  4. Select a location to save your new Web Part page from the Document Library drop-down list. You have to save all custom Web Part pages in a valid document library.

  5. Click Create.

Figure 3-8. Create a custom Web Part Page


After you click the Create button, your newly created Web Part page opens in the design view. Figure 3-9 shows a Web Part page in design view. Depending on the layout you chose, you will have several Web Part zones in which you can drag and drop existing Web Parts from the Web Part list. The Web Part page has three Web Part zones (a header, a left column, and a body zone).

Figure 3-9. Web Part page design view


For example, you could drag and drop an image Web Part into the header zone to add a company's logo to your page. You could then add custom lists to the left column and

3.4.3. Modifying Your Web Parts Page in an HTML Editor

Most Web Part page properties can be accessed and modified directly through a web browser. In some cases you may want to make advanced modifications to your Web Parts page. Web Parts pages are stored as ASP.NET (.aspx) files. Therefore, you can modify Web Parts pages with an HTML editor such as Microsoft FrontPage. Figure 3-10 shows a Web Part page opened in FrontPage. Using FrontPage to edit your SharePoint Services team site gives you more control over the information you choose to display, as well as how you display it. For example, you can:

  • Modify the theme of a Web Part page

  • Modify the Web Part template

  • Modify zone properties

  • Add or edit HTML code

  • Create customized data views from XML or database sources

Figure 3-10. Opening a Web Part in FrontPage


You can also add web controls (for example, counters, navigation controls, and applets) that cannot be added through the basic SharePoint Services web interface. To add a control to your page:

  1. Open the page in Microsoft FrontPage 2003 by selecting File Open and navigating to your page.

  2. Insert a web component on your page by selecting Insert Web Component.

  3. Save your page.

Once you have edited a page outside of WSS, any changes should automatically appear when you refresh your view of the site.

3.4.3.1 Creating customized data views

Implementing the data view Web Part allows you create customized data views by connecting to any data source that generates XML (for example, SQL Server, XML files, XML web services, and standard SharePoint Services lists).

Once you connect to a data source, you can drag and drop the data source onto a SharePoint Services page and customize the data view to display selected information in customized formats (for example, adding borders, filtering data, and sorting).

3.4.4. Create Your Own Web Parts Programmatically

In some cases, the functionality offered by existing Web Parts may not match the functionality you need for your site. If you use a design environment compatible with SharePoint Services such as Microsoft Visual Studio .NET, you can access all the features available to ASP.NET to create custom Web Parts that match your desired functionality. Programmatically you can:

  • Define new views

  • Create forms

  • Retrieve database information and display information on an .aspx page

  • Add additional content types to your SharePoint Services team site (for example, Macromedia Flash movies)

  • Add Active Server Pages (ASP.NET pages) to the site

The steps involved in creating a custom Web Part are beyond the scope of this book.



    SharePoint User's Guide
    SharePoint 2007 Users Guide: Learning Microsofts Collaboration and Productivity Platform
    ISBN: 1590598296
    EAN: 2147483647
    Year: 2005
    Pages: 62

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net