Chapter 7. Working with Web Parts

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • What web parts are

  • How to add and configure web parts

  • How to use out-of-the-box web parts

  • How to create custom web parts

Web parts are elements of a SharePoint page that display data and provide their own functionalities. Web parts are modular, which means that they can individually be added, removed, and even rearranged, in order to customize the way the content is displayed. Web parts are the basic building blocks on SharePoint pages, and one of the best ways in which targeted information can be made available to business users.

When making the decision as to which web parts to add to a page, think about the information on the site that will be the most dynamic, interesting or relevant to the site's users.

USING WEB PARTS

Before delving into descriptions of each out-of-the-box web part, it is important to have an understanding of some web part fundamentals. In this section, you will learn not only how to add a web part to a page but also how to configure or delete it. You will also learn the process for importing and exporting web parts, and even for connecting them to each other.

Adding a Web Part to a Page

Multiple web parts can be added to any SharePoint page, using the new contextual Ribbon interface at the top of the page. Web parts are added to web part zones on the page. Web part zones are predefined areas of a page, which are laid out in a specific manner. Web parts can be moved between zones, hidden within the page or completely closed. When a SharePoint site is created, depending on what site template is selected, there will be a different web part zone layout, and even a different way to add web parts to a page. In SharePoint 2010, wiki pages and web part pages have different interfaces, so each of these will now be explained.

Wiki Pages

SharePoint wiki pages are pages that allow for not only the insertion of web parts, but allow for freeform rich text to be typed directly on the page and formatted as desired. When a new site is created, and the Team Site template is selected (for example), the home page of the team site is a wiki page. When web parts and images are added to a page, they are simply dropped into this rich text area.

Web Part Pages

Web part pages are different from wiki pages in that they do not contain free-form rich text areas. These pages simply consist of one or more web part zones in which web parts can be added in a vertical stack. When a new site is created, and the document workspace template is selected (for example), the home page of the site is a web part page by default.

Figure 7-1 displays the pane for adding a web part to a page.

FIGURE 7-1

Figure 7-1. FIGURE 7-1

Now that the web part has been added to the page, it can be moved around from zone to zone by clicking the title part of the web part, and dragging it around the page.

Configuring a Web Part

Each web part that has been added to a page can be customized to change settings or its look and feel. The Web Part tool pane is where most configurations will be accomplished. The Web Part properties in this tool pane will vary between different types of web parts, but there is a standard set of options that are standard across web parts. In this section, each of the standard web part settings will be covered and described.

To configure a web part, the logged-in user must have at least a permission level of Designer. Hover your mouse over the top-right corner of any web part to see a small black triangle. Click this triangle to display a drop-down box. Choose Edit Web Part to elicit the Web Part tool pane, which will show on the right side of the page.

Note

When the page is in edit mode, there will be more choices in the drop-down box in the corner of the web part. Click Site Actions and Edit Page to switch to edit mode.

Figure 7-2 shows an example of a web part drop-down box when the page is in edit mode.

FIGURE 7-2

Figure 7-2. FIGURE 7-2

The following standard settings exist in the web part tool pane properties of every web part. The name and description of each property are listed.

Appearance

The Appearance section is used to set up the size and the way that the frame of the web part looks. The following table lists the options available in the Appearance section of the Web Part tool pane. The chrome is the frame, or the box around the web part, and this section allows you to choose the way it looks.

NAME

DESCRIPTION

Title

This is the title that displays in the top of the frame of the web part. For list (and library) web parts, by default the title is the name of the list. Note that changing the web part title does not change the actual name of the list. This can be done in the list settings, in the Title, Description and Navigation section.

Height

The height of the web part, in a selectable measurement, such as pixels or inches.

Width

The width of a web part, in a selectable measurement.

Chrome State

The options are minimized and normal, with normal being the default.

Chrome Type

These options consist of various combinations of the title and border of the web part. When "none" is selected, neither a title nor a border will be displayed.

Figure 7-3 shows some of the appearance options, and the way they apply to the look of a web part.

FIGURE 7-3

Figure 7-3. FIGURE 7-3

Layout

The layout is how the web part looks, relative to the rest of the page and the other web parts.

NAME

DESCRIPTION

Hidden

Hide the web part. This web part can only be seen by the page designer, while the page is in edit mode. This option is sometimes useful for testing purposes, or in cases where the web part contains code or script and does not need to be displayed. When working in a wiki page, this is not configurable.

Direction

Right to left or left to right.

Zone

Pick which web part zone to put the web part in. This is not configurable in wiki pages.

Zone Index

Type the number of the zone index. This is the order in which the web parts are displayed within the web part zone. Typing a "1" here will bring the web part to the top of the page. This can optionally be used instead of dragging web parts with the mouse. This is also not configurable in wiki pages.

Advanced

The main consideration for this section is that each site member will have options available for modifying the way a page is displayed personally, even though they do not have Designer permission on the page. Figure 7-4 shows the drop-down box at the top-right corner of a web part, as seen by a site member.

FIGURE 7-4

Figure 7-4. FIGURE 7-4

The Advanced Options allow the page designer to restrict some of the ways that site members can modify the way the page looks to them.

NAME

DESCRIPTION

Allow Minimize

Uncheck this box to disallow the option to minimize the web part.

Allow Close

Uncheck this box to disallow the option to close the web part. Not available on wiki pages.

Allow Hide

Uncheck this box to disallow other page designers from checking the box in the layout options that changes the web part to hidden. Not available on wiki pages.

Allow Zone

ChangeSite members will not be able to put the page in edit mode and rearrange web parts using their mouse, but they will be able to click Edit My Web Part to open the Web Part tool pane. When Allow Zone Change is unchecked, the site members will not have the ability to change zone information for a web part. This option is not available on wiki pages.

Allow Connections

Uncheck this to disallow creating connections from this web part to other web parts on the page.

Allow Editing in Personal View

Uncheck this to disable the Edit My Web Part button from site members.

Title URL

When the title of the web part is clicked, this is the URL that you will navigate to.

Description

When you hover over the web part title with your mouse, this description is shown as the tooltip.

Help URL

If there is a specific page that you have created, for users to obtain help regarding this web part, enter the URL to that page here. When a URL exists here, there will be a new option called Help, available to users when they click the web part's drop-down box.

Help Mode

Choose from modal, modeless, or navigate. When the Help button is clicked, the help page pops up in a new window. This option allows you to configure the behavior of that new window.

Catalog Icon Image URL

This is the image that represents this web part.

Title Icon Image URL

This icon is displayed next to the title of the web part. By default, there is no icon in this location.

Import Error Message

Type the error message that you would like to be displayed if there is ever an error importing the web part.

Target Audiences

Pick the target audience of people who you would like to see this web part. By default, this setting is blank, and the web part is shown to everyone who visits the page. Pick from global audiences, distribution/security groups, or SharePoint groups. Audience targeting is not a substitute for security but is used in order to personalize the way that the page is viewed, according to whom the viewer is. Show the most relevant information to any audience.

Export Mode

This only appears in the properties for web parts that are exportable. Choose from Do Not Allow, Non-sensitive data only, or Export all data.

Removing Web Parts

There are two different ways to remove a web part from a page, closing it or deleting it. It is important to know the difference between these methods, so that page performance does not suffer because of bad practices. Click Site Actions and Edit Page in order to see the close and delete options in the drop-down box in the top-right corner of each web part on a web part page.

Note

The ability to close a web part without deleting it is not available on a wiki page. This can only be done on a web part page.

  • Close a Web Part: When a web part is closed, it is temporarily removed from the page but is placed in a "Closed Web Parts" category in the list of web part categories on the site, and it can be added back at any time. When many closed web parts exist on a page, it can affect the page load performance. Closing a web part is usually not necessary but is done in cases where the web part and its configuration need to be saved for later, but not displayed on the page.

  • Delete a Web Part: Deleting a web part permanently removes it from the page. It is a good practice to get in the habit of deleting web parts instead of closing them, unless it is absolutely necessary to close one and use it later.

The Web Part Checkbox

Most anything that needs to be done to configure a standard web part has already been covered in this section, but just as in many places in SharePoint, there are multiple ways to accomplish the same goal. New in SharePoint 2010 is a small checkbox at the top-right corner of every web part. Checking this box when the page is in edit mode opens the Web Part Tools/Options Ribbon at the top of the page, as shown in Figure 7-5.

FIGURE 7-5

