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:
Enterprise Search
Sufficient permissions to create pages for the Search Center site
AdventureWorks SQL Server 2000 Sample completed
You have completed the Walkthrough: Configuring Search for the AdventureWorks Business Data Application Sample
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
In your browser, navigate to the Windows SharePoint Services list for the SearchCenter tab control:
http://[Site]/SearchCenter/SearchCenter/AllItems.aspx
In the list toolbar, click the New link.
In the Tab Name field, type Products.
In the Page field, type product.aspx.
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
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
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
Open the Search Center site in the browser, click the Site Actions menu, and then click Create Page.
In the URL Name field, type product.
In the Title field, type Product Search.
In the Page Layout list, select (Welcome Page) Search Page.
Click Create to create the page.
To create the Product Search Results page
Open the Search Center site in the browser, click the Site Actions menu, and then click Create Page.
In the URL Name field, type productresults.
In the Title field, type Product Search Results.
In the Page Layout list, select (Welcome Page) Search Results Page.
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
Open the Product Search page in the browser, and then click Add a Web Part link in the Top Zone.
Select Search Box, and then click Add.
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.
Expand the Scope Dropdown node in the tool pane.
In the Dropdown Mode list, click Do not show scopes.
Expand the Miscellaneous node.
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.
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
Open the Product Search Results page in the browser, and then click the Add a Web Part link in the Top Zone.
Select Search Box, and then click Add.
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.
Expand the Scope Dropdown node in the tool pane.
In the Dropdown Mode list, choose Do not show scopes.
Expand the Miscellaneous node.
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.
Replace the page specified in the URL, "Results.aspx" with "ProductResults.aspx", and then click OK to save your changes.
Click the Add a Web Part link in the Middle Left Zone.
Select Search Core Results, and then click Add.
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.
Expand the Results Query Options node in the tool pane.
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.
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>
Click OK to return to the tool pane.
Click Data Form Web Part to display the XSL Editor node.
Click the Source Editor button to open the Text Entry window for the Web Part's XSL property.
Replace the contents of the XSL property with the XSLT sample code in Sample: Search Core Results Web Part XSLT.
Click OK to return to the tool pane.
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