Quantcast
Channel: Vardhaman Deshpande
Viewing all articles
Browse latest Browse all 134

Modify Search Center Settings with JavaScript Client Object Model

$
0
0

Although there is currently no API in the JavaScript CSOM which lets you change the search center url directly, SharePoint stores the search settings in the Property Bag of the root SPWeb object in a site collection. You can set these property bag values and your search settings should get modified.

"SRCH_ENH_FTR_URL"– Search Center URL

"SRCH_SITE_DROPDOWN_MODE"– Search Scope Drop down option

"SRCH_TRAGET_RESULTS_PAGE”– Target Search Results page

Using JavaScript Client Object Model, you can set the values like this:

For the Search Scope Drop Down Options, here is a full set of values you can set:

Do Not Show Scopes Dropdown, and default to contextual scope: "HideScopeDD_DefaultContextual"
Do Not Show Scopes Dropdown, and default to target results page:"HideScopeDD"
Show scopes Dropdown:"ShowDD"
Show, and default to ‘s’ URL parameter:"ShowDD_DefaultURL"
Show and default to contextual scope:"ShowDD_DefaultContextual"
Show, do not include contextual scopes:"ShowDD_NoContextual"
Show, do not include contextual scopes, and default to ‘s’ URL parameter:"ShowDD_NoContextual_DefaultURL"

Viewing all articles
Browse latest Browse all 134

Trending Articles