Figure 7-5. FIGURE 7-5

  • Web Part Properties: Opens up the Web Part tool pane.

  • Minimize and Restore: Minimizes or restores the web part, which is the same as the Chrome State in the Appearance options.

  • Delete: Permanently deletes the web part.

  • Insert Related List: Any list can have one or more lookup columns that look up information in another list on the site. Once this lookup field exists, these two lists are considered to be related lists. This button allows you to quickly add a second list that is related with a lookup to the currently selected list. The two web parts are then automatically connected. If there is no other list on the site that is related to the current list, this button will be disabled. There will be more information about web part connections in the section in this chapter called "Connect Web Parts."

Exporting and Importing Web Parts

Some types of web parts can be imported and exported, which is a way of saving a web part and its settings, and adding it to another page. List View (list and library) web parts cannot be exported, but most other types can. When in edit mode, click the drop-down box at the top right of a web part, to see if Export is listed as an option. When the Export button is clicked, you will be prompted to save the web part to your computer. Pick a location on your computer to save the web part to.

Saved web parts can be imported to be displayed on a page. When adding a web part to a page, as shown in Figure 7-1, notice that in the bottom left there is an Upload a Web Part button. Click this button, and then browse to the location on your computer where the web part file exists. Click the Upload button. The next time you click to insert a web part, there is a new category on the right, called Imported Web Parts, which is where the new web part can be selected and inserted on the page.

What if you want this customized web part to always be displayed when you click to insert a web part? Take a look at the "The Web Part Gallery" section toward the end of this chapter.

Connect Web Parts

Some web parts on a page can be connected to each other to allow for passing of filters or parameters from one web part to another. When web parts on a page contain columns with common data in them, they can be connected. An example of common data that can be connected, is a list that contains a lookup column to another list on the site. It is not required that the connected lists contain a lookup column, as long as the data columns being connected contain the same type of information, such as a number or text. The web part that sends the filter information is called the "provider," and the web part that gets filtered is referred to as the "consumer." When a page is in edit mode, click the drop-down box in the top-right corner of a web part to see the Connections option, as shown in Figure 7-2.

To remove a web part connection, follow step 9 above, and then click the Remove Connection button on the Configure Connection screen. Sometimes it is necessary to temporarily remove connections in order to make changes to the filter web part configurations.

ABOUT THE OUT-OF-THE-BOX WEB PARTS

There are so many web parts that already exist in SharePoint, that they can be used for most everything that needs to be accomplished on a SharePoint page. On one end of the spectrum, programmers can save themselves a lot of development time by learning what SharePoint can already do. On the other end of the spectrum, site managers and end users can decrease the use of IT resources to accomplish some simple "web page development" that does not involve the use of any custom code.

List and Library Web Parts

Any SharePoint list or library can be inserted onto a page as a web part, and these are referred to as List View web parts. As you learned in Chapter 4, views are simply different ways of looking at the same data. Whether working with lists or libraries, this web part is referred to as "list view," and the term "lists" in this section refers to both lists and libraries.

Web Part Views

We define the way data will be displayed in a list web part by selecting columns and setting up grouping, sorting and filtering. Learn more about views in Chapter 2, "Working With SharePoint Lists."

Web Part Tool Pane

The Web Part tool pane is displayed on the right side of the page when configuring Web Part properties. At the top-right corner of every web part, there is a small arrow, which opens a drop-down box. In this drop-down list, click Edit Web Part in order to view the Web Part tool pane. As shown in Figure 7-8, there are several sections of settings to configure. The focus here is on the options that are unique to list view web parts.

FIGURE 7-8

Figure 7-8. FIGURE 7-8

The List Views section of the Web Part tool pane contains a drop-down box called Selected View. Any existing view can be selected, or an ad hoc view can be created by clicking Edit the current view.

The Toolbar Type contains three options. The Summary Toolbar only displays an Add new Item or Add new Document button at the bottom of the Web Part, and it is the same as Full Toolbar. Show Toolbar displays the standard toolbar that you normally see when you go to the home page of a list or library. No Toolbar obviously removes all toolbars.

AJAX

AJAX is short for asynchronous JavaScript and XML. It allows for data to be retrieved from the server asynchronously. This means users do not have to refresh the browser to see changes that others may have made to data that is shown on the page in the web part. The web part's information will be refreshed in the background without interfering with the display, behavior, or other web parts on the existing page. The following are the AJAX options available for list web parts and data view web parts. In this context, asynchronous means that the content in the web part will be loaded independently of the other web parts on the page.

This table lists the options available for AJAX, per web part.

NAME

DESCRIPTION

Enable Asynchronous Load

