Question

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

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top