内容查询Webpart-显示Blog/Post正文的一部分 [英] Content Query Webpart -- display part of the body of the Blog/Post

查看:100
本文介绍了内容查询Webpart-显示Blog/Post正文的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在Content查询Webpart中显示博客的正文(可能是第一行).在说明"下,我将其设置为正文",但它将显示包括html在内的整个正文.请提供建议.

这是汇总的样子:

预先感谢.

解决方案

wkpli,

会发生此问题,因为HTML标记是在内容查询Web部件中编码的.要解决此问题,我们需要禁用字符<等的输出转义.和>在 XML样式表转换.

1.打开网站集,o打开网站内容>样式库> XSL样式表.

2.备份ItemStyle.xsl.

3.打开ItemStyle.xsl并找到以下所有脚本.

< div>

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

</div> 


4.将它们更改为:

< div>

        < xsl:disable-output-escaping的值=是";选择="@描述"/>

</div> 


5.上传修改后的ItemStyle.xsl.

此处是有关如何在说明"中逐步显示增强型RTF的文章:

https://blog.tallan.com/2014/10/01/displaying-enhanced-rich-text-in-content-query -web-part/

最好的问候,

Linda Zhang


Hi,

I would like to know how I can display part of the body (may be the 1st line) of the blog in the Content query webpart. Under Description, I set it Body, but it displays the whole body including the html. Please advice how that can be done.

This is how the roll up looks like:

Thanks in advance. Your help would be greatly appreciated!

解决方案

Hi wkpli,

This issue occurs because the HTML markup is encoded in the Content Query Web part. To resolve this issue, we need to disable output escaping of characters such as < and > in an XML style sheet transformation.

1. Open to the site collection, o to Site Contents > Style Library > XSL Style Sheets.

2. Backup the ItemStyle.xsl.

3. Open ItemStyle.xsl and find all the following script.

<div>

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

</div>


4. Change them to:

<div>

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

</div>


5. Upload the modified ItemStyle.xsl.

Here is an article about how to display Enhanced Rich Text in Description step by step:

https://blog.tallan.com/2014/10/01/displaying-enhanced-rich-text-in-content-query-web-part/

Best Regards,

Linda Zhang


这篇关于内容查询Webpart-显示Blog/Post正文的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