On my main landing page of SharePoint, I'm using a few CQWPs and the Blank Web Parts Page layout. One will show your upcoming tasks, one will show the projects you're a member or lead of, etc. I have most of the CQWPs in the Center Left zone. Center and Center Right zones are always populated with something. If a CQWP in the Center Left zone returns no results, the Center and Center Right zone are pushed below the Center Left zone, instead of sitting to the right of Center Left. Anyone know how I can keep the Center and Center Right zones in place even if the CQWP returns no results?
I'm guessing this is SP2013, as I myself have only encountered this in SP2013.
My personal explanation to this:
SharePoint 2013 Content By Query web part has a minor bug in its early releases. When returning no items it accidentally breaks the HTML structure of the page.
Open the ContentQueryMain.xsl in SharePoint Designer. Find the XSL template OuterTemplate.Empty. As you can see it poorly handles the There exist no items situation.
Replace the template with this:
<xsl:template name="OuterTemplate.Empty"> <xsl:param name="EditMode" /> <xsl:choose> <xsl:when test="$EditMode = 'True' and string-length($cbq_errortext) = 0"> <div class="wp-content description"> <xsl:value-of disable-output-escaping="yes" select="$cbq_viewemptytext" /> </div> </xsl:when> <xsl:otherwise> <div style="display:none">No content found</div> </xsl:otherwise> </xsl:choose> </xsl:template>
This way it renders something when there's nothing else to render and it does not break the HTML structure of the rest of the page.
I hope this solves your issue.