SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
@RobertLindgren Actually it's an XSL issue. – Daniel Ziga May 21 '13 at 13:47
@RobertLindgren It should, yes. But css alone cannot fix it when the very HTML structure becomes broken along the way. – Daniel Ziga May 21 '13 at 13:50
True that! I have not seen exactly how it breaks the layout so there of my answer. Will clean my earlier comments. – Robert Lindgren May 21 '13 at 13:52
up vote 6 down vote accepted

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.

My solution:

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: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 style="display:none">No content found</div>

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.

share|improve this answer
Yep, SP2013. That solved the issue. Thank you good sir! – Trenton Mak May 21 '13 at 14:02
thanks that was really helpful!!!! – user30384 Jul 9 '14 at 11:19
@chanalevy You're welcome :) – Daniel Ziga Jul 9 '14 at 13:06
Is this problem solved in any service packs? – SharePoint Freak Jan 28 '15 at 14:10
@Richard Not that I'm aware of. – Daniel Ziga Jan 29 '15 at 7:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.