Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to read the value of a multi-line, enhanced rich text field from a content query web part using a custom ItemStyle template in SP 2010. Even though it has a value, it keeps coming back as blank. The column type is described as "Multiple lines of text", with "Enhanced rich text (Rich text with pictures, tables, and hyperlinks)" enabled.

The column name is "Opening Hours". In the *.webpart, I've defined it using

<property name="CommonViewFields" 
  type="string">Opening_x005F_x0020_Hours,Text</property> 
....
<property name="DataColumnRenames" 
  type="string">Opening_x005F_x0020_Hours,OpeningHours;</property>

In the custom ItemStyle_ContactDetails.xsl, it's read using this simple loop:

<xsl:for-each select="@*">
   P:<xsl:value-of select="name()" /><br />
   v:<xsl:value-of select="." /><br />
</xsl:for-each>

When I import the web part and insert it into a page, it displays this for the opening hours:

P:OpeningHours
v:

I've triple checked to ensure the column has value. Other fields display their values in the web part, though. This is the only Enhanced rich text field I'm using in this list. I also tried changing the type to HTML and RichHTML to no avail. What am I doing wrong? Thanks.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You have to disable output escaping by adding disable-output-escaping="yes" to the element. It is covered in this post on MSDN.

http://blogs.msdn.com/b/ben_hickman/archive/2009/05/22/content-query-web-part-example.aspx

share|improve this answer

Your Answer

 
discard

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.