Share via


Walkthrough: Add a Tab and Custom Search Page with Enterprise Search Web Parts to the Search Center

Microsoft Office SharePoint Server 2007 and the Enterprise Search in Microsoft Office SharePoint Server 2007 give you the ability to create custom search pages directly from the user interface.

In this walkthrough, you'll create basic search and search results pages using the user interface for the Search Center. You will then customize these pages for searching Products from the Walkthrough: Configuring Search for the AdventureWorks Business Data Application Sample.

Following are the tasks addressed in this walkthrough:

  • Adding new tabs to the Search Center's tab controls

  • Creating a custom search page with a Search Box Web Part

  • Creating a custom search results page with the Search Core Results Web Part

  • Modifying the properties of both Search Web Parts for searching a specific set of content (AdventureWorks2000, Products data).

Prerequisites

Following are the prerequisites for performing this walkthrough:

Creating Tabs for the Search Pages

In the first part of the walkthrough, you will create the tabs for the Product Search page and the Product Search Results page.

To add the Product Search tab to the Search Center tab controls

  1. In your browser, navigate to the Windows SharePoint Services list for the SearchCenter tab control:

    http://[Site]/SearchCenter/SearchCenter/AllItems.aspx
    
  2. In the list toolbar, click the New link.

  3. In the Tab Name field, type Products.

  4. In the Page field, type product.aspx.

  5. Click OK to create the new tab.

    Alternatively, you can navigate directly to the New Item page for the SearchCenter tab control, located here:

    http://[Site]/SearchCenter/SearchCenter/NewForm.aspx
    
  6. In your browser, navigate to the Windows SharePoint Services list for the SearchResults tab control:

    http://[Site]/SearchCenter/SearchResults/AllItems.aspx
    

    Alternatively, you can navigate directly to the New Item page for the SearchResults tab control, located here:

    http://[Site]/SearchCenter/SearchResults/NewForm.aspx
    
  7. Repeat steps 2 through 5. For step 4, type productresults.aspx in the Page field.

Creating the Product Search and Search Results Pages

Now you will create the pages you specified for the Products search tabs.

To create the Product Search page

  1. Open the Search Center site in the browser, click the Site Actions menu, and then click Create Page.

  2. In the URL Name field, type product.

  3. In the Title field, type Product Search.

  4. In the Page Layout list, select (Welcome Page) Search Page.

  5. Click Create to create the page.

To create the Product Search Results page

  1. Open the Search Center site in the browser, click the Site Actions menu, and then click Create Page.

  2. In the URL Name field, type productresults.

  3. In the Title field, type Product Search Results.

  4. In the Page Layout list, select (Welcome Page) Search Results Page.

  5. Click Create to create the page.

Adding the Search Web Parts to the Product Search and Search Results Pages

In the final part of the walkthrough, you add the Search Web Parts to the new search pages, and configure them to search the Products data from the Business Data Catalog.

To add and configure the Search Box Web Part to the Products Search page

  1. Open the Product Search page in the browser, and then click Add a Web Part link in the Top Zone.

  2. Select Search Box, and then click Add.

  3. In the Search Box Web Part that is added, click the down arrow to display the Web Part menu, and then click Modify Shared Web Part. This opens the Search Box Web Part tool pane.

  4. Expand the Scope Dropdown node in the tool pane.

  5. In the Dropdown Mode list, click Do not show scopes.

  6. Expand the Miscellaneous node.

  7. Click in the Target Search Results Page URL Override field to display the ellipsis button (…), and then click the button to open the Text Entry window for this field.

  8. Replace the page specified in the URL, "Results.aspx" with "ProductResults.aspx", and then click OK to save your changes.

To add and configure the Search Box and Search Core Results Web Part to the Products Search page

  1. Open the Product Search Results page in the browser, and then click the Add a Web Part link in the Top Zone.

  2. Select Search Box, and then click Add.

  3. In the Search Box Web Part that is added, click the edit down arrow to display the Web Part menu, and then click Modify Shared Web Part. This opens the Search Box Web Part tool pane.

  4. Expand the Scope Dropdown node in the tool pane.

  5. In the Dropdown Mode list, choose Do not show scopes.

  6. Expand the Miscellaneous node.

  7. Click in the Target Search Results Page URL Override field to display the ellipsis button (…), and then click the button to display the Text Entry window for this field.

  8. Replace the page specified in the URL, "Results.aspx" with "ProductResults.aspx", and then click OK to save your changes.

  9. Click the Add a Web Part link in the Middle Left Zone.

  10. Select Search Core Results, and then click Add.

  11. In the Search Core Results Web Part that is added, click the edit down arrow to display the Web Part menu, and then click Modify Shared Web Part. This opens the Search Core Results Web Part tool pane.

  12. Expand the Results Query Options node in the tool pane.

  13. Click in the Selected Columns field to display the ellipsis button (…), and then click the button.

    This opens the Text Entry window for the Selected Columns property.

  14. Replace the existing XML for the Selected Columns property with the following:

    <root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">    <SelectColumns>                <Column Name="Rank"/>        <Column Name="ProductName"/>        <Column Name="ProductNumber"/>        <Column Name="ProductColor"/>        <Column Name="ProductPrice"/>        <Column Name="ProductStartDate"/>        <Column Name="CollapsingStatus"/>        <Column Name="HitHighlightedSummary"/>        <Column Name="HitHighlightedProperties"/>    </SelectColumns>    </root>
    
  15. Click OK to return to the tool pane.

  16. Click Data Form Web Part to display the XSL Editor node.

  17. Click the Source Editor button to open the Text Entry window for the Web Part's XSL property.

  18. Replace the contents of the XSL property with the XSLT sample code in Sample: Search Core Results Web Part XSLT.

  19. Click OK to return to the tool pane.

  20. Click OK to save the changes to the Web Part.

See Also

Tasks

Walkthrough: Configuring Search for the AdventureWorks Business Data Application Sample

Concepts

Sample: Search Core Results Web Part XSLT
Search Center Tab Navigation Control