blogs - CQWP
I'm using a content query web part to show blogs from my site and sub sites, I'm able to pull the title, author, date, description but not the number of comments for each blog. I've added this to my ItemStyle.xslt
   <li class="blogListPostLinksItem last">
          <span style="vertical-align: middle;">
            <span style="; width: 16px; display: inline-block; height: 16px; overflow: hidden;">
              <a style="width: 16px; display: inline-block; height: 16px;">
                <xsl:attribute name="href">
                  <xsl:value-of select="url"/>
                </xsl:attribute>
                <img longdesc="Number of Comments" class="imglink" title="Number of Comments" style="left: 0px ! important; top: -396px ! important; ;" alt="Number of Comments" src="/_layouts/images/fgimg.png" />
              </a>
            </span>
            <span>
              <a>
                <xsl:attribute name="href">
                  <xsl:value-of select="url"/>
                </xsl:attribute>
                <xsl:text>
                </xsl:text>
                <xsl:value-of select="numcomments"/>
                Comment(s)
              </a>
            </span>
          </span>
        </li>

however, the number of comments is not showing, its only showing [comment(s)], what am i missing to get the actual number?
May 28th, 2015 8:00pm

Hi,

About how to show number of comments in Content Query Web Part, you can customize the .webpart file and ItemStyle.xml file by following the demo below:

http://erikswenson.blogspot.com/2010/03/sharepoint-2010-content-query-for-blog.html  

Thanks 

Patrick Liang

Free Windows Admin Tool Kit Click here and download it now
May 30th, 2015 11:03pm

I can't edit the web part file, not allowed within the org. I can modify the itemstyle.xsl file which I've done based on a few articles I've read, including the one attached, however, the number of comments don't show
June 2nd, 2015 12:00pm

Hi,

Without modifying the .webpart file of the Content Query Web Part, we cant specify the NumComments field in the view of Content Query Web Part, then it wont display though we have customized the ItemStyle.xsl which is responsible for the style design.

If modifying .webpart file is forbidden in your scenario, a possible workaround is applying some JavaScript with the help of JavaScript Client Object Model to fetch and display the number of comments of each post in a custom HTML table.

Thanks 

Patrick Liang

Free Windows Admin Tool Kit Click here and download it now
June 2nd, 2015 9:42pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics