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

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

DiscussionRollupFinal

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.

DiscussionRollupStep1

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>
 <xsl:variable name="formattedLastUpdatedDate">
 <xsl:value-of select="ddwrt:FormatDateTime(string(@DiscussionLastUpdated) ,1033 ,'dd MMM yyyy')" />
 </xsl:variable>
 <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:call-template>
 </xsl:variable>
 <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:call-template>
 </xsl:variable>
 <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:call-template>
 </xsl:variable>
 <xsl:variable name="LinkTarget">
 <xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
 </xsl:variable>
 <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" />
 </a>
 </div>
</xsl:template>

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.

DiscussionRollupStep2

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.)

DiscussionRollupStep3

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

DiscussionRollupFinal

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"
$ssa.Update()
$ssa.Provision()
  • Stop the “SharePoint Administration” and “SharePoint Timer Service”
    stopservice
  • Browse to %SystemDrive%\ProgramData\Microsoft\SharePoint\Config\<GUID>
  • Select every file *EXCEPT* Cache.ini
    deleteconfigurationfiles
  • 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.