When the page loads, this web part loads independently of the others. An example of the use of this option is when one web part must retrieve a large amount of data (list items) to be displayed. An animated GIF will indicate that the data is loading.

Enable Asynchronous Update

This checkbox allows any of the below checkboxes to be configured.

Show Manual Refresh Button

Select this in order to allow end users to click a button to refresh the data.

Enable Asynchronous Automatic Refresh

When a user navigates to the page and leaves it open in the browser all day, live data will continue to be displayed without having to use F5 to refresh the browser page.

Automatic Refreshing Interval (seconds)

When Enable Asynchronous Automatic Refresh is selected, type the number interval of seconds at which the automatic refresh needs to happen.

Note

When "Show manual refresh button" or "Enable Asynchronous Automatic Refresh" options are checked, the checkbox for "Enable asynchronous update" will also automatically be selected when the Web Part properties are saved.

Miscellaneous

NAME

DESCRIPTION

Sample Data

If the list is empty, sample data can be displayed while testing the web part.

XSL Link

This is the URL to an XSL style sheet that contains display settings for the web part.

Enable Data View Caching

Cache the data view.

Data View Caching Time-out (seconds)

If caching is enabled, set the time in seconds that the data should be cached.

Send first row to connected web parts when page loads

When web part connections are used, when this option is enabled on the provider web part, the first row of the web part will be sent to the consumer, as the default filter.

Business Data Web Parts

This category of web parts displays data from SharePoint or other line-of-business systems. In this context, business data can consist of charts, graphs, key performance indicators, and even Visio diagrams.

Chart Web Part

The Chart web part is an extremely customizable web part that displays charts based on data existing in one of the following locations:

  • A SharePoint list: Connect to any list not only in the current site but anywhere in the current site collection.

  • The Business Data Catalog: Connect to external content types, for example, other databases such as SQL, and other line-of-business systems.

  • Excel Services: Connect to data that exists in a spreadsheet that exists in a library on the site.

  • Another web part: Connect to another web part on the same page.

This web part consists of easy wizards for connecting to data and customizing the way the chart looks. Once the data connection has been set up, there is an Advanced Properties interface in which the chart's look and feel can be granularly customized.

Figure 7-12 shows an example of what the final 3D chart looks like.

FIGURE 7-12

Figure 7-12. FIGURE 7-12

After a chart has been created, if further customization is needed, click the Advanced Properties button. This advanced Chart Properties interface allows for granular changes to be made to the different aspects of the chart.

Chart web parts can also be exported and then imported to other sites or site collections. By default, the ability to export the web part is disabled. To enable the ability to export, in the Web Part tool pane's advanced section, change the Export Mode option to Export all data. Charts that display data from external content types or Excel Services can even be imported onto sites in other site collections.

Excel Web Access

The Excel Web Access web part allows for the display of a spreadsheet or portion of a spreadsheet on a page. When planning for these types of web parts, the location of the site or specific document library must be added to the list of trusted locations in the Excel Service Application in Central Administration. A spreadsheet can be published to Excel Services from within Excel. On the File menu, choose the Save & Send tab on the left, and select Save to SharePoint. As shown in Figure 7-13, click the Publish Options towards the top right of this screen.

This Publish Options screen is quite useful, because it allows for granular selection of components of a spreadsheet to be published, such as sheets, charts, and ranges. This screen also allows for the creation of parameters, which are useful in creating spreadsheet interactivity, and in connecting to other web parts on the page.

FIGURE 7-13

Figure 7-13. FIGURE 7-13

Once an Excel Web Access web part is added to a page, the Web Part tool pane contains a multitude of configuration options. Select the spreadsheet that is to be displayed, and optionally type the name of one range, chart, or table in the Named Item box.

Status List

The Status List web part displays key performance indicators from an existing Status List in SharePoint. Once a Status List has been created, indicators can be created to view data values compared to goals. In the Web Part properties, pick an existing Status List anywhere in the current site collection.

Indicator Details

The Indicator Details web part displays a single selected indicator from within a Status List on the site. In the Web Part properties, select a Status List in the current site collection and a specific indicator in that Status List.

Visio Web Access

The Visio Web Access web part displays a Visio diagram on a page. Visio is an Office Suite application that allows for the creation of advanced visuals such as charts, diagrams, flowcharts, and even network diagrams and floor plans. When working in Visio, files can be saved as Web Drawing (VDW) files. In the properties of the Visio Web Access web part, an existing VDW file is selected for display. Additional settings can be configured, such as the toolbar and drawing interactivity.

