简体   繁体   English

TYPO3 扩展/插件创建<p> HTML 页面中的标签

[英]TYPO3 extensions/plugins creating <p> tags in HTML pages

I created an extension and plugin using extension builder which generates some HTML code to a file fileadmin/templates/List.html .This content goes into my web page's template.html as我使用扩展生成器创建了一个扩展和插件,它生成一些 HTML 代码到文件fileadmin/templates/List.html 。这个内容进入我的网页的 template.html 作为

<f:section name="some-content">
<f:format.html> {some_content} </f:format.html> 
</f:section>

some_content comes from my Typoscript template some_content 来自我的 Typoscript 模板

some_content < styles.content.get
some_content.select.where = colPos = 1

The plugin is attached from a backend layout该插件是从后端布局附加的

The problem is that in my HTML page I get plugin information in <p> tags问题是在我的 HTML 页面中,我在<p>标签中获取了插件信息

<p class="bodytext">&nbsp;</p>
<p class="bodytext">    <!--  CONTENT ELEMENT, uid:260/list [begin] --></p>
<p class="bodytext">&nbsp;</p><div id="c260" class="csc-default"><p class="bodytext">&nbsp;</p>
<p class="bodytext">        <!--  Plugin inserted: [begin] --></p>
<p class="bodytext">&nbsp;</p>
<p class="bodytext">        <!--  Plugin inserted: [end] --></p>
<p class="bodytext">&nbsp;</p></div><p class="bodytext">    <!--  CONTENT ELEMENT, uid:260/list [end] --></p>
<p class="bodytext">&nbsp;</p>

And this messing up my CSS.这搞砸了我的 CSS。

<f:format.html> uses RTEparser to parse the content in it. <f:format.html> format.html <f:format.html>使用 RTEparser 解析其中的内容。 Each new line will be wrapped with a p -tag.每个新行都用一个p标签包裹。

Use <f:format.raw> to avoid HTML escaping.使用<f:format.raw>避免 HTML 转义。

add following lines in template script of root在 root 的模板脚本中添加以下行

In Constants :在常量中:

content.RTE_compliant = 0

In Setup :在设置中:

tt_content.stdWrap.dataWrap >
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines>

As you want to use <f:format.html> i would prefer to still use it, but with its parseFunc attribute.当您想使用<f:format.html>我更愿意仍然使用它,但使用它的 parseFunc 属性。

<f:format.html parseFuncTSPath="">{some_content}</f:format.html>

There you can assign the parse functionality.在那里您可以分配解析功能。 (An empty value ignores the standard behaviour and the default display of P tags. (空值会忽略标准行为和 P 标签的默认显示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM