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'm working on a custom search based, by copying osssearchresults.aspx and making a few changes.

My Publishing Site with workflow sitecollection has a few sites at the root, for different languages (not using variations, but that's another story), so my structre is something like:

mydomain.com/
mydomain.com/us
mydomain.com/fr
mydomain.com/support

etc.

Before I started customizing my results page, I was sure that when I did a search within the 'us' site, for example, the results were shown on mydomain.com/us/_layouts/osssearchresults.aspx and if I search within the 'support' site, the results page URL was mydomain.com/support/_layouts/osssearchresults.aspx, i.e. the site was part of the URL. This was perfect, as each site has it's own navigation menu, and the results for each site display the correct navigation menu for that site.

I created my copy of osssearchresults.aspx, which I called results.aspx (I know, clever, eh?) and set the site collection administration > search settings > 'Site Collection Search Results Page' value to be /_layouts/results.aspx. Searching then produced the same results - each results page showed the current site in the URL (/us/_layouts/results.aspx, /fr/_layouts/results.aspx). I have screenshots!

Since then I've been trying out different settings, adding some Best Bets, etc, and found that now when I do a search from the 'us' site, the results page URL no longer contains the site as part of that URL, but is only mydomain.com/_layouts/results.aspx. This is a problem because the sitecollection has yet another navigation menu, linking to each of the sites (i.e. the sitecollection nav menu is "US | UK | FR | SUPPORT" etc, but isn't contextual to the page shown in the search results.

I've tried each of the 'Site Collection Search Dropdown Mode' options, but I cannot get the site to be part of the URL, and therefore (it seems) cannot get the right navigation menu to show at the top of the page.

Am I going insane (likely, but specifically about SharePoint) and I just imagined the ootb osssearchresults.aspx page URL, and my custom results page URL, showing the current site in that URL, or is there somewhere else that I can change a setting to make this work again?

To confirm: the goal is results page URLs like this:

mydomain.com/us/_layouts/results.aspx
mydomain.com/fr/_layouts/results.aspx
mydomain.com/support/_layouts/results.aspx

Thanks

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

If you edit your Search Box Web Part what are the following values?

  • Miscellaneous > Use site level defaults
  • Miscellaneous > Target search results page URL

If Use site level defaults is checked then it would be using the value of /_layouts/results.aspx that you set in the Site Collection Search Results Page. Maybe this URL is absolute and you need to make it relative by changing it to _layouts/results.aspx?

If Use site level defaults in not checked then it would be using the URL set in Target search results page URL on the Search Box web part.

share|improve this answer
    
Hi MLF - thanks for the reply. I checked out whether '_layouts/results.aspx' would work (and '~/_layouts/default.aspx' too) but it doesn't. Without the leading slash, the site tried to locate `mydomain.com/us/Pages/_layouts/results.aspx', which cannot be found. –  QMKevin Oct 7 '11 at 19:14
    
Is the Search Box Web Part where you are entering your query on your results.aspx page? –  MLF Oct 7 '11 at 19:24
    
Regarding the web part. This is what my website shows (again, this is copied and NOT changed from the ossearchresults.aspx page): <MSSWC:SearchBoxEx id="SearchBox" runat="server" GoImageUrl="/_layouts/images/gosearch.gif" GoImageUrlRTL="/_layouts/images/gosearch.gif" UseSiteDefaults = "true" DropDownModeEx=ShowDD_DefaultURL ScopeDisplayGroupName = "" FrameType="None" ShouldTakeFocusIfEmpty=true /> I changed the 'UseSiteDefaults' to false, but there's no difference, i.e. no 'us' in the URL and the navigation menu is from the sitecollection, not the site. –  QMKevin Oct 7 '11 at 19:31
    
I'm entering my keywords in a search box in our custom master page. Again, this was working yesterday, before I started changing other settings, so I'm not suspecting the master page search box is the issue, but rather a setting somewhere. –  QMKevin Oct 7 '11 at 19:32
    
On your custom master page how is the SearchBoxEx web part configured with respect to UseSiteDefaults, DropDownModeEx and DefaultResultsPage properties? Also, if you go to your Results.aspx page (and even the OOTB ossearchresults.aspx page) and issue your query from the search box on those pages (not from the search box on your custom master page) do you end up with the URL you expect? –  MLF Oct 7 '11 at 19:43
show 3 more comments

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.