More Business Data Web Parts

There are several more web parts in the list, that all start with "Business Data." These web parts will be covered in Chapter 15.

Content Rollup Web Parts

The main thing that all of the Content Rollup web parts have in common is the fact that they can all display information from other sites, or from multiple sites. Each of these web parts works in a different manner, and they are all useful in their own unique way.

Content Query

The Content Query web part is used in order to display content from multiple sites in one rolled-up view, and it is only available on sites in which the SharePoint Server Publishing Infrastructure feature has been enabled. The settings of this web part have two main sections, called Query and Presentation, which allow you to configure the type of data to roll up and in what manner to present it.

Query

  • Content Type: Pick any one content type to roll up, or keep the default of "All Content Types."

  • Audience Targeting: Each list and library has an audience targeting setting that can be turned on. Each item in that list can then be targeted to an audience. When those lists are displayed in this web part, and this setting is selected, site visitors will only see items in this web part that are targeted to them. Check the box Include items that are not targeted, if you would like untargeted items to be displayed.

  • Additional Filters: Up to three filters can be created to narrow down the content that is displayed. Only site columns are available to choose from.

Presentation

  • Grouping and Sorting: Pick from site columns to group or sort by.

  • Styles: Choose predefined styles for groups and items.

  • Fields to Display: Type the names of the site columns to be displayed, separated by semicolons.

  • Feed: Check this box to include an RSS feed icon and link in the corner of the web part.

Relevant Documents

The Relevant Documents web part displays all site documents that are relevant to the current logged-in user. The Data section of the Web Part properties contains several configuration options, as shown in Figure 7-16.

FIGURE 7-16

Figure 7-16. FIGURE 7-16

Relevant Documents rolls up information from all libraries on the site, and automatically displays only the most recent ones in the order that they were modified, descending. This web part is only available on sites that have the publishing feature enabled.

RSS Viewer

Similar to the Content Query web part, the RSS Viewer web part is only available on publishing sites. This web part is used in order to view an RSS feed of content that exists either inside or outside of SharePoint. Within the Web Part tool pane, enter the URL of the existing RSS feed, and choose a Refresh Time (in minutes) and a Feed Limit. The feed limit is the number of most recent items to be displayed from the feed. It is important to think about how often the content changes in the RSS feed, so that the refresh time may be configured accordingly. It would be a waste of resources to configure a refresh time of 120 minutes for content that is only updated once a week.

Summary Links

The Summary Links web part allows you to add a list of links to the page. The Summary Links web part is only available when the publishing features are enabled on the site. Each time a new link is added, there are several configuration options, such as the ability to set the link to open in a new window. Click the Configure Styles and Layout button to pick group and item styles.

Web Analytics

The Web Analytics web part is a great way to display the site's most popular content. Each time this web part is added to a page, it can be configured to display one of the following:

  • Most Viewed Content: Pick a scope, such as the current site collection or site, and this web part will display the list of items that have been clicked on the most.

  • Most Frequent Site Search Queries: In the search box on the site, when users click "This Site:..." as their scope, this is considered a site search.

  • Most Frequent Search Center Queries: When searches are performed on "All Sites," or performed from within the Search Center on the site, these are considered Search Center queries. When this option is selected, a drop-down box will be available, from which to pick all search scopes or a specific one.

For more information about searches and scopes, read Chapter 17.

WSRP Viewer

WSRP stands for Web Services for Remote Portlets. The WSRP Viewer web part displays portals from websites that use WSRP 1.1. WSRP is an older network protocol specification that allows you to use presentation-oriented web services created by developers, and display that data inside of SharePoint. This would be used in situations where the organization has other intranet applications which need to be leveraged inside of SharePoint.

XML Viewer

The XML Viewer web part displays a selected XML file. It transforms XML data using XSL and displays the results. Enter the XML or XSL into their respective editors, or link to already existing XML or XSL files.

Table of Contents

This web part displays a table of contents consisting of sites, lists and libraries. By default, this web part displays two child levels below the current site, as shown in Figure 7-17.

FIGURE 7-17

Figure 7-17. FIGURE 7-17

The Web Part properties tool pane allows for further configuration. There are options to change the site level to start on, the number of levels deep to display, and columns, styles, and sort options.

Document Set Web Parts

