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

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 4:39pm

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.

  • Marked as answer by StevenBennett Tuesday, August 04, 2015 8:31 PM
August 4th, 2015 8:31pm

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

Other recent topics Other recent topics