HTML / Rich Text Stripped out of CQWP

I have a list that contains a multiline column with column called description that is using Enhanced Rich Text. I have a Content Search Web part set to search the list and return the Title and the Description. The description is coming back in plain text. I have tried the following code but I think I'm missing something.

var contentBody = $getItemValue(ctx, "Body");

        <div class="burke-contentPageContainer" id="_#= containerId =#_" data-displaytemplate="ItemGenericContent">
            <div class="burke-contentPageDataContainer" id="_#= dataContainerId =#_">
                <h1 id="_#= titleId =#_"> _#= contentTitle =#_</h1>
                <div class="burke-contentHtml" title="" id="_#= bodyId =#_" > _#=STSHtmlDecode(contentBody.value)=#_</div>
                <div id="_#= attachmentsId =#_">_#=linkMarkup=#_</div>
            </div>
        </div>


July 31st, 2015 9:44pm

Column Settings is set to Enhanced Rich Text
Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2015 1:20pm

Hi,

Please refer the below text which I have got it from msdn blogs. 

Pictures and Rich Text

Both Picture and Rich Text column types are stored with embedded HTML markup. By default, when you use XSL to render these column values, the HTML is escaped and the viewer sees the actual markup rather than just the formatted content. To render these column values, use the disable-output-escaping attribute:

<div class="image-area-left"> 
    <xsl:value-of select="@Icon" disable-output-escaping="yes"/> 
</div>

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

August 4th, 2015 5:20am

I'm an idiot. I'm meant to say Content Search Web Part not CQWP.  And I've tried this.

var desc = $getItemValue(ctx, "Description");

_#= STSHtmlDecode(desc.value) =#_

But it doesn't appear to work.

Free Windows Admin Tool Kit Click here and download it now
August 4th, 2015 12:42pm

I found a StockExchange forum article that referenced a problem with Enhanced Rich Text columns.  Apparently the preferred method is to use a Full HTML publishing column.  I created a new Site Column and added to my list from existing site columns.  Here is the Microsoft link I found. https://support.office.com/en-ca/article/Add-publishing-columns-to-content-types-lists-or-libraries-4e268d2e-4822-4bc6-a992-88287119a052

Unfortunately, I could not find the original StockExchange forum post.  Thanks for everyones' help.

August 4th, 2015 4:34pm

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

Other recent topics Other recent topics