There is a set of web parts called Documents, and most of these pertain to Document Sets. Document Sets are a new feature in SharePoint 2010, in which you can group together similar files, and they exist as a content type in a document library. When the name of the Document Set is clicked, you are taken to a special page that acts as a welcome page for the Document Set, which is shown in Figure 7-18, and it consists of the two web parts called Document Set Contents and Document Set Properties. Use these web parts in situations where the detailed information about a document set needs to be displayed outside of the context of the Document Set welcome page.

FIGURE 7-18

Figure 7-18. FIGURE 7-18

Document Set Contents

The Document Set Contents web part is similar to a list view web part, but it displays only files that exist in the current Document Set.

Document Set Properties

The Document Set Properties web part displays pertinent information about the current Document Set, such as the title and description.

Document ID

The Document ID web part exists in the category of Document Set web parts, but is not necessarily related to Document Sets. There is a site collection feature that can be enabled, called Document ID Service. When documents have this unique ID, the Document ID web part is used to quickly type in the ID of a document to open up that file. This web part simply consists of a text box and a button to open the file.

Media and Content Web Parts

The media and content web parts are added in order to make a SharePoint page visually appealing. Inserting media such as images and video is a good way to grab the attention of site visitors.

Content Editor

The Content Editor web part is a freeform and very versatile web part. Once it has been added to a page, click "Click here to add new content" in the body of the web part. This is where most of the web part configuration is done, which is a lot different from previous versions of SharePoint. When the cursor is in the body of the web part, an Editing Tools tab will show in the Ribbon, as seen in Figure 7-19. Type and edit rich text, or click the HTML button to directly edit the HTML source of the web part.

FIGURE 7-19

Figure 7-19. FIGURE 7-19

Image Viewer

This web part allows for the display of a single image on the page. Before an image can be displayed using this web part, it must exist either somewhere on the Internet, where it can be referenced from, or on the SharePoint site. If the document does not exist online yet, create a Picture Library on the site and upload the image to it. The URL to the image can be pasted into the Image Link box in the Web Part properties. Note that visitors to the page must also have at least read-only access to the image in order for it to be displayed properly to those people.

Besides using the Image Viewer web part, there is another way to insert images onto a page, which is new to SharePoint 2010. When a page is in edit mode, on the Insert tab in the Ribbon, click the Image button. On a Web Part Page, this action is identical to placing the Image Viewer web part on a page. Alternately on a wiki page, clicking to insert an image will prompt with three choices: From Computer, From Address, or From SharePoint.

Media Web Part

Display streaming media in the Media web part. Now in SharePoint 2010, the steps for inserting media files on a page are simple and intuitive. Media files consist of movie files, such as those of the type *.WMV, or audio files such as *.MP3 or *.MP4. The follow is a list of the web part settings:

  • Change Media: Insert a media file that exists on your computer, on SharePoint, or at an address (URL of a website).

  • Change Picture: Insert a picture that exists on your computer, on SharePoint, or at an address (URL of a website). This picture will be displayed as the default view of the web part when the page is loaded.

  • Title: Create a descriptive title for the media. This title is displayed on the web part and at the top of the media file while it is playing.

  • Start media automatically: The media will immediately start playing when each user arrives at the site. It is recommended that this setting be used minimally, in order to conserve network bandwidth.

  • Loop until stopped: When the movie is played, it will continue to play over and over again until it is manually stopped.

  • Styles: There are two different styles that can be applied to the media player, dark or light. This relates to the shading of the Play button on the web part and the frame.

  • Size: Configure the size of the media player on the screen by setting up the height and width in number of pixels.

Page Viewer

The Page Viewer web part is used to display content from another place, similar to looking at another site through a small window. Types of locations that can be shown in this web part are web pages, folders, and files. The folder and file choices only apply to network shares and files on network shares.

Picture Library Slideshow

Previously known as the This Week in Pictures web part, the Picture Library Slideshow web part is perfect for displaying picture library content on any SharePoint page, in a nice visual slideshow format. The web part tool properties allow you to select a picture library from a drop-down box that contains all of the picture libraries on the current site. Configure the duration in seconds that each picture is to be shown, pick a view from the library, and show the pictures in either random or sequential order.

Silverlight Web Part

Use the Silverlight web part to display online Silverlight applications. The configuration of this web part simply entails entering the URL to the Silverlight application package (.XAP) that this application should run from.

OWA Web Parts

