Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am us a 'SearchBoxEX' control on my site. Since my site has a language variation, I use a resource files to specify the 'SearchResultPageURL' property.

The page is located on the root of each variation:

ie. "http://.../en-US/SearchResults.aspx" ie. "http://.../fr-FR/SearchResults.aspx"

How do I specify the URL in my resource such that it is a relative URL that will always point to the correct 'SearchResults.aspx' regardless on which sub-site I may be on.

share|improve this question

1 Answer 1

As far as I am aware that needs to be set at site collection level.

[source]

PowerShell script to do it.

$site = Get—SPSite "http://[site]"
foreach ($web in $site.Allwebs) {
    Write—Host "Modifying all search result pages in site ($($web.Url))"
    $web.AllProperties["SRCH_ENH_FTR_URL"] = http://[searchsite]/
    $web.update()
}
$site.Dispose()

Also: You can also set this to happen on a Web Provisioned event receiver for new webs.

share|improve this answer
    
There are two different pages, depending on whether sites exist under the variation or not. It is up and running, however I specify the full URL to the page. If I ever change IP for example, I will need to update the resource file. How would I, for example, specify a link on a page to always go to the root-site level, without specifying the entire URL? –  TeddyRuxpin Dec 3 '12 at 17:21
1  
Why don't you use relative URLs? Under /_layouts/enhancedSearch.aspx "Example: /SearchCenter/Pages or server/sites/SearchCenter/Pages"; –  Hugh Wood Dec 3 '12 at 17:29
    
I had tried that, turns out I forgot the initial "/". Thanks, for the help. –  TeddyRuxpin Dec 3 '12 at 17:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.