Online Test Banks
Score higher
See Online Test Banks
eLearning
Learning anything is easy
Browse Online Courses
Mobile Apps
Learning on the go
Explore Mobile Apps
Dummies Store
Shop for books and more
Start Shopping

How to Work with Content Placeholders in SharePoint 2010

SharePoint Designer makes it easy to override placeholders from the master page. To put your content into a placeholder instead of using the master page’s content:

1

Open a page layout in Edit mode and check it out by clicking Yes when prompted to check out the file.

Do this in a non-production site. If you have to use a production site, be sure to discard your changes without publishing a major version.

2

Place the page in Design mode by clicking the Design button in the lower-left corner of the screen.

You see a WYSIWYG (what you see is what you get) display of the page layout. Most of what you see actually comes from the master page.

3

Hover your mouse over different areas of the page.

As you do, notice that names of placeholders appear. Those with Master in them display content from the master page. Those with Custom are in your page layout.

4

Find the PlaceHolderMain content placeholder and click it.

The PlaceHolderMain content placeholder is used to contain the body of the page, so it’s usually the largest placeholder on the page.

One way to make sure you’ve selected the proper element is to use the Visual Aids tags at the bottom of the screen.

5

In the Visual Aids toolbar, click the <asp:Content> tag and choose Select Tag.

The entire tag is highlighted.

6

Click the Split button on the View tab of the Ribbon to display half the page in Code view and the other half in Design view.

The PlaceHolderMain content placeholder and its contents are highlighted. As you select different elements in Design view, notice that the code is highlighted in the Code view. This is a great way to browse through a layout and see how it works.

7

Select the PlaceHolderPageDescription content placeholder in Design view and click the arrow on the far right of the placeholder.

A smart tag appears. Any place you see these arrows, click them and then you see common tasks that are associated with that placeholder or control.

8

In the Common Content Tasks tag, click Create Custom Content.

The placeholder appears in Code view.

9

In Code view or Design view, type Hello world in the PlaceHolderPageDescription content placeholder.

Preview your changes in the browser by clicking the Preview in Browser button on the Home tab of the Ribbon.

As you may have surmised, the PlaceHolderContentMain placeholder is the one you use most often. The other placeholders are used for more specialized content, such as navigation bars and editing consoles. Another useful placeholder is PlaceHolderAdditionalPageHead.

If you know anything about the markup used to create web pages, you know that all web pages have a head section where you place the title and references to style sheets and JavaScript files. Anything you put in the PlaceHolderAdditionalPageHead placeholder is merged into the master page’s head section.

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.