Typo3 tx_news-Viewhelper:纯文本输出
我需要的挑逗纯纯文本,没有任何链接或文本格式在最新的看法,可能性。它是为相应的ViewHelper提供的还是为不同的方法提供的Typo3 tx_news-Viewhelper:纯文本输出,typo3,fluid,typo3-7.6.x,tx-news,Typo3,Fluid,Typo3 7.6.x,Tx News,我需要的挑逗纯纯文本,没有任何链接或文本格式在最新的看法,可能性。它是为相应的ViewHelper提供的还是为不同的方法提供的 HTML实体,不应将其用作&f:format.raw()->f:format.stripTags()}。在内部,这会导致strip_标记(htmlspecialchars(htmlspecialdecode(htmlspecialchars($newstasterver)))等效处理,因为逃逸在流体中如何工作。通常情况下,如果HTML受信任,则不需要执行htmle
HTML实体,不应将其用作
&例如,新闻列表使用每个项目的分部(Resources/Private/Partials/list/item.html
)呈现。在其中,您可以看到用于渲染摘要的线条:
{newsItem.teaser -> f:format.crop(maxCharacters: '{settings.cropMaxCharacters}', respectWordBoundaries:'1') -> f:format.html()}
如果删除最后一个视图帮助程序f:format.html()
,则它将不会转换为html。如果将其替换为f:format.raw()
(如果在摘要中有HTML),则HTML将按原样输出,而不转换为等
重写部分时,不应直接修改扩展,而应以升级安全的方式进行修改。为此,请将它们放在您的站点扩展或fileadmin/
中,并将该部分路径添加到TS配置中:
plugin.tx_productview {
view {
partialRootPaths.1 = [path to partials folder]
}
}
对于新闻
,还有一个特殊的机制:您可以设置一个常量
plugin.tx_news.view.partialRootPath = […]
到路径。新闻列表使用每个项目的分部(Resources/Private/Partials/list/item.html
)呈现。在其中,您可以看到用于渲染摘要的线条:
{newsItem.teaser -> f:format.crop(maxCharacters: '{settings.cropMaxCharacters}', respectWordBoundaries:'1') -> f:format.html()}
如果删除最后一个视图帮助程序f:format.html()
,则它将不会转换为html。如果将其替换为f:format.raw()
(如果在摘要中有HTML),则HTML将按原样输出,而不转换为等
重写部分时,不应直接修改扩展,而应以升级安全的方式进行修改。为此,请将它们放在您的站点扩展或fileadmin/
中,并将该部分路径添加到TS配置中:
plugin.tx_productview {
view {
partialRootPaths.1 = [path to partials folder]
}
}
对于新闻
,还有一个特殊的机制:您可以设置一个常量
plugin.tx_news.view.partialRootPath = […]
到路径。使用
Viewhelper。
要确保所有html实体都已解码,请使用
因此,您可以使用:
<f:format.stripTags>
<f:format.htmlentitiesDecode>
{newsTeaserVar}
</f:format.htmlentitiesDecode>
</f:format.stripTags>
{新闻摘要}
使用
Viewhelper。
要确保所有html实体都已解码,请使用
因此,您可以使用:
<f:format.stripTags>
<f:format.htmlentitiesDecode>
{newsTeaserVar}
</f:format.htmlentitiesDecode>
</f:format.stripTags>
{新闻摘要}
在内部,这会导致strip_标记(htmlspecialchars(htmlspecialdecode(htmlspecialchars($newstearvar)))代码>等效处理,因为逃逸在流体中如何工作。通常情况下,不需要htmlentitiesDecode
步骤,如果HTML是可信的,则可以用f:format.raw
替换{newstastervar->f:format.raw()->f:format.stripTags()}
。在内部,这会导致strip_标记(htmlspecialchars(htmlspecialdecode(htmlspecialchars($newstasterver)))代码>等效处理,因为逃逸在流体中如何工作。通常情况下,如果HTML受信任,则不需要执行htmlentitiesDecode
步骤,可以将其替换为f:format.raw
:{newsteastervar->f:format.raw()->f:format.stripTags()}
。