The Outlook Web Access web parts are mainly for use on SharePoint My Sites, and they allow a user to display information from their own Outlook account, such as email, tasks, contacts, and a calendar. Each of these web parts has a mailbox name box, where a user's email address name is typed. There is also a Mail Server Address box. On a SharePoint intranet, the mail server address is the internal URL of a mail server, such as http://servername/exchange, and not the URL that a user would go to from outside of the network, such as https://email.contoso.com.

WEB PART NAME

DESCRIPTION

My Calendar

Display your calendar from Outlook. Web part properties contain settings to display a daily or weekly view.

My Contacts

Display your Outlook contacts.

My Inbox

This web part allows you to display your own Outlook inbox.

My Mail Folder

Select this to display a specific folder in your mailbox.

My Tasks

Display the tasks in your Outlook task list.

Form Web Parts

The Form web parts all entail allowing end users to fill in a form inside of a web part, and the InfoPath Form web part is brand new to SharePoint 2010.

HTML Form Web Part

By default, the HTML Form web part consists of a textbox and a Go button. There is a Source Editor button in the Web Part properties, which allows the code behind the form to be modified. This web part is typically connected to another web part to send the form field information to filter another web part on the page.

InfoPath Form Web Part

The InfoPath Form web part allows you to insert any browser-based InfoPath form on a page. When a form is easily accessible to site users as a web part, it is a few clicks easier for site users to fill out the form. The Web Part properties allow you to select a form from your site collection or site. Forms that have been activated to the site collection as administrator-approved templates will be available, as well as forms that have been published to a library on the site. In SharePoint 2010, there is a new ability to convert a regular SharePoint list form to an InfoPath form. These SharePoint list forms are also available to choose from in the Web Part Properties.

Social Collaboration Web Parts

This category of web parts is centered around the concept of personalization in SharePoint. SharePoint users are individuals, and those individuals interact with each other not only in their day-to-day jobs but also via SharePoint. SharePoint 2010 brings together content collaboration, personal information, and communication, which are all utilized in the Social Collaboration web parts.

Contact Details

The Contact Details web part displays contact information about an individual in the organization. One good example of a use for this web part is to display information to site users, regarding whom they should contact with questions about the site. In the Web Part properties, pick a user's name from the global address list, and pick whether to display their picture and their job title. The picture of the contact comes from the user's My Site photo, and an example of this web part is shown in Figure 7-23.

FIGURE 7-23

Figure 7-23. FIGURE 7-23

Site Users

When the organization uses an integrated instant messaging server, such as Office Communication Server (OCS) and Office Communicator or Windows Live Messenger are installed on the client computers, the Site Users web part can be used. Display site users in order to quickly send instant messages or email to them. Pick the maximum number of users to display, as well as a specific SharePoint group of people, such as Site Members.

User Tasks

The User Tasks web part displays tasks that are assigned to the currently logged-in user. This information comes from all task lists on the current site, where the user is in the Assigned To column.

Social Computing Web Parts

As part of the new social computing components in SharePoint, there are several new out-of-the-box web parts. These web parts, such as Note Board, Organization Browser, and Tag Cloud, will be covered in Chapter 11.

Filter Web Parts

The Filter web parts are used to filter information in other web parts on the same page. These web parts are always used with a web part connection to another web part on the page. Any one of these web parts will not be useful without a connection to another web part. Connections are required. For more information about web part connections, read the "Connect Web Parts" section earlier in this chapter.

Note

If one of the Filter web parts has been added to a wiki page, but isn't visible when the page is in edit mode, here's a trick. On any other web part on the page, click the drop-down box in the top right, and choose Edit Web Part. Your hidden Filter web part will appear, so that you can now configure it.

Choice Filter

In this filter, manually type in a list of choices in the Web Part properties. The site user will be presented with a filter button that allows them to pick from one of the choices. Use this web part when the items in the choice list are fairly static, compared to the SharePoint List Filter, which is used for a dynamic list of items.

SharePoint List Filter

Display a choice list of items that exist in a SharePoint list on the current site. This filter is used for dynamic data, or data that is updated fairly frequently. Select a list or library, and pick which column to display as the drop-down choices. Unfortunately, the Title column will not be available as an option in this web part.

Current User Filter

The Current User Filter web part utilizes information about the currently logged-in user, which comes from a specific profile property. This data exists in the user profile properties. Some of this information comes from the company's directory service such as Active Directory, and some of the information is entered by each user on their My Site. In the Current User Filter properties, the default property is the current user name. There is a drop-down box called SharePoint profile value for current user, in which you can select from a long list of other properties, such as Department, Manager, or Job Title.

Date Filter

The Date Filter web part consists of a date picker box. In the Web Part properties, the default value can be set to today, a specific date, or a number of days relative to today. When connecting this web part, the matching column in the consumer web part must be a date column.

Page Field Filter

The Page Field Filter web part can only be used on a wiki page. This web part filters data using column information from the page library in which the current Wiki Page exists.

Query String (URL) Filter

The Query String (URL) Filter uses information from the URL of the current page. For example, the URL to the default view of a task list might look something like this:

http://intranet.contoso.com/Lists/Tasks/AllItems.aspx

Once this web part has been added to the task list's allitems.aspx page, the URL with a query string would have a question mark in it, followed by the name of the filter, as in the following example URL:

http://intranet.contoso.com/Lists/Tasks/AllItems.aspx?Status=Completed

In this example, "Status" has been set as the parameter, and a web part connection has been created to send the query string to the status column in the Tasks web part on the page. The result is a list of items filtered by only tasks that are complete.

Text Filter

The most simple of the Filter web parts, the Text Filter is simply a freeform textbox. The filter text must exactly match the column that is to be filtered, and no wildcards are allowed.

SQL Server Analysis Services Filter

This filter uses a SQL Analysis Services cube. Before using this web part, a data connection to a cube must be created in a Data Connection library. Within the Web Part properties, select the dimension and hierarchy of the cube.

Filter Actions

The Filter Actions web part is used in conjunction with another Filter web part on the same page. Use this web part to allow users to save their favorite filters. Once a user has set a filter to a certain value and saved it, that same filter will be applied next time that user visits the site.

Search Web Parts

Search web parts exist on search pages in a Search Center site, and are covered in Chapter 17.

XSLT LIST VIEW WEB PARTS

The XSLT web part was previously known as the Data View web part or the Data Form web part. This flexible web part can be used to display and aggregate information from various sources. Your company may have data dispersed on multiple systems in addition to SharePoint. With the functionality leveraged by XSLT List View web parts in SharePoint 2010, there is the potential to have a singular repository accessible by the end users. Data of interest can be displayed all in one place — SharePoint.

As custom as this web part is inherently, you don't need to know any development language, and you don't have to be a programmer to create XSLT List View web parts. Web part creation is accomplished in a friendly user interface, using a free program called SharePoint Designer 2010. Not only can you create these types of web parts to extend the look and functionality of regular list views, but you can create views of data in other external systems, also. These systems include databases, web services, XML files, and linked data sources.

Why create these custom web parts? Have you ever run into a situation where a regular list view didn't quite achieve the requirements for a site? This is where the XSLT List View web part steps in to allow you to take it to the next level. Create conditional formatting; create custom buttons in the Ribbon, and even modify the "no matching items" message.

Creating an XSLT List View web part is as simple as opening up your site in SharePoint Designer, opening a list, and clicking the New button to create a new view. When working in these web parts it is a good practice to click the View tab and choose Zoom to Contents. This way, changes cannot accidentally be made to the other areas of the page, such as the navigation.

THE WEB PART GALLERY

The web part gallery exists on every site collection and is the master location that all web parts are stored. These files are either .DWP or .WEBPART files. On the Site Settings page at the top level of the site collection, in the Galleries section, click Web Parts. Explore this list by clicking the Edit button on different rows to see some of the settings. Notice the Title field, which will help you to recognize the names of some of the web parts. Also, see that the Group field indicates which category the web part will be displayed in when inserting it on a page.

Exporting and Importing web parts was covered earlier in this chapter, and it was mentioned that a web part can be imported to a gallery instead of just one page. When it is determined that a web part should be available on all sites and it has been tested on different sites in a site collection, it can be uploaded to the gallery and categorized. On the Documents tab in the Ribbon, click the Upload Document button, and upload the file to the gallery. It will then be available on all sites in the site collection.

SUMMARY

Web parts are fundamental to the way SharePoint pages display content, and to how people who visit your site will perceive it. This chapter has supplied you with a plethora of introductory information so that you can effortlessly add and configure web parts on your site. Not only have web parts fundamentals been described, but you have also learned about each of the out-of-the-box web parts and even tried some of them out.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.113.55