Posts Tagged ‘Tricks’

Tuesday, August 5th, 2008

SharePoint Tricks: Content By Query for Single Web

Quick little trick tonight for all you SharePoint configurators out there. Ever needed to use the Content by Query Webpart and query for just a single site? Yes? Well, then you probably ‘ve noticed there is no such option when configuring the webpart… right?

Content by Query Source Options

Content by Query Source Options

Wrong! There is a way to enable single site quering, and it’s actually not that hard. First thing you have to do is export your webpart to a file. Open your .webpart file and add (or replace the old one with) this little property:

<property name="WebsOverride" type="string">&lt;Webs /;&gt;</property>

This property will, as its name suggests, override the webs property of the sitedataquery. By default the content by query webpart will fill this in with SiteCollection or Recursive. But if you don’t want this, just overwrite it with this (empty) Webs value.
After adjusting your file, upload it back to your page, and add an instance of your new webpart. And there you have it, single site goodness. ;-)

Hope it helps! Good night.

Tuesday, April 1st, 2008

SharePoint Tricks: Adding Google Search To Search Scopes

Tonight’s article is one based on a little trick I pulled of last year at one of my customer’s Intranet. As it turns out, there seems to be quite some people using Google Search (Live Search anyone?) ;-)
So how do we add this search scope? The trick lies in a custom page for the search scope. When creating a search scope in your site collection settings, you’re allowed to enter a custom search page.

 SharePoint Tricks: Google Search Scope Configuration

This custom search page simply has to redirect to the google query webpage: eg.http://www.google.com/search?q=ENTER+A+WORD. Don’t forget to replace the ENTER+A+WORD content of the q variable with the k variable you find in the query string of the custom page. This is whare all the magic lies, you see. So in the end, we’re basicly rerouting the query from SharePoint to Google. Pretty simple, but very effective!

 SharePoint Tricks: Google Searc Scope Use

Hope you guys liked the trick. See you next time!