0

This question is an exact duplicate of:

How to display custom columns' values in Content Query WebPart? Currently I have a Custom List with 3 columns Title, MobileNo and Address. Content Query WebPart Only Displays First Column's value (Title), but I want to display all column's values on CQWP. How to do it? What are my options?

marked as duplicate by Robert Lindgren Mar 10 '15 at 11:40

This question was marked as an exact duplicate of an existing question.

1

1)Open ItemStyle.xsl

2)Add Template just like DisplayTemplate And give Proper Name(Currently given Name='MyFirst')

3)Add Variable After name="DisplayTitle"/> Currently i have two Columns MobileNo And Address

4)At The End of Code Add span

select="$MobileNo"

select="$Address"

5)Save ItemStyle.xsl and Checkin

6)Click on Edit WebPart ->Presentation->Fields to display: Here u can See Your Custom Column MobileNo & Address

Enter internal Name Of Column MobileNo inside MobileNo Custom Columns & Enter internal Name Of Column Address inside Address Custom Columns.

7)Click Ok

8)Done,now u can see all Custom Columns Data

u can see Total Code Below.(xsl:template name="MyFirst")

    <xsl:variable name="MobileNo"><xsl:value-of select="@MobileNo"></xsl:value-of></xsl:variable>
    <xsl:variable name="Address"><xsl:value-of select="@Address"></xsl:value-of></xsl:variable>

  <div class="item link-item">
    <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
    <a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
      <xsl:if test="$ItemsHaveStreams = 'True'">
        <xsl:attribute name="onclick">
          <xsl:value-of select="@OnClickForWebRendering"/>
        </xsl:attribute>
      </xsl:if>
      <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
        <xsl:attribute name="onclick">
          <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
        </xsl:attribute>
      </xsl:if>
      <xsl:value-of select="$DisplayTitle"/>
    </a> - <span><xsl:value-of select="$MobileNo"></xsl:value-of></span>
    <span><xsl:value-of select="$Address"></xsl:value-of></span>

  </div>
</xsl:template>
  • Hi AXAY, I think I know what you mean. I will try that and will get back to you. – Aks Mar 10 '15 at 10:45

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