Show the Body of Announcement at Content Query Web Part
-
Tuesday, May 12, 2009 7:00 AM
I attempt to show the Body of Announcement at Content Query Web Part.
Case 1
I get the following result:
The 1st line shows the Title as normal.
The 2nd line shows:
<div class=ExternalClass90BF9EBAACDA4DF59EBCBD401F04EBBF><div>Hello!</div></div>
It should be 'Hello!' only without the html code.I tried the following at the webpart file:
<property name="CommonViewFields" type="string">Body, Note</property> or
<property name="CommonViewFields" type="string">Body, RichHTML</property> or
<property name="CommonViewFields" type="string">Body, RichText</property>.
Certainly, I have the following at the ItemStyle file:
<div class="description">
<xsl:value-of select="@Body" />.
Case 2
I get the following result:
The 1st line shows the Title as normal.
The 2nd line shows nothing of the Announcement Body.I tried the following at the webpart file:
<property name="CommonViewFields" type="string">Body_x0020_content, RichHTML</property> or
<property name="CommonViewFields" type="string">Body_x0020_content, Note</property> or
<property name="CommonViewFields" type="string">Body_x0020_content, RichText</property>
with the ItemStyle file:
<div class="description">
<xsl:value-of select="@Body_x0020_content" />.and
<property name="CommonViewFields" type="string">Body_x005F_x0020_content, RichHTML</property> or
<property name="CommonViewFields" type="string">Body_x005F_x0020_content, Note</property> or
<property name="CommonViewFields" type="string">Body_x005F_x0020_content, RichText</property>
with the ItemStyle file:
<div class="description">
<xsl:value-of select="@Body_x005F_x0020_content" />.Please help.
I have read the following:
http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx
http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx
All Replies
-
Wednesday, April 07, 2010 9:15 PM
You have probably moved on from this problem but in case someone else needs the answer:
First in the web part you need to use this:
<property name="CommonViewFields" type="string">Body, RichHTML</property>Second in your XSL you need to use this:
<xsl:value-of select="@Body" disable-output-escaping="yes"/>Then you should be all set.
Andrew
- Proposed As Answer by Becky Bertram Thursday, June 03, 2010 4:45 AM
- Marked As Answer by Mike Walsh FIN Friday, June 04, 2010 3:15 AM
-
Wednesday, June 02, 2010 9:02 PMThank you Andrew!
-
Monday, March 19, 2012 11:51 AMThanks Andrew for the response, please can you let me know where will i find the XSL file so that i can go ahead with the second step.
-
Tuesday, May 01, 2012 3:39 PM
Hi Tulajaram,
In case you haven't found it yet, that code will be on whatever page the Web Part is on and can be opened in Designer.

