Using CQWP To Show Discussion Rollup with Reply Count and Last Update Date

This is what we want our final result to look like:


1) Add a Content Query Web Part to your page.  Go in and expand the “Query” section.  Modify it to show just the discussions for your site.  Then click OK.  Verify that you can see your discussions.


2) This is where things get a little tricky.  You will need to access the ItemStyle.xsl file of your site, and modify it by adding a new template within the file.  Just find a spot where the templates are within that file and copy and paste the following template entry (be sure to keep what you already have in that file):

<xsl:template name="DiscussionAndReplies" match="Row[@Style='DiscussionAndReplies']" mode="itemstyle">
 <xsl:variable name="vv1"> 
 <xsl:value-of select="@LinkUrl"/> 
 <xsl:variable name="formattedLastUpdatedDate">
 <xsl:value-of select="ddwrt:FormatDateTime(string(@DiscussionLastUpdated) ,1033 ,'dd MMM yyyy')" />
 <xsl:variable name="listTitleEnd">
 <xsl:call-template name="substring-before-last">
 <xsl:with-param name="list" select="@LinkUrl" />
 <xsl:with-param name="delimiter" select="'/'" />
 <xsl:variable name="listTitle">
 <xsl:call-template name="substring-after-last">
 <xsl:with-param name="string" select="$listTitleEnd" />
 <xsl:with-param name="delimiter" select="'/'" />
 <xsl:variable name="DisplayTitle">
 <xsl:call-template name="OuterTemplate.GetTitle">
 <xsl:with-param name="Title" select="@Title"/>
 <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
 <xsl:variable name="LinkTarget">
 <xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
 <div class="item link-item">
 <a href="{$vv1}" target="{$LinkTarget}" title="{@LinkToolTip}"> 
 [<xsl:value-of select="$listTitle" />] <xsl:value-of select="$DisplayTitle"/> - Replies:(<xsl:value-of select="substring-after(@ItemChildCount,'#') "/>) - Last updated: <xsl:value-of select="$formattedLastUpdatedDate" />

3) Once you’ve done that, go back and edit your Content Query Web Part.  Now, scroll down to “Presentation” and expand it.  Be sure to select the sorting / counts you’d like displayed.  Then be sure to select your new style template you just added.


5) If you are using SharePoint 2013, you will want to make sure you add the entry for the ItemChildCount, as it will not be picked up automatically.  (I spent a good couple hours trying to figure out why it would display in SP2010 and not SP2013.)


6) Click ok, and voila!  A nice rollup of a more detailed view of the discussion content on your site.


SharePoint 2013 Search Not Returning Results / SP1 Configuration Wizard Fails At Step 8

We recently upgrade our environment from SharePoint 2010 to SharePoint 2013.  As part of the upgrade we created a new search service application, performed database attach upgrades for our content and then ran the appropriate crawls.

Along the way, we encountered an issue where search results were not being returned.  Just a correlation ID, and a “Web part could not be displayed” error.  Curiously, there did not appear to be anything wrong with the Search Service Application, or the Web Application.

Thinking the issue could have been some sort of SharePoint bug, we attempted to upgrade our environment to SP1.  All the front end servers upgraded fine, but the server hosting Central Admin and the Search Service Application failed at step 8.

It turns out the solution was to re-provision the Search Service Application, and then clear the SharePoint Configuration Cache.

$ssa = Get-SPEnterpriseSearchServiceApplication "Search Service Application"
$ssa.Status = "Disabled"
  • Stop the “SharePoint Administration” and “SharePoint Timer Service”
  • Browse to %SystemDrive%\ProgramData\Microsoft\SharePoint\Config\<GUID>
  • Select every file *EXCEPT* Cache.ini
  • Delete the all XML configuration files
  • Open Cache.ini. Delete all the contents of the file, and type 1
  • (This will cause the configuration cache to rebuild itself.)
  • Start the “SharePoint Timer Service” and “SharePoint Administration” service.

Try searching for content on your site. It may take a minute as the cache will need to rebuild.

If all goes well you should see results. You should also be able to run the SharePoint Configuration Wizard successfully now.