Tuesday, December 13, 2011

How to display source site title in Content Query Web Part and Search Results?

What?

How to display source site title in Content Query Web Part and Search Results?

Why?

It is a not so uncommon requirement to group documents / list items by sites and display the site title for each group.

Content Query Web Part returns lot of data but site title is not returned by it by default.

SharePoint search service application does not come with property for site name or site title by default but luckily sharepoint search crawls and indexes site name as ows_sitename