4

We have a SP2010 site that we are making extensive use of the CQWP (Content Query Web Part) on. When I point the CQWP at a specific list it displays description value fine. The problem is when I point it at a hierarchy of SPWebs and configure it to rollup all items of type Calendar. When I do this all data comes through fine except for Description, which is very odd. I tried using internal field name too it doesn't seem to make any difference.

So my question is how do I get CQWP to render description field from multiple calendar lists?

<xsl:template name="MyEventStyle" match="Row[@Style='MyEventStyle']" mode="itemstyle">
<div class="webpart-item">
  <h2>
    <span class="tooltip-event-selector"><xsl:value-of select="@Title"/></span>
  </h2>
  <p class="date"><xsl:value-of select="ddwrt:FormatDate(@EventDate, 1033, 1)" /></p>
  <div class="webpart-item-content">
    <xsl:value-of disable-output-escaping="yes" select="@Description" />
      <a>
        <xsl:attribute name="href"><xsl:value-of select="concat('/HomePageFeed/events/calendar.aspx?IsDlg=1&amp;CalendarDateIs=', ddwrt:FormatDate(@EventDate, 1033, 1))" /></xsl:attribute>
        <xsl:attribute name="class">dialog-pop</xsl:attribute>
      </a>
  </div>
  <div class="hidden">
    <div class="tooltip-event-content">
      <div><strong>Event Information</strong></div>
      <div><xsl:value-of select="ddwrt:FormatDate(@EventDate, 1033, 1)" /></div>
      <div><xsl:value-of select="ddwrt:FormatDate(@EventDate, 1033, 4)" /> - <xsl:value-of select="ddwrt:FormatDate(@EndDate, 1033, 4)" /></div>
      <div><xsl:value-of select="@Description" /></div>
    </div>
  </div>
</div>
</xsl:template>
4
  • So does this render the description fine when you point the CQWP at one specific calendar? When you do the rollup, do you select a content type, or let it pick from all content types?
    – James Love
    Commented May 3, 2011 at 18:30
  • Yes it does when pointed at one specific calendar. I've tried specific content types and all content types and it doesn't seem to make a difference.
    – James
    Commented May 3, 2011 at 19:30
  • Right, does anything come through at all, or nothing? (ie: some of the lists' data or none?)
    – James Love
    Commented May 3, 2011 at 19:43
  • Yes everything else comes through except description title, dates etc. I'm using a custom item style defined in ItemStyle.xsl I updated my post with this code.
    – James
    Commented May 3, 2011 at 21:37

1 Answer 1

3

I was able to get this working by changing the DataMappings, and DataMappingViewFields. The values in these fields are very sensitive and a space or semi-colon in the wrong place will break it. I've posted what worked below, hopefully this will save someone else two days of misery!

<property name="DataMappings" type="string">Title:{fa564e0f-0c70-4ab9-b863-0177e6ddd247},Title,Text;|LinkUrl:|Description:{9da97a8a-1da5-4a77-98d3-4bc10456e700},Comments,Note;|ImageUrl:{b9e6f3ae-5632-4b13-b636-9d1a2bd67120},EncodedAbsThumbnailUrl,Computed;{543bc2cf-1f30-488e-8f25-6fe3b689d9ac},PublishingRollupImage,Image;|EndDate:{2684f9f2-54be-429f-ba06-76754fc056bf},EndDate,DateTime;|EventDate:{64cd368d-2f95-4bfc-a1f9-8d4324ecb007},StartDate,DateTime;|</property>


<property name="DataMappingViewFields" type="string">{b9e6f3ae-5632-4b13-b636-9d1a2bd67120},Computed;{543bc2cf-1f30-488e-8f25-6fe3b689d9ac},Image;{fa564e0f-0c70-4ab9-b863-0177e6ddd247},Text;{9da97a8a-1da5-4a77-98d3-4bc10456e700},Note;{64cd368d-2f95-4bfc-a1f9-8d4324ecb007},DateTime;{2684f9f2-54be-429f-ba06-76754fc056bf},DateTime;</property>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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