TYPO3流体:只有某些HTML标记不会在流体模板中呈现 [英] TYPO3 Fluid: Only SOME HTML tags are not rendered in fluid template
本文介绍了TYPO3流体:只有某些HTML标记不会在流体模板中呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个非常奇怪的行为,向TYPO3专家提出了一个问题:一些HTML标记没有呈现,输出如下:<form enctype="multipart/form-data" />
但仅使用标记<form>, <input>, <label>, <figure>
所有其他标记<div>, <p>, <span>, <button>, <h2>, even <script>
工作正常。
顺便说一下。它与<f:format.html> or <f:format.raw>
无关,因为我没有来自系统的输出,它直接在模板中。
这是我的模板:
<html xmlns:f="https://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="content">
<f:flashMessages />
<figure class="test">NOT working - tags rendered as text</figure>
<form action="">NOT working - tags rendered as text</form>
<div class="employees">working</div>
<p class="paragraph">working</p>
</f:section>
另一件有趣的事情是:TYPO38.7的官方"Form"扩展也出现了这个问题!完全相同的问题,提到的标记没有呈现为HTML!
我希望有人能帮我解决这个问题。我都快疯了。
环境
- TYPO3:8.7.22
- PHP:7.2
- 扩展:realURL、DCE、扩展生成器、 栅格元素、VHS流体视图帮助器、Yoast SEO、新闻
-UPDATE:添加TypoScrip和布局文件-
TypoScrip我的扩展(由扩展生成器生成)
plugin.tx_rmdataschulungen_rmdataschulungen {
view {
templateRootPaths.0 = EXT:rmdata_schulungen/Resources/Private/Templates/
templateRootPaths.1 = {$plugin.tx_rmdataschulungen_rmdataschulungen.view.templateRootPath}
partialRootPaths.0 = EXT:rmdata_schulungen/Resources/Private/Partials/
partialRootPaths.1 = {$plugin.tx_rmdataschulungen_rmdataschulungen.view.partialRootPath}
layoutRootPaths.0 = EXT:rmdata_schulungen/Resources/Private/Layouts/
layoutRootPaths.1 = {$plugin.tx_rmdataschulungen_rmdataschulungen.view.layoutRootPath}
}
persistence {
storagePid = 106{$plugin.tx_rmdataschulungen_rmdataschulungen.persistence.storagePid}
#recursive = 1
}
features {
#skipDefaultArguments = 1
ignoreAllEnableFieldsInBe = 0
requireCHashArgumentForActionArguments = 1
}
mvc {
#callDefaultActionIfActionCantBeResolved = 1
}
}
布局文件(由扩展生成器生成)
<html xmlns:f="https://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<div class="tx-rmdata-schulungen">
<f:render section="content" />
</div>
</html>
TypoScrip(输出页面内容)
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
templateName = Default
templateRootPaths.1 = fileadmin/Resources/Private/Templates/Page
variables {
content < styles.content.get
nav < Navigation
searchbox < lib.searchField
}
}
推荐答案
我解决了我的问题:问题确实是<f:format.html>
,但在主模板中。
我总是编辑我的扩展模板->但使用我的网站模板中的<f:format.raw>
(用于常规输出),一切正常(尽管我不理解为什么会出现这种关于HTML标记的特殊行为)。
这篇关于TYPO3流体:只有某些HTML标记不会在流体模板中呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文