Modify the default SharePoint content placeholders

Content placeholder controls, which are indicated in Code view by <asp:ContentPlaceHolder>, are regions of replaceable content on a master page. You can modify the content placeholders on a master page to apply the changes to all of the content pages that are attached to that master page. Alternatively, you can override any of the default content placeholders on a single content page by inserting custom content. The custom content then appears in place of the default content for that single page when viewed in the browser.

This article introduces content placeholders and shows you how to use the Master Page toolbar to locate them. This article also lists and describes all of the default content placeholders that appear on Default.master in a Windows SharePoint Services 3.0 site, and it provides guidance on how to modify the content provided by content placeholders.

In this article


Where do the default content placeholders get their content?

By default, most of the content on Default.master, the default master page for a Windows SharePoint Services 3.0 site, is not coded on the page. Much of the content comes from ASP.NET SharePoint Web controls, the content of which is retrieved from the server. When the content page is requested in the browser, this content is retrieved from the server and displayed on the page. For example, the text "Team Site" that appears in the leftmost region of the default home page (default.aspx) is supplied by an ASP.NET SharePoint Web control that retrieves the content from the server. The text "Team Site" does not appear inside HTML tags in Code view. You can replace this text with custom content by using Microsoft Office SharePoint Designer 2007, as described in the later section Modify the content in a content placeholder.

Team Site appears inside a content placeholder

Top of Page Top of Page

Locate a content placeholder

Content placeholders appear only on master pages. To view the content placeholders in a Windows SharePoint Services 3.0 site, the Empty Containers and Visible Borders visual aids must be turned on. On the View menu, point to Visual Aids, and then click Empty Containers and Visible Borders. Make sure that Show is selected on the submenu.

The Empty Containers and Visible Borders buttons are highlighted in orange when they are turned on, as shown here.

Visual Aids shown highlighted on the menu when they are turned on

You can easily locate content placeholders in Design view by using the Master Page toolbar.

  1. To open the Master Page toolbar, on the View menu, point to Toolbars, and then click Master Page.
  2. To select a content placeholder control, click the arrow, and then click the content placeholder control that you want to locate.

In the following illustration, PlaceHolderTitleBreadcrumb is selected on the Master Page toolbar.

Master Page toolbar

When selected in Design view, the content placeholder looks like that shown in the following illustration. The tab shows the placeholder ID.

Content placeholder tab as it appears in Design view

A content placeholder tab as it appears in Design view

When you select a content placeholder by using the Master Page toolbar, the content placeholder is also selected on the Quick Tag Selector.

 Tip   If the Quick Tag Selector is not visible, on the View menu, click Quick Tag Selector.

Content placeholder as it appears on the Quick Tag Selector

A content placeholder as it appears on the Quick Tag Selector

You can use the Master Page toolbar in Design view or Code view.

Top of Page Top of Page

The default content placeholders on Default.master in a Windows SharePoint Services 3.0 site

By default, Windows SharePoint Services 3.0 content pages use the content placeholders listed in the following table. This table identifies the content placeholders and explains what each of the placeholders represents on the page.

Most of the default content placeholders on Default.master are required for the collaboration features of Windows SharePoint Services 3.0 (such as SharePoint lists and libraries) and therefore should not be deleted.

For a visual preview of the default content placeholders listed here, use the Master Page toolbar as described in the previous section.

Content placeholder Description
PlaceHolderBodyAreaClass Additional body styles in the page header
PlaceHolderBodyLeftBorder Border element for the main page body
PlaceHolderBodyRightMargin Right margin of the main page body
PlaceHolderCalendarNavigator Shows a date-picker for navigating in a calendar when a calendar is visible on the page
PlaceHolderFormDigest The "form digest" security control
PlaceHolderGlobalNavigation The global navigation breadcrumb
PlaceHolderHorizontalNav Top navigation menu for the page
PlaceHolderLeftActions Bottom of the left navigation area
PlaceHolderLeftNavBar Left navigation area
PlaceHolderLeftNavBarBorder Border element on the left navigation bar
PlaceHolderLeftNavBarDataSource Data source for the left navigation menu
PlaceHolderLeftNavBarTop Top of the left navigation area
PlaceHolderMain Main content of the page
PlaceHolderMiniConsole A place to show page-level commands, for example, WIKI commands such as Edit Page, History, and Incoming Links
PlaceHolderNavSpacer The width of the left navigation area
PlaceHolderPageDescription Description of the page contents
PlaceHolderPageImage Page icon in the upper-left area of the page
PlaceHolderSearchArea Search box area
PlaceHolderSiteName Site name
PlaceHolderTitleAreaClass Additional styles in the page header
PlaceHolderTitleAreaSeparator Shows shadows for the title area
PlaceHolderTitleBreadcrumb Main content breadcrumb area
PlaceHolderPageTitleInTitleArea Page title shown immediately below the breadcrumbs
PlaceHolderTitleLeftBorder Left border of the title area
PlaceHolderTitleRightMargin Right margin of the title area
PlaceHolderTopNavBar Top navigation area
PlaceHolderUtilityContent Extra content at the bottom of the page
SPNavigation Empty by default in Windows SharePoint Services 3.0. Can be used for additional page editing controls.
WSSDesignConsole The page editing controls when the page is in Edit Page mode (in the browser, click Site Actions, and then click Edit Page)

Top of Page Top of Page

Modify the content in a content placeholder

If you want your changes to a content placeholder to apply to the entire site, modify the content placeholder on the master page. You can also modify the content on an individual content page, thereby overriding the default content that is supplied to that content page by the master page.

 Note   You can make changes to all of the content on a master page, not just to the content inside content placeholders. Any changes made to a master page are applied to all of the content pages that are attached to that master page.

Apply content placeholder changes to the entire site

When you make changes to a master page, your changes are applied to all of the pages that are attached to that master page. In the following example, you change the site name text on the master page by selecting the PlaceHolderSiteName content placeholder, and then replacing the default content with custom content. When you save the page, the changes will appear on all pages that are attached to that master page.

  1. To open Default.master, in the Folder List, double-click _catalogs, double-click masterpage, and the double-click default.master.
  2. To open the Master Page toolbar, on the View menu, point to Toolbars, and then click Master Page.
  3. Use the Master Page toolbar to locate the content placeholder that you want to modify.

To follow the example, on the Master Page toolbar, click the arrow, and then click PlaceHolderSiteName in the list.

  1. Click the Team Site text to select the project property.

Project property inside the PlaceHolderSiteName content placeholder selected in Design view

The project property inside the PlaceHolderSiteName content placeholder selected in Design view
  1. Type a new name for your site, and then save your changes by clicking Save on the File menu.

A message appears warning you that saving your changes will customize a page from the site definition. Click Yes.

 Note   If you are not satisfied with the changes that you have made to the master page, you can always reset it to the site definition. For more information, see the article Reset a customized page to the site definition.

The changes are applied to all pages that are attached to that master page.

 Note   The changes won’t be applied to the content page if the content page already overrides the master page content.

Apply content placeholder changes to a single content page only

When you make changes to an individual content page, the changes apply only to that page. When you add custom content to a content placeholder on a content page, you override the default content supplied by the master page for that content placeholder by creating a content control for that page. In the following example, you change the site name text on the default home page by selecting the PlaceHolderSiteName content placeholder and then replacing the content with custom text. When you save the page, the changes will only appear on Default.aspx.

  1. In the Folder List, double-click default.aspx.
  2. Click the Team Site text, and then click the arrow that appears on the upper-right corner of the content placeholder.

Team Site appears inside PlaceHolderSiteName placeholder in Design view

Note the word (Master) on the tab. This means that the content region is displaying content from the master. This region cannot be edited.

  1. Click Create Custom Content.

Common Content Tasks list

Note the word (Custom) on the tab. This means that the custom content in this region overrides the content in the master. This region can now be edited.

  1. Click the Team Site text to select the project property.

Project property inside the PlaceHolderSiteName content placeholder selected in Design view

The project property inside the PlaceHolderSiteName content placeholder selected in Design view
  1. Type a new site name for your home page, and then save your changes by clicking Save on the File menu.

A message appears warning you that saving your changes will customize a page from the site definition. Click Yes.

 Note   If you are not satisfied with the changes that you have made to the master page, you can always reset it to the site definition. For more information, see the article Reset a customized page to the site definition.

The changes are applied only to Default.aspx.

To revert to the default content from the master page, click the Team Site text, click the arrow that appears in the upper-right corner of the control, and then click Default to Master’s Content.

A message appears warning you that if you default to the master page content, everything in this region will be removed from the page. If you want to revert to the master page content, thereby losing any custom content in this region, click Yes.

Save your changes by clicking Save on the File menu.

Top of Page Top of Page

 
 
Applies to:
SharePoint Designer 2007