Archive for August, 2007

Author: Tobias Zimmergren
Url:
http://www.zimmergren.net

The other day I got a comment on a post from one of my readers who wanted to know how you can connect your custom created Search Page with a specific Search Scope.

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:
customsearchpagescope1

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:
customsearchpagescope2

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:
customsearchpagescope3

  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:
customsearchpagescope4

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
    customsearchpagescope5
  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:
customsearchpagescope6

  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:
customsearchpagescope7

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
    customsearchpagescope8
  5. Make sure it’s also the Default Scope
  6. Click OK

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

  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:
customsearchpagescope10

And what do you know… It works :)

Thanks for taking your time to read this, please leave a comment or two :)

MOSS 2007: Customize the Search Result (using XSLT)

August 23rd, 2007 by Tobias Zimmergren

Author: Tobias Zimmergren
Url:
http://www.zimmergren.net

Since people have been bugging me to get started with the blogging again, I guess I should just take their advice and get to it.

This blogpost will cover the basics of customizing your search results-page using XSLT.

I will in a later blogpost also show you how you can use SharePoint Designer as a tool to create the actual XSLT for you in combination with the DataViewer Web Part, and then how you can modify the created XSLT to match whatever specifications you’ve got in your designs.

I would recommend creating a new Search Page and Search Results Page to use, but for this little demo I’ll just use the default search page and search results page.

Let’s get started then..

First of, take a look at the search results page (the page you see when you’ve made a search):
customsearchresultsone1 

From here, take the following actions:

  1. Choose Site Actions -> Edit Page
  2. Locate the "Search Core Results" web part, and choose "Edit" -> "Modify Shared WebPart"
  3. Locate "Data View Properties" and choose the huge "XSL Editor…" button :)

You should now see something like this:
customsearchresultsone2

Now all you need to do (if you wish to use the existing properties) is to add your custom xhtml (I tend to say xhtml instead of html to mark the importance of web standards and cross-browser compatability).

I just added some style-attributes to the body div and the results template span-tag to mark my point. I did by no means put any energy into making this look nice. Please believe me ;)

And this is the final "stylish" outcome:
customsearchresultsone3

 

What have we accomplished today then? Well, nothing big at all. Just a little tip on how you can customize the Search Result presentation with minimum knowledge or efforts. I however will in one of my next blogposts let you in on a little tip on how to use SharePoint Designer and the Data View Web Part to create the custom XSLT for you fully automatically instead of customizing the existing XSLT with your own xhtml. That basically means that it’s dead-easy to change the looks, layout and appearance of the search results in a much more extensive!

That’s a wrap!
By the way; I love comments and try to answer them, feel free to add one while you’re here :)

Back from the Mediterranean

August 7th, 2007 by Tobias Zimmergren

I was out sailing for the last week, in the mediterranean. One of the best vacations I’ve had in a long time really. We (two friends of mine and me) sailed from southern Mallorca (Palma) to france (st. Tropez and Antibe) with alot of stops on the way along the Mallorca and Minorca coastlines :)

I’ve got some pictures from the "cruise" to post later on, but they’re still trapped in my digital camera at home :D

Before I went to the cruise, I was in the middle-parts of sweden somewhere in my relatives cabin. Basically no water, electricity or any other comfortabilities were at hand. You had a lake and a huuuuge forrest to your disposal :D The mobilephone didn’t even have a signal (Yay!) — Now that’s a vacation worth remembering :)

Hope to be back on the SharePoint blogging-track soon, but got tons of other projects which have priority right now :/