Search Wiki:
Project Description
Override the default content query web part, and add advanced features such as context menus for the items, toolbar for lists (if the web part is connected to a single list) and so on.

Release notes
We are now at Beta 2 technical refresh.
Please note the installation instructions and follow them carefuly - I am working on a deployment package, but for now you have to do everything manually.


Please register for the RSS for releases so you will know when I have a release ready.

Please contact me if you want to contribute.
Ishai Sagi - Microsoft Office SharePoint Server MVP

content query web part with context menus no toolbar small.jpg
content query web part with context menus small.jpg
Last edited Oct 24 2007 at 6:18 AM  by ishaisagi, version 12
Comments
ravie wrote  Jul 9 2007 at 1:51 PM  
"Enhanced Content Query Web Part - Cannot import this web part" error message when trying to add it to the page. What's wrong? Installation was successful, however I don't see the feature in the Site collection features list (WSS3).
Thank you.
Marek Hlavac.

bculver wrote  Jul 12 2007 at 9:27 PM  
This web part uses MOSS features (not included in WSS3). This is likely the source of your problem.
Cheers,
Brian Culver

Merlin wrote  Jul 15 2007 at 2:51 PM  
Thanks for the efforts to provide this ability. Are there any plans to provide this on the WSS3 platform? It sounds awesome, but a lot of us can't afford the MOSS upgrade...

bculver wrote  Jul 17 2007 at 6:24 PM  
The reason for the dependency is due to the fact the the Enhanced Content Query Web Part inherits from the out of the box MOSS Content Query Web Part; thus this webpart is completely dependent. So there are no plans for that in this project, that would be an effort by itself.

dewing1984 wrote  Apr 25 at 12:21 PM  
Hi, Thanks for the new improved content query web part!!!
I have used a CAML query (using the QueryOverride property ) to pull a name across onto a subsite. It seems to work ok, except the index for the items on the remote site (the name) appears like so 45:#Derek Ewing, how do i get rid of the 45:#, I have tryed setting the data types as user, but it doesnt seem to work. any ideas ??

alexsinge wrote  Apr 30 at 6:15 AM  
Unfortunately the 45;# is returned from the query like that. You can modify the XSLT so that it removes that 45;# part.

alexsinge wrote  May 1 at 7:53 PM  
Here are the XSLT modifications for a quick and dirty fix -- by quick and dirty I mean it removes all text before and including the first instance of 2 characters ";#". So if you happen to have an instance of ;# somewhere in your data, it will remove that and any text before it.

Ok, disclaimer aside, for this I will change the data in the CQWP description - you can modify where necessary. I've mapped the "Name" column to the description and get 1;#default.aspx for my otherwise default settings on CQWP.

1. navigate to the style library (http://<yourserver>/Style Library), click on "XSL Style Sheets"
2. Download a copy of ItemStyle (ItemStyle.xsl) -- click the contextual menu and choose Send to->Download a copy
3. Modify the template you are using (I used default) - Add the following code to the variable section near the top of ItemsStyle.xsl

<xsl:variable name="CleanedDescription">
<xsl:call-template name="OuterTemplate.Replace">
<xsl:with-param name="Value" select="@Description" />
<xsl:with-param name="Search" select="concat(substring-before(@Description,';#'),';#')" />
<xsl:with-param name="Replace" select="''" />
</xsl:call-template>
</xsl:variable>

4. In the later section where it displays the description change the @description to be $CleanedDescription - as below.

<div class="description">
<xsl:value-of select="$CleanedDescription" />
</div>

5. Upload your modified style sheet using the "Upload" link from the toolbar and check it in as new versions to existing files. Reload your Content Query webpart and voila - the extra junk is gone.

6. Because the OuterTemplate.Replace XSLT function only exists in ContentQueryMain.xsl this will break your Table Of Contents and Summary Link webparts. To fix this - modify the stylesheets for each. They are in the same library as ItemStyle.xsl. Copy the following code (taken from ContentQueryMain.xsl) into the stylesheet. I'd suggest pasting just before the closing tag (</xsl:stylesheet>).

<xsl:template name="OuterTemplate.Replace">
<xsl:param name="Value"/>
<xsl:param name="Search"/>
<xsl:param name="Replace"/>
<xsl:if test="contains($Value,$Search)">
<xsl:value-of select="concat(substring-before($Value,$Search),$Replace)"/>
<xsl:call-template name="OuterTemplate.Replace">
<xsl:with-param name="Value" select="substring-after($Value,$Search)"/>
<xsl:with-param name="Search" select="$Search"/>
<xsl:with-param name="Replace" select="$Replace"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="not(contains($Value,$Search))">
<xsl:value-of select="$Value"/>
</xsl:if>
</xsl:template>

NOTE: This will apply to all Content Query webparts - if you just want this behavior for 1 CQWP, you might consider adding a new template style to the ItemStyle.xsl and just change the Description (or whatever you've mapped your data to) there. Then set your "GroupStyle" property in the webpart to be your custom style.

bihq wrote  Jul 2 at 5:41 PM  
Will this be able to populate all the recurrence events?

timpaul wrote  Jul 4 at 3:20 PM  
Hi, it's almost a year since the beta 2 refresh. From the discussion it appears this project is alive, do you have a release date? Also I note from the screen shots above that Content is spelled as Conent. Little thing I know, not sure if you are publishing with this screen shot or not.

rmathur2729 wrote  Jul 7 at 3:55 PM  
Hi, I would like to say this is an excellent tool but I am having some issues. I am having a Form Library and I have few Custom Columns but these are not content types they are just custom columns. I have installed the tool it also displays the document but when I add the Column Name with data type it does not pick those.

Is it that the content Query WebPart works only with Content types.

Any help would be appreciated because if it does not works then I need to write some code.

Updating...