Microsoft Technology, .Net, BizTalk, Sharepoint & etc.

Liedong(Ken) Zheng, Senior SharePoint Developer at SIMPLOT

Posts Tagged ‘Search’

Removing contextual: This sites cope from simple search box

Posted by ken zheng on October 23, 2008

Microsoft Office SharePoint Server 2007 provides two categories of search scopes: Custom and Contextual.

*
Custom scopes:
o
“All Sites”
o
“People”
o
The custom search scopes created via the search or site admin pages
*
Contextual scopes:
o
“This Site”
o
“This List”
Mark has posted a blog explain these 2 types.

If you want to remove the “This site” contextual scope all together, then this cannot be done using standard user interface. You need to create a new feature based on one of the existing ones. The sample below replaces the collaboration portal search box with a delegate without the “This site” contextual scopes.

1.
Make a copy the existing feature OSearchEnhancedFeature (MOSS Enterprise ed.)
2.
Change the sequence number to fit below 25, e.g.

3. Add the DropDownMode property

ShowDD_NoContextual

All you need to do now is to package the feature in solution and deploy it. You can do it manually, or use something like the WSPBuilder

Posted in Sharepoint | Tagged: | 1 Comment »

SharePoint Search Scopes don’t appear in drop-down list

Posted by ken zheng on September 30, 2008

The “All Sites” and “People” search make use of the Search Center capabilities in MOSS. It appears that you do not have a Search Center created, or the URL for the Search Center is not correct.

a) Create a Search Center Site
b) Associate the Site Collection Search settings with that Search Center
You can get to this by clicking on Search Settings under the Site Collection Administration section. When you select Custom Scope, you need to provide a URL to the search center.

Once you have the site create you will just select People Search Webpart

Edit -> Modify Shared WebPart and in the Miscellaneous section change the
Target search results page URL to /sites/SearchCenter/results.aspx.
If you use People search in the dropdownlist. You will need to change the scope by SharedSerivce Provider (SharedServices1 > Search Settings > Scopes > Scope Properties and Rules )

Posted in Sharepoint | Tagged: , | 1 Comment »

Connect a custom Search Page and Add Search Scope List

Posted by ken zheng on May 18, 2008

Create a custom Search Page

  1. Navigate to your Search Center (http://yourcompany/SearchCenter)
  2. Choose “Site Actions -> Create Page”
  3. Create a new Search Page by using the “(Welcome Page) Search Page” template and fill in your details

It should look like this:

Create a custom Search Results Page

  1. Make sure that you are back at the Search Center site
  2. Choose “Site Actions -> Create Page”
  3. Create a new Search Results Page by using the “(Welcome Page) Search Results Page” template and fill in your details

It should look something like this:

Add the newly created Search Page to the tablist in your Search Center

  1. Make sure that you are back at the Search Center site
  2. Choose “Site Actions -> View All Site Contents”

You will now see one list for the Search Pages and one list for the Search Results Pages, as seen in this picture:

  1. Navigate to “Tabs in Search Pages”
  2. Choose “New -> New Item”
  3. Enter the Title, Page (The page.aspx you created earlier. I used ZimmerSearch.aspx) and optionally enter a Tooltip
  4. Click “OK”
  5. You will see your new Tab show up in the list

Add the newly created Search Results Page to the Tablist in your Search Center

  1. In the top of your left menu you will see “View All Site Content”, Click it.
  2. Repeat the steps from the previous section but use the Search Results Page you created instead.

If you navigate to your Search Center, you will see that your Tab has been added to the Tablist:

Connect your Search Page  with your Search Results Page

  1. Click on your newly created Tab
  2. Choose “Site Actions -> Edit Page”
  3. Choose “Edit -> Modify This Shared Web Part” on your Search Box
  4. Under the “Scopes Dropdown” section choose “Show, do not include contextual scopes” in the Dropdown mode
  5. Enter a Dropdown label if you’d like

It should look something like this:

  1. Expand the “Miscellaneous” section
  2. Enter your Search Results Page filename into the “Target search results page URL” textbox (I used ZimmerSearchResults.aspx)
  3. Click “Ok”

Now publish the page and it should look something like this:

Make sure it works

  1. Make a search on your custom Search Page
  2. Make sure that the url contians your custom Search Results Page
    (Mine is: http://zimmer/SearchCenter/Pages/ZimmerSearchResults.aspx)
  3. It works!

Can I bind the Search Page to a specific Scope?

Of course you can. Follow these steps:

  1. Navigate to the Site’s Scope’s section (I usually just navigate to http://zimmer/_layouts/viewscopes.aspx?mode=site)
    (This can be done by just navigating to Site Settings, Go to Top Level site settings, Search Scopes)
  2. Choose “New Display Group”
  3. Enter a Title (Important: Remember this name!)
  4. Choose your Scope in the Scopes list
  5. Make sure it’s also the Default Scope
  6. Click OK

Your displaygroup should be shown with a scope, similar to this:

  1. Go back to your Search Center
  2. Navigate to your custom created Search Page
  3. Again, choose “Site Actions -> Edit Page”
  4. Expand the “Miscellaneous” section
  5. Locate the “Scope Display Group” text box
  6. Enter your newly created Display Group (The name of the display group, mine was Zimmer)
  7. Click “OK”
  8. Publish your page

The Dropdown with Scopes should now only contain your newly added Display Group, similar to the following screenshot:

And what do you know… It works :)

Posted in Sharepoint | Tagged: , | 3 Comments »