Add a table of contents to a publishing page layout

This article shows you how to insert a Table of Contents Web Part into a page layout. By adding the Web Part to a page layout, you cause the table of contents to appear on every publishing page that is created from that page layout. To learn more about page layouts, see the article Create a publishing page layout.

 Important   The Table of Contents Web Part is available only to sites located on a server running Microsoft Office SharePoint Server 2007. The server administrator must first make this Web Part available in the Web Parts Gallery of the top-level site in the site collection. Also, you must have authoring permissions for the top-level site in order to open and edit page layouts.

In this article


What is the Table of Contents Web Part?

If you have ever managed a Web site, you know how difficult it can be to keep a site map or table of contents updated. Every time that a page is added to or removed from the site, and every time that a page is renamed or moved, you have to manually update the site map. With an Office SharePoint Server 2007 publishing site, though, you don't have to remember to update the site map each time that something changes. Instead, it is updated for you automatically.

By using the publishing features of Office SharePoint Server 2007, you can create a type of page template that is called a page layout. Publishing sites make it easy for a content contributor to use a Web browser to create pages and to add content to fields on those pages that are defined in the template. Then, when the added information is published, the page becomes a fully functional Web page.

When you insert the Table of Contents Web Part into a page layout, all of the pages that are created from that page layout contain the same table of contents. And the Table of Contents Web Part always displays the current list of pages in the site because it updates itself automatically. The following illustration shows what a table of contents can look like.

Table of Contents Web Part

Top of Page Top of Page

Locate and open the page layout

The Table of Contents Web Part can be added to any Web Part Page, but by adding the Web Part to a page layout, you cause the site map to appear on every publishing page that is created from that page layout. First, identify the page layout that you want to use:

  1. In Microsoft Office SharePoint Designer 2007 , open the site that contains the page layout where you want to display the table of contents.
  2. Click the plus sign (+) next to the _catalogs folder to expand it, then click the plus sign (+) next to the masterpages folder to expand it, and then double-click the page layout into which you want to insert the Table of Contents Web Part. The page layout opens for editing.

 Note   Page layouts have an .aspx file extension. If the page layout that you are looking for does not seem to be in the list of .aspx files, right-click each file, and then click Properties on the shortcut menu. The General tab displays the title of the page layout, which might be more familiar to you than the file name because the title of the page layout is used in the browser user interface. View the titles to help you identify the page layout that you want.

Top of Page Top of Page

Insert the Table of Contents Web Part

With the page layout still open, you are ready to insert the Table of Contents Web Part.

You may be accustomed to inserting Web Parts into Web Part zones. However, in the following procedure, you do not use a Web Part zone. When a Web Part is inserted into a page layout, and then a publishing page is created from that page layout, two things can happen:

  • If the Web Part on the page layout is in a Web Part zone, the Web Part is copied into each new publishing page that is created from the page layout. Subsequent changes to the Web Part on the page layout are not carried through to the publishing pages.
  • If the Web Part on the page layout is not in a Web Part zone, subsequent changes to the Web Part on the page layout are carried through to the publishing pages. The Web Part shows the same information on every publishing page that is created from that page layout.

You are inserting the Table of Contents Web Part into the page layout because you want every publishing page created from that page layout to show the same version of the Web Part. Therefore, on the page layout, you do not insert the Web Part into a Web Part zone.

  1. With the page layout open in Office SharePoint Designer 2007, click the placeholder in which you want to add content, click the arrow that appears, and then click Create Custom Content to unlock the placeholder for editing.

Placeholder with content menu activated

  1. On the Task Panes menu, click Web Parts.
  2. In the Web Parts task pane, browse through the gallery for your Web site, such as the Fabrikam Publishing gallery, for the Table of Contents Web Part.

Web Parts task pane with Table Of Contents Web Part selected

 Tip   If you don't see the Table of Contents Web Part, make sure that you are viewing Web Parts from the correct gallery and that the filter is set correctly. Click Filter, and then click an option in the Show list to change which Web Parts in the current gallery are displayed in the list.

  1. Drag the Table of Contents Web Part onto the content placeholder.

The Web Part is inserted in the page.

  1. To preview the page layout with the Table of Contents Web Part in it, click Preview in Browser on the Common toolbar.

The page is displayed in the browser.

Table Of Contents Web Part as displayed in browser

Top of Page Top of Page

Customize the table of contents

You can change the display options for the Table of Contents Web Part to suit your needs. For example, by default the Table of Contents Web Part displays data in three columns, but you can change that setting to show more or fewer columns. You can also adjust the number of levels that are shown in your table of contents, or change the display styles and the orientation from horizontal to vertical or from vertical to horizontal. In addition, you can change the order in which items in the table of contents are sorted.

Table Of Contents Web Part dialog box

Change the number of columns displayed

  1. With the page layout open in Design view, double-click the Table of Contents Web Part.
  2. In the Table of Contents Web Part dialog box, click the plus sign (+) next to the Presentation section to expand it.
  3. In the Display Columns list, click the number of columns in which you want your table of contents displayed.
  4. Click OK.

The following illustration shows a table of contents in the browser that has two columns instead of three.

Table Of Contents Web Part showing 2 columns

Change the number of levels displayed

  1. With the page layout open in Design view, double-click the Table of Contents Web Part.
  2. In the Table of Contents Web Part dialog box, click the plus sign (+) next to the Content section to expand it.
  3. In the Levels to show list, click the number of levels that you want to be displayed in your table of contents.
  4. Click OK.

The following illustration shows a table of contents in the browser that displays two levels.

Table Of Contents Web Part showing two levels

Change the styles and horizontal and vertical orientation

  1. With the page layout open in Design view, double-click the Table of Contents Web Part.
  2. In the Table of Contents Web Part dialog box, click the plus sign (+) next to the Presentation section to expand it.
  3. Do any of the following:
    • In the Level 1 Style list, click a style for the content at the top level of the table of contents.
    • In the Level 2 Style list, click a style for the content at the level under the top level of the table of contents.
    • In the Level 3 Style list, click a style for the content at the second level under the top level of the table of contents.
  4. Click OK.

The following illustration shows a table of contents in the browser that has one level, and this level has a Horizontal style.

Table Of Contents Web Part with horizontal orientation

Change the sort order for items in your table of contents

  1. With the page layout open in Design view, double-click the Table of Contents Web Part.
  2. In the Table of Contents Web Part dialog box, click the plus sign (+) next to the Organization section to expand it.
  3. Do one of the following:
    • Click Sort contents as they are sorted in navigation to sort the contents of the site as you see them when you click Navigation on the Site menu.
    • Click Sort contents by using the following settings, and then choose options in this section to sort sites or pages by title or date, or to change the sort direction.
  4. Click OK.

The following illustration shows a table of contents in the browser that has been sorted by creation date.

Table Of Contents Web Part after sorting

Top of Page Top of Page

 
 
Applies to:
SharePoint Designer 2007