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 am trying to create a blog feed on our SharePoint 2013 intranet homepage to show the three most recent company blog posts. I have tried with both the Content Query Web Part and the Content Search Web Part but I have gotten stuck on both of these as follows:

CQWP- I changed the Source of the query to "Show items from the following list:" and browsed to this list /Blog/Lists/Posts. For List Type I left it as Posts and basically left the default settings for everything else. Under Presentation>Fields to display I put Body in the Description field and then clicked Ok. The problem with this is that it displays the body of the post as plain text instead of the rendered html. It looks like this: CQWP plain text

CSWP- I created a query that shows new blog posts and sorts by creation date in descending order. Under Display Templates>Item I selected Two lines. Then under Property Mappings I selected Change the mapping of managed properties and for Line 2 I selected BodyOWSMTXT and got a very similar result to the CQWP: CSWP plain text

Can someone please help me figure out how to display the html instead of the plain text either by changing the managed property of the blog body, changing the display template or some other method? I have been stuck trying to figure this out all week.

Thanks so much!

share|improve this question

2 Answers 2

Modifying the underlying XSL files worked in SP2010: http://blog.kappasolutions.ca/blog/post/2010/09/12/How-to-Display-HTML-in-Content-Query-Web-Part.aspx

Specifically, setting disable-output-escaping to yes in ItemStyle.xsl.

ie. <xsl:value-of select="@Something" disable-output-escaping="yes" />

I haven't tried it in 2013 yet, but this article leads me to believe it still works: http://sp2013.blogspot.com/2013/11/two-sharepoint-lists-in-dataview-linked.html

share|improve this answer

How to render Blogs Body column as Html in CQWP:

1) Open /Style Library/XSL Style Sheets/ItemStyle.xsl file

2) Locate Item Style template (in your example Xsl template named Default) and replace the line for Description slot:

<xsl:value-of select="@Description" />

with this one:

<xsl:value-of select="@Description" disable-output-escaping="yes" />
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.