Поделиться через


Working With the Search Box Web Part

Shoppers use the Search Box Web Part to select categories for product searches, enter a free-form text phrase, and initiate the search by clicking the Go link.

Web Part

The following figure shows the Search Box Web Part.

Dd452356.vugsearchboxwebpart(en-US,CS.90).png

Adding the Web Part to a Page

To add the Search Box Web Part to a page, select it from the Web Part list.

You must also add a Search Results Web Part to the page to implement the Search Feature.

You can also put the Search Results Web Part on a different page but this requires that you set the SearchResultPageUrl parameter to point to the new page.

Property Sheet

The following figure shows the Search Box Web Part property sheet. The Search Box Web Part property sheet lets site designers control some aspects of the Web Part's behavior and appearance. The property sheet is displayed by selecting the edit option on the Web Page (in Edit Page mode) and then selecting Modify Shared Web Part. This displays the property sheet. Expand the sections to see the relevant properties.

Dd452356.Vug_SearchBox_WP_Properties(en-US,CS.90).gif

Properties

The following table lists and describes the properties for the Search Box Web Part.

Name

Type

Description

Default value

Category drop-down root category

String

Sets the name of the Commerce Foundation catalog category where searching will start when populating the options of the "category" drop-down.

Blank

Display "Category" drop-down

Boolean

If checked, displays a drop-down allowing the user to pick a category filter to apply to the search.

True

"Search phrase" maximum length

Int

Sets the maximum character length allowed in the "search phrase" text box.

40

"Search Results" page URL

String

Sets the URL of the page that will perform the search and show results. If not specified, the URL of the current page is used.

Blank

"Search" button image URL

String

Sets the file URL of the image to display on the search button.

Blank

"Category" label text

String

Sets the text displayed beside the "category" drop-down.

Search

"All categories" drop-down option text

String

Sets the text displayed as an option in the "category" drop-down control that will cause searching to be performed within all categories.

All Categories

"Search phrase" label text

String

Sets the text displayed beside the "search phrase" text box.

For

"Search" button text

String

Sets the text displayed on the "search" button.

Go!

Initial search box text

String

Sets the text that is displayed in the search phrase text box. This string disappears when the user starts typing in the box.

Blank

See Also

Other Resources

Working With the Web Parts

Catalog Web Parts

Search Box Web Part