Web Part Basics

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Because Microsoft Office Project Server 2007 installs Web Part Pages based on the Windows SharePoint Services 3.0 object model, you can extend Project Web Access with simple Web Parts.

Creating a Basic Web Part

The following example shows a server running Windows SharePoint Services that is provisioned with a Project Server workspace. You can use any server running Windows Windows SharePoint Services 3.0 to which you have access.

To create a basic Web Part:

  1. In your browser, enter the URL of your Project Web Access Home page, for example:

    http://ServerName/ProjectServer/default.aspx

  2. Click Site Actions, and then click Edit Page.

  3. In the zone where you want to add a Web Part, click Add a web part. In the Add Web Parts dialog box, click Advanced Web Part gallery and options.

  4. In the Add Web Parts pane, click the Project Web Access Gallery. Click the Content Editor Web Part and then drag it into the Web Part zone you want. Figure 1 shows the Content Editor Web Part being dragged into the Header zone.

    Figure 1. Adding a Content Editor Web Part

    Adding a Content Editor Web Part

  5. Click open the tool pane in the Content Editor Web Part, or click the down arrow at the top right of the Web Part, and then on the Web Part menu, click Modify Shared Web Part.

  6. In the Content Editor Web Part properties pane, click either Source Editor or Rich Text Editor. Type one or two sentences in the Rich Text Editor, or in the Source Editor type the HTML code for the two sentences. For example:

    <P>Climb mountains to see lowlands.</P><P>&nbsp; --Chinese Proverb</P>

  7. Click Apply. Figure 2 shows the modified Web Part.

    Figure 2. Modified Content Editor Web Part

    Modified Content Editor Web Part

  8. Click the down arrow at the top right of the Web Part, and then click Export in the Web Part menu. Click Save, and in the Save As dialog box, type a file name such as WebPartBasics.dwp. Select a directory in which to save your Web Part instance description.

  9. Click Exit Design Mode in the top right corner of the page.

Following is the resulting WebPartBasics.dwp file, which you can open in any text editor. You can modify text elements of this file, such as the Title or Description elements, and import the modified WebPartBasics.dwp file to another Web Part Page in any Windows SharePoint Services or Microsoft Office SharePoint Server 2007 site.

<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Title>Content Editor Web Part</Title>
  <FrameType>Default</FrameType>
  <Description>Use for formatted text, tables, and images.</Description>
  <IsIncluded>true</IsIncluded>
  <ZoneID>Header</ZoneID>
  <PartOrder>1</PartOrder>
  <FrameState>Normal</FrameState>
  <Height />
  <Width />
  <AllowRemove>true</AllowRemove>
  <AllowZoneChange>true</AllowZoneChange>
  <AllowMinimize>true</AllowMinimize>
  <AllowConnect>true</AllowConnect>
  <AllowEdit>true</AllowEdit>
  <AllowHide>true</AllowHide>
  <IsVisible>true</IsVisible>
  <Hidden>false</Hidden>
  <DetailLink />
  <HelpLink />
  <HelpMode>Modeless</HelpMode>
  <Dir>Default</Dir>
  <PartImageSmall />
  <MissingAssembly />
  <PartImageLarge>/_layouts/images/mscontl.gif</PartImageLarge>
  <IsIncludedFilter />
  <AuthorizationFilter />
  <Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
  <TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>
  <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
  <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"><![CDATA[
    <P>Climb mountains to see lowlands.</P>
    <P>&nbsp; --Chinese Proverb</P>
    ]]></Content>
  <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
</WebPart>

Note

Place the entire Assembly element on one line, and make it identical to the Assembly line in the Content Editor Web Part on your Windows SharePoint Services computer. The [Program Files]\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\BasicWebParts path contains the MSContentEditor.dwp file.

See Also

Other Resources

Custom Web Parts