Home Sign In

Steven Van de Craen's Blog

Bloggings about SharePoint, .NET and more.

MVP SharePoint Server

RSS Feed
  • Contact Me

Archives

July 2007 (19)
August 2007 (5)
April 2008 (4)
September 2007 (3)
November 2007 (12)
October 2007 (4)
December 2007 (8)
January 2008 (6)
February 2008 (3)
March 2008 (4)
June 2008 (2)

Categories

  • SharePoint 2003
  • SharePoint 2007
  • General
  • Office 2003
  • Office 2007
  • Excel Services
  • Dynamics NAV
  • SOAP
  • Search
  • Search Server 2008
  • .NET
  • CKS
  • IIS

Recent Posts

  • Browsable Hyperlink fields in SharePoint 2007
  • Working with the AssetUrlSelector
  • Rooms and Equipment Reservations v2 (UNOFFICIAL)
  • Being a SharePoint MVP...
  • New MVP on the block

Other Blogs

//BLOG: naked programmer
JOPX
Jan Tielens' Bloggings [MVP]
Serge van den Oever [Macaw]
Carlos Segura Sanz
-->Patrick Tisseghem's Blog [MVP SharePoint] -->
Remco Ploeg's Blog
SharePoint Blogs
Romeo Pruno
[email protected]
Andrew Connell [MVP MOSS]
Mark Harrison
Pedro Serrano
Clemens Vasters and the Indigettes
Kevin Boske
SharePoint Team Blog
Brian Jones: Office XML Formats
Mart Muller's Sharepoint Weblog
Joel Oleson's SharePoint Land
Kris' blog
STSADM Custom Extensions
Microsoft Enterprise Search Blog
Michaël's coding thoughts
Chris O'Brien's blog
John Holliday's SharePoint Reflections
Koen's blog
PDT IT Services Blog Posts

MSDN Belux article: Customizing the Content Query Web Part (repost)

My first article on MSDN Belux:

http://www.microsoft.com/belux/msdn/nl/community/columns/stevenvandecraen/contentquerywebpart.mspx

It was written for MOSS 2007 Beta 2 but still very much applies to MOSS 2007 RTM.

 
Categories: General, SharePoint 2007

Trackback Url

 

Comments

Thursday, 27 Dec 2007 07:53 by Evgeny
Hi Steven! As I can not become successful, export web part and add string ProjectProperty.Title correctly? After import web part on the web page, don't see column Site Name. What not so?

Thursday, 27 Dec 2007 07:53 by Evgeny
"ProjectProperty.Title"

Thursday, 27 Dec 2007 07:53 by Evgeny
"property name="ViewFieldsOverride" type="string" ProjectProperty.Title property"

Thursday, 27 Dec 2007 07:53 by Willem
Hi Steven,

Good post about the Content Query Web Part. I do have one question. Is it possible to link to the My Site of the author. In your code example only the author's name was displayed. I think it would be a nice enhancement if you can link to his/her My Site...

Thanks in advance, Willem

Thursday, 27 Dec 2007 07:53 by Steven Van de Craen

Good question, Willem. You could do it in multiple ways, I'm not sure which would be the best.

You could render the Presence Information Icon using the user's email address. You would have to incorporate the following markup:

 {1}

Another option is to build the link to the UserInfo.aspx page using the User ID. This page will redirect to the MOSS Profile Page if available:

/_layouts/userdisp.aspx?ID={0}

Regards.


Thursday, 27 Dec 2007 07:53 by Luc
Hi Steven, Excellent post! It is very usefull. I have tried to group the result by using a column created directly in the list but the column doesn't appear as available column in the dropdown list. Same thing for the filter field. Is there a way to customize the web part to use specific column to group or filter the query content web part ? Thanks for your help. Luc

Thursday, 27 Dec 2007 07:53 by Steven Van de Craen
You can export the Web Part and specify the Group By / Filter By properties directly in the XML. This requires you to use either the Field ID or Internal Name ! You might want to set up a grouped/filtered web part and export it to see the various possibilities. I believe your fields must be 'known' on site level where the Web Part lives, so you could try to use Site Columns for your items and web part.

Thursday, 27 Dec 2007 07:53 by Luc
It works! Finally, you just have to replace the GroupBy property with the column name. The column can be created directly in the list. It is not necessary to be a 'Known' column at the site level. Here's my case: TypeLien Thanks for your excellent support !

Thursday, 27 Dec 2007 07:53 by Boris
Hi Steven! Excellent post! Please, tell me, how to display in CQWP the name of subweb?

Thursday, 27 Dec 2007 07:53 by Steven Van de Craen

Boris, only when you specify 'Group By ' you can display the site name using .

If you don't want this you can specify a ViewFieldsOverride with the ProjectProperty Title included. This is a default Cross Site Query and you should be able to find examples on MSDN.


Thursday, 27 Dec 2007 07:53 by Evgeny
Hi Steven! Big thank for your support! Post super! I wish to deduce in the CQWP a name of subweb and a name of library of documents, but a grouping to me it is necessary to disconnect.

Thursday, 27 Dec 2007 07:53 by Steven Van de Craen
Evgeny, you can export the web part and add a ViewFieldsOverride with the desired view fields (can be both a Field as ProjectProperty. The latter is used to display eg the web title (ProjectProperty.Title). Have a look at http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.viewfields.aspx

Leave a comment

Name

Url

Email

Comments

CAPTCHA Image Validation

© 2007 Steven Van de Craen — Powered by Community Kit for SharePoint: Enhanced Blog